本文整理汇总了PHP中api_Utils::GetAppUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP api_Utils::GetAppUrl方法的具体用法?PHP api_Utils::GetAppUrl怎么用?PHP api_Utils::GetAppUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api_Utils
的用法示例。
在下文中一共展示了api_Utils::GetAppUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AjaxAccountResetPassword
/**
* @return array
*/
public function AjaxAccountResetPassword()
{
$mResult = false;
$oAccount = $this->getDefaultAccountFromParam();
$sUrlHash = $this->getParamValue('UrlHash', '');
$oTenant = null;
if ($oAccount->Domain->IdTenant > 0) {
$oTenant = $this->oApiTenants->getTenantById($oAccount->Domain->IdTenant);
} else {
$oTenant = $this->oApiTenants->getDefaultGlobalTenant();
}
if ($oTenant) {
$oNotificationAccount = $this->oApiUsers->GetAccountByEmail($oTenant->InviteNotificationEmailAccount);
if ($oNotificationAccount) {
$sPasswordResetUrl = rtrim(\api_Utils::GetAppUrl(), '/');
$sPasswordResetHash = \md5(\time() . \rand(1000, 9999) . \CApi::$sSalt);
$oAccount->User->PasswordResetHash = $sPasswordResetHash;
$this->oApiUsers->updateAccount($oAccount);
$sSubject = \CApi::ClientI18N('ACCOUNT_PASSWORD_RESET/SUBJECT', $oAccount, array('SITE_NAME' => $oAccount->Domain->SiteName));
$sBody = \CApi::ClientI18N('ACCOUNT_PASSWORD_RESET/BODY', $oAccount, array('SITE_NAME' => $oAccount->Domain->SiteName, 'PASSWORD_RESET_URL' => $sPasswordResetUrl . '/?reset-pass=' . $sPasswordResetHash . '#' . $sUrlHash, 'EMAIL' => $oAccount->Email));
$oMessage = \MailSo\Mime\Message::NewInstance();
$oMessage->RegenerateMessageId();
$oMessage->DoesNotCreateEmptyTextPart();
$sXMailer = \CApi::GetConf('webmail.xmailer-value', '');
if (0 < strlen($sXMailer)) {
$oMessage->SetXMailer($sXMailer);
}
$oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oTenant->InviteNotificationEmailAccount))->SetSubject($sSubject)->AddText($sBody, true);
$oToEmails = \MailSo\Mime\EmailCollection::NewInstance($oAccount->Email);
if ($oToEmails && $oToEmails->Count()) {
$oMessage->SetTo($oToEmails);
}
if ($oMessage) {
try {
$mResult = $this->oApiMail->sendMessage($oNotificationAccount, $oMessage);
} catch (\CApiManagerException $oException) {
throw $oException;
}
}
}
}
return $this->DefaultResponse($oAccount, __FUNCTION__, $mResult);
}
示例2: CreatePublicLink
public function CreatePublicLink($oAccount, $sType, $sPath, $sName, $sSize, $bIsFolder)
{
$sID = implode('|', array($oAccount->IdAccount, $sType, $sPath, $sName));
$mResult = false;
$oMin = $this->GetMinManager();
$mMin = $oMin->GetMinByID($sID);
if (!empty($mMin['__hash__'])) {
$mResult = $mMin['__hash__'];
} else {
$mResult = $oMin->CreateMin($sID, array('Account' => $oAccount->IdAccount, 'Type' => $sType, 'Path' => $sPath, 'Name' => $sName, 'Size' => $sSize, 'IsFolder' => $bIsFolder));
}
$bServerUseUrlRewrite = \CApi::GetConf('labs.server-use-url-rewrite', false);
$sUrl = $bIsFolder ? '?files-pub=' : ($bServerUseUrlRewrite ? 'share/' : '?/Min/Share/');
return \api_Utils::GetAppUrl() . $sUrl . $mResult;
}