当前位置: 首页>>代码示例>>PHP>>正文


PHP api_Utils::GetAppUrl方法代码示例

本文整理汇总了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);
 }
开发者ID:nsine,项目名称:webmail-lite,代码行数:46,代码来源:Actions.php

示例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;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:15,代码来源:storage.php


注:本文中的api_Utils::GetAppUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。