• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP api_Utils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中api_Utils的典型用法代码示例。如果您正苦于以下问题:PHP api_Utils类的具体用法?PHP api_Utils怎么用?PHP api_Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了api_Utils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: Import

 /**
  * @param int $iUserId
  * @param string $sTempFileName
  * @param int $iParsedCount
  * @return int
  */
 public function Import($iUserId, $sTempFileName, &$iParsedCount)
 {
     $iCount = -1;
     $iParsedCount = 0;
     if (file_exists($sTempFileName)) {
         $aCsv = api_Utils::CsvToArray($sTempFileName);
         if (is_array($aCsv)) {
             $iCount = 0;
             foreach ($aCsv as $aCsvItem) {
                 set_time_limit(30);
                 $this->oParser->Reset();
                 $oContact = new CContact();
                 $oContact->IdUser = $iUserId;
                 $this->oParser->SetContainer($aCsvItem);
                 $aParameters = $this->oParser->GetParameters();
                 foreach ($aParameters as $sPropertyName => $mValue) {
                     if ($oContact->IsProperty($sPropertyName)) {
                         $oContact->{$sPropertyName} = $mValue;
                     }
                 }
                 if (0 === strlen($oContact->FullName)) {
                     $oContact->FullName = trim($oContact->FirstName . ' ' . $oContact->LastName);
                 }
                 $iParsedCount++;
                 $oContact->__SKIP_VALIDATE__ = true;
                 if ($this->oApiContactsManager->CreateContact($oContact)) {
                     $iCount++;
                 }
                 unset($oContact, $aParameters, $aCsvItem);
             }
         }
     }
     return $iCount;
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:40,代码来源:csv.php


示例2: Import

 /**
  * @param int $iUserId
  * @param string $sTempFileName
  * @param int $iParsedCount
  * @param int $iGroupId
  * @param bool $bIsShared
  * @return int
  */
 public function Import($iUserId, $sTempFileName, &$iParsedCount, $iGroupId, $bIsShared)
 {
     $iCount = -1;
     $iParsedCount = 0;
     if (file_exists($sTempFileName)) {
         $aCsv = api_Utils::CsvToArray($sTempFileName);
         if (is_array($aCsv)) {
             $oApiUsersManager = CApi::Manager('users');
             $oAccount = $oApiUsersManager->GetDefaultAccount($iUserId);
             $iCount = 0;
             foreach ($aCsv as $aCsvItem) {
                 set_time_limit(30);
                 $this->oParser->Reset();
                 $oContact = new CContact();
                 $oContact->IdUser = $iUserId;
                 $this->oParser->SetContainer($aCsvItem);
                 $aParameters = $this->oParser->GetParameters();
                 foreach ($aParameters as $sPropertyName => $mValue) {
                     if ($oContact->IsProperty($sPropertyName)) {
                         $oContact->{$sPropertyName} = $mValue;
                     }
                 }
                 if (0 === strlen($oContact->FullName)) {
                     $oContact->FullName = trim($oContact->FirstName . ' ' . $oContact->LastName);
                 }
                 if (0 !== strlen($oContact->HomeEmail)) {
                     $oContact->PrimaryEmail = \EPrimaryEmailType::Home;
                     $oContact->ViewEmail = $oContact->HomeEmail;
                 } else {
                     if (0 !== strlen($oContact->BusinessEmail)) {
                         $oContact->PrimaryEmail = \EPrimaryEmailType::Business;
                         $oContact->ViewEmail = $oContact->BusinessEmail;
                     } else {
                         if (0 !== strlen($oContact->OtherEmail)) {
                             $oContact->PrimaryEmail = \EPrimaryEmailType::Other;
                             $oContact->ViewEmail = $oContact->OtherEmail;
                         }
                     }
                 }
                 if (strlen($oContact->BirthdayYear) === 2) {
                     $oDt = DateTime::createFromFormat('y', $oContact->BirthdayYear);
                     $oContact->BirthdayYear = $oDt->format('Y');
                 }
                 $iParsedCount++;
                 $oContact->__SKIP_VALIDATE__ = true;
                 if ($oAccount) {
                     $oContact->IdDomain = $oAccount->IdDomain;
                     $oContact->IdTenant = $oAccount->IdTenant;
                 }
                 $oContact->SharedToAll = $bIsShared;
                 $oContact->GroupsIds = array($iGroupId);
                 if ($this->oApiContactsManager->CreateContact($oContact)) {
                     $iCount++;
                 }
                 unset($oContact, $aParameters, $aCsvItem);
             }
         }
     }
     return $iCount;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:68,代码来源:csv.php


示例3: createMin

 /**
  * @param string $sHashID
  * @param array $aParams
  *
  * @return string|bool
  */
 public function createMin($sHashID, $aParams)
 {
     $mResult = false;
     $sNewMin = '';
     if (is_string($sHashID) && 0 < strlen($sHashID) && false !== $this->getMinByID($sHashID)) {
         return false;
     }
     while (true) {
         $sNewMin = api_Utils::GenerateShortHashString(10);
         if (false === $this->getMinByHash($sNewMin)) {
             break;
         }
     }
     if (0 < strlen($sNewMin)) {
         $aParams['__hash_id__'] = $sHashID;
         $aParams['__hash__'] = $sNewMin;
         $aParams['__time__'] = time();
         $aParams['__time_update__'] = time();
         if ($this->oConnection->Execute($this->oCommandCreator->createMin($sNewMin, md5($sHashID), @\json_encode($aParams)))) {
             $mResult = $sNewMin;
         }
     }
     $this->throwDbExceptionIfExist();
     return $mResult;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:31,代码来源:storage.php


示例4: getQuotaInfo

 public function getQuotaInfo()
 {
     $Size = 0;
     $aResult = \api_Utils::GetDirectorySize($this->path);
     if ($aResult && $aResult['size']) {
         $Size = (int) $aResult['size'];
     }
     return array($Size, 0);
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:9,代码来源:RootPublic.php


示例5: Ldap

 /**
  * @staticvar CLdapConnector|null $oLdap
  * @param CAccount $oAccount
  * @return CLdapConnector|bool
  */
 private function Ldap($oAccount)
 {
     //		if ($oAccount)
     //		{
     //			// TODO
     //			$aCustomFields = $oAccount->CustomFields;
     //			$aCustomFields['LdapPabUrl'] = 'ldap://192.168.0.197:389/ou=TestUser2,ou=PAB,dc=example,dc=com';
     //			$aCustomFields['LdapPabUrl'] = 'ldap://jes7dir.netvision.net.il:389/ou=24606995,ou=People,o=netvision.net.il,o=NVxSP,o=pab';
     //			$oAccount->CustomFields = $aCustomFields;
     //		}
     static $aLdap = array();
     if (!$oAccount || !isset($oAccount->CustomFields) || empty($oAccount->CustomFields['LdapPabUrl'])) {
         return false;
     }
     $sPabUrl = $oAccount->CustomFields['LdapPabUrl'];
     $aPabUrl = api_Utils::LdapUriParse($sPabUrl);
     if (isset($aLdap[$sPabUrl]) && $aLdap[$sPabUrl]) {
         return $aLdap[$sPabUrl];
     }
     if (!extension_loaded('ldap')) {
         CApi::Log('LDAP: Can\'t load LDAP extension.', ELogLevel::Error);
         return false;
     }
     if (!class_exists('CLdapConnector')) {
         CApi::Inc('common.ldap');
     }
     $oLdap = new CLdapConnector($aPabUrl['search_dn']);
     $oLdap = $oLdap->Connect((string) $aPabUrl['host'], (int) $aPabUrl['port'], (string) CApi::GetConf('contacts.ldap.bind-dn', ''), (string) CApi::GetConf('contacts.ldap.bind-password', '')) ? $oLdap : false;
     if ($oLdap) {
         if (!$oLdap->Search('(objectClass=*)')) {
             CApi::Log('LDAP: Init PabUrl Entry');
             $sNewDn = $oLdap->GetSearchDN();
             $aDnExplode = ldap_explode_dn($sNewDn, 1);
             $sOu = isset($aDnExplode[0]) ? trim($aDnExplode[0]) : '';
             $aPabUrlEntry = CApi::GetConf('contacts.ldap.pab-url-entry', array('objectClass' => array('top', 'organizationalUnit')));
             if (isset($aPabUrlEntry['objectClass'])) {
                 $aPabUrlEntry['ou'] = $sOu;
                 if (0 < strlen($sOu)) {
                     if (!$oLdap->Add('', $aPabUrlEntry)) {
                         $oLdap = false;
                     }
                 } else {
                     CApi::Log('LDAP: empty Ou in SearchDn = ' . $sNewDn);
                     $oLdap = false;
                 }
             } else {
                 CApi::Log('LDAP: pab-url-entry format error');
                 CApi::Log(print_r($aPabUrlEntry, true));
                 $oLdap = false;
             }
         }
     }
     $aLdap[$sPabUrl] = $oLdap;
     return $oLdap;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:60,代码来源:storage.php


示例6: SystemLogging

 public function SystemLogging(ap_Standard_Screen &$oScreen)
 {
     $this->oSettings->GetConf('Common/LoggingLevel');
     $this->oSettings->GetConf('Common/EnableEventLogging');
     $oScreen->Data->SetValue('ch_EnableDebugLogging', $this->oSettings->GetConf('Common/EnableLogging'));
     $iLogLevel = $this->oSettings->GetConf('Common/LoggingLevel');
     $oScreen->Data->SetValue('selVerbosityFull', ELogLevel::Full === $iLogLevel);
     $oScreen->Data->SetValue('selVerbosityWarning', ELogLevel::Warning === $iLogLevel);
     $oScreen->Data->SetValue('selVerbosityError', ELogLevel::Error === $iLogLevel);
     $oScreen->Data->SetValue('selVerbositySpec', ELogLevel::Spec === $iLogLevel);
     $oScreen->Data->SetValue('ch_EnableUserActivityLogging', $this->oSettings->GetConf('Common/EnableEventLogging'));
     $aSize = $this->oModule->GetLogsSize();
     $oScreen->Data->SetValue('DownloadLogSize', '(' . api_Utils::GetFriendlySize($aSize[0]) . ')');
     $oScreen->Data->SetValue('DownloadUserActivityLogSize', '(' . api_Utils::GetFriendlySize($aSize[1]) . ')');
     $oScreen->Data->SetValue('MaxViewSize', CApi::GetConf('log.max-view-size', 100) . 'KB');
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:16,代码来源:populate.php


示例7: Handle


//.........这里部分代码省略.........
                                                                                 $sType = !empty($aPaths[1]) ? trim($aPaths[1]) : '';
                                                                                 if ('js' === $sType) {
                                                                                     @header('Content-Type: application/javascript; charset=utf-8');
                                                                                     $sResult = \CApi::Plugin()->CompileJs();
                                                                                 } else {
                                                                                     if ('images' === $sType) {
                                                                                         if (!empty($aPaths[2]) && !empty($aPaths[3])) {
                                                                                             $oPlugin = \CApi::Plugin()->GetPluginByName($aPaths[2]);
                                                                                             if ($oPlugin) {
                                                                                                 echo $oPlugin->GetImage($aPaths[3]);
                                                                                                 exit;
                                                                                             }
                                                                                         }
                                                                                     } else {
                                                                                         if ('fonts' === $sType) {
                                                                                             if (!empty($aPaths[2]) && !empty($aPaths[3])) {
                                                                                                 $oPlugin = \CApi::Plugin()->GetPluginByName($aPaths[2]);
                                                                                                 if ($oPlugin) {
                                                                                                     echo $oPlugin->GetFont($aPaths[3]);
                                                                                                     exit;
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             } else {
                                                                                 if ('postlogin' === $sFirstPart && \CApi::GetConf('labs.allow-post-login', false)) {
                                                                                     $oSettings =& \CApi::GetSettings();
                                                                                     $sEmail = trim((string) $this->oHttp->GetRequest('Email', ''));
                                                                                     $sLogin = (string) $this->oHttp->GetRequest('Login', '');
                                                                                     $sPassword = (string) $this->oHttp->GetRequest('Password', '');
                                                                                     $sAtDomain = trim($oSettings->GetConf('WebMail/LoginAtDomainValue'));
                                                                                     if (\ELoginFormType::Login === (int) $oSettings->GetConf('WebMail/LoginFormType') && 0 < strlen($sAtDomain)) {
                                                                                         $sEmail = \api_Utils::GetAccountNameFromEmail($sLogin) . '@' . $sAtDomain;
                                                                                         $sLogin = $sEmail;
                                                                                     }
                                                                                     if (0 !== strlen($sPassword) && 0 !== strlen($sEmail . $sLogin)) {
                                                                                         try {
                                                                                             $oAccount = $oApiIntegrator->loginToAccount($sEmail, $sPassword, $sLogin);
                                                                                         } catch (\Exception $oException) {
                                                                                             $iErrorCode = \ProjectCore\Notifications::UnknownError;
                                                                                             if ($oException instanceof \CApiManagerException) {
                                                                                                 switch ($oException->getCode()) {
                                                                                                     case \Errs::WebMailManager_AccountDisabled:
                                                                                                     case \Errs::WebMailManager_AccountWebmailDisabled:
                                                                                                         $iErrorCode = \ProjectCore\Notifications::AuthError;
                                                                                                         break;
                                                                                                     case \Errs::UserManager_AccountAuthenticationFailed:
                                                                                                     case \Errs::WebMailManager_AccountAuthentication:
                                                                                                     case \Errs::WebMailManager_NewUserRegistrationDisabled:
                                                                                                     case \Errs::WebMailManager_AccountCreateOnLogin:
                                                                                                     case \Errs::Mail_AccountAuthentication:
                                                                                                     case \Errs::Mail_AccountLoginFailed:
                                                                                                         $iErrorCode = \ProjectCore\Notifications::AuthError;
                                                                                                         break;
                                                                                                     case \Errs::UserManager_AccountConnectToMailServerFailed:
                                                                                                     case \Errs::WebMailManager_AccountConnectToMailServerFailed:
                                                                                                     case \Errs::Mail_AccountConnectToMailServerFailed:
                                                                                                         $iErrorCode = \ProjectCore\Notifications::MailServerError;
                                                                                                         break;
                                                                                                     case \Errs::UserManager_LicenseKeyInvalid:
                                                                                                     case \Errs::UserManager_AccountCreateUserLimitReached:
                                                                                                     case \Errs::UserManager_LicenseKeyIsOutdated:
                                                                                                     case \Errs::TenantsManager_AccountCreateUserLimitReached:
                                                                                                         $iErrorCode = \ProjectCore\Notifications::LicenseProblem;
                                                                                                         break;
开发者ID:zhuomingliang,项目名称:webmail-lite,代码行数:67,代码来源:Service.php


示例8: parseGetConf

 /**
  * @param string $sKey
  *
  * @return mixed
  */
 protected function parseGetConf($sKey)
 {
     $mValue = null;
     $sKey = strtolower($sKey);
     if (isset($this->aLowerMap[$sKey])) {
         if (array_key_exists($sKey, $this->aContainer)) {
             $mValue = $this->aContainer[$sKey];
         } else {
             $mValue = $this->aLowerMap[$sKey][0];
         }
         $aType = $this->aLowerMap[$sKey];
         switch ($aType[1]) {
             case 'string':
                 $mValue = api_Utils::EncodeSpecialXmlChars((string) $mValue);
                 break;
             case 'int':
                 $mValue = (int) $mValue;
                 break;
             case 'bool':
                 $mValue = (bool) $mValue ? 'On' : 'Off';
                 break;
             case 'spec':
                 $mValue = $this->specBackConver($sKey, $mValue);
                 break;
         }
     }
     return $mValue;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:33,代码来源:settings.php


示例9: AjaxSocialAccountListGet

 public function AjaxSocialAccountListGet()
 {
     $mResult['Result'] = false;
     $oTenant = null;
     $oAccount = \api_Utils::GetDefaultAccount();
     $oApiTenants = \CApi::Manager('tenants');
     if ($oAccount && $oApiTenants) {
         $oTenant = 0 < $oAccount->IdTenant ? $oApiTenants->getTenantById($oAccount->IdTenant) : $oApiTenants->getDefaultGlobalTenant();
     }
     if ($oTenant) {
         $oApiSocial = \CApi::Manager('social');
         $mResult['Result'] = $oApiSocial->getSocials($oAccount->IdAccount);
     }
     return $mResult;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:15,代码来源:index.php


示例10: getMessageListByUids

 /**
  * Obtains a list of specific messages.
  * 
  * @param CAccount $oAccount Account object.
  * @param string $sFolderFullNameRaw Raw full name of the folder.
  * @param array $aUids List of message UIDs.
  *
  * @return CApiMailMessageCollection
  *
  * @throws CApiInvalidArgumentException
  */
 public function getMessageListByUids($oAccount, $sFolderFullNameRaw, $aUids)
 {
     if (0 === strlen($sFolderFullNameRaw) || !is_array($aUids) || 0 === count($aUids)) {
         throw new CApiInvalidArgumentException();
     }
     $oMessageCollection = false;
     $oImapClient =& $this->_getImapClient($oAccount);
     $oImapClient->FolderExamine($sFolderFullNameRaw);
     $aList = $this->_getFolderInformation($oImapClient, $sFolderFullNameRaw);
     $iMessageRealCount = $aList[0];
     $iMessageUnseenCount = $aList[1];
     $sUidNext = $aList[2];
     $oMessageCollection = CApiMailMessageCollection::createInstance();
     $oMessageCollection->FolderName = $sFolderFullNameRaw;
     $oMessageCollection->Offset = 0;
     $oMessageCollection->Limit = 0;
     $oMessageCollection->Search = '';
     $oMessageCollection->UidNext = $sUidNext;
     if (0 < $iMessageRealCount) {
         $bIndexAsUid = true;
         $aIndexOrUids = $aUids;
         if (is_array($aIndexOrUids)) {
             $oMessageCollection->MessageCount = $iMessageRealCount;
             $oMessageCollection->MessageUnseenCount = $iMessageUnseenCount;
             $oMessageCollection->MessageSearchCount = $oMessageCollection->MessageCount;
             $oMessageCollection->MessageResultCount = $oMessageCollection->MessageCount;
             if (0 < count($aIndexOrUids)) {
                 $aRequestIndexOrUids = $aIndexOrUids;
                 if ($bIndexAsUid) {
                     $oMessageCollection->Uids = $aRequestIndexOrUids;
                 }
                 if (is_array($aRequestIndexOrUids) && 0 < count($aRequestIndexOrUids)) {
                     $aFetchResponse = $oImapClient->Fetch(array(\MailSo\Imap\Enumerations\FetchType::INDEX, \MailSo\Imap\Enumerations\FetchType::UID, \MailSo\Imap\Enumerations\FetchType::RFC822_SIZE, \MailSo\Imap\Enumerations\FetchType::INTERNALDATE, \MailSo\Imap\Enumerations\FetchType::FLAGS, \MailSo\Imap\Enumerations\FetchType::BODYSTRUCTURE, \MailSo\Imap\Enumerations\FetchType::BODY_HEADER_PEEK), implode(',', $aRequestIndexOrUids), $bIndexAsUid);
                     if (is_array($aFetchResponse) && 0 < count($aFetchResponse)) {
                         $aFetchIndexArray = array();
                         $oFetchResponseItem = null;
                         foreach ($aFetchResponse as &$oFetchResponseItem) {
                             $aFetchIndexArray[$bIndexAsUid ? $oFetchResponseItem->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::UID) : $oFetchResponseItem->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::INDEX)] =& $oFetchResponseItem;
                             unset($oFetchResponseItem);
                         }
                         foreach ($aRequestIndexOrUids as $iFUid) {
                             if (isset($aFetchIndexArray[$iFUid])) {
                                 $oMailMessage = CApiMailMessage::createInstance($oMessageCollection->FolderName, $aFetchIndexArray[$iFUid]);
                                 if (!$bIndexAsUid) {
                                     $oMessageCollection->Uids[] = $oMailMessage->getUid();
                                 }
                                 $oMessageCollection->Add($oMailMessage);
                                 unset($oMailMessage);
                             }
                         }
                     }
                 }
             }
         }
     }
     $oMessageCollection->FolderHash = api_Utils::GenerateFolderHash($sFolderFullNameRaw, $oMessageCollection->MessageCount, $oMessageCollection->MessageUnseenCount, $oMessageCollection->UidNext);
     return $oMessageCollection;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:69,代码来源:manager.php


示例11: GetParamTagValueByName

 /**
  * @param string $sName
  * @return string
  */
 public function GetParamTagValueByName($sName)
 {
     $oParam =& $this->getParamNodeByName($sName);
     return null !== $oParam ? api_Utils::DecodeSpecialXmlChars($oParam->Value) : '';
 }
开发者ID:Git-Host,项目名称:email,代码行数:9,代码来源:xml.php


示例12: RawIframe

 /**
  * @return bool
  */
 public function RawIframe()
 {
     $sEncodedUrl = $this->getParamValue('RawKey', '');
     $sUrl = urldecode($sEncodedUrl);
     $sUrl = trim(trim($sUrl), '/\\?');
     $aParts = null;
     if (!empty($sUrl)) {
         $aParts = explode('/', $sUrl);
     }
     if (is_array($aParts) && isset($aParts[0], $aParts[1], $aParts[2], $aParts[3])) {
         $aValues = \CApi::DecodeKeyValues($aParts[3]);
         if (isset($aValues['Iframed'], $aValues['Name'], $aValues['AccountID']) && (!isset($aValues['MimeType']) || !isset($aValues['FileName']))) {
             $aValues['FileName'] = $aValues['Name'];
             $aValues['MimeType'] = \api_Utils::MimeContentType($aValues['FileName']);
         }
         if (isset($aValues['Iframed'], $aValues['MimeType'], $aValues['FileName']) && $aValues['Iframed'] && \CApi::isIframedMimeTypeSupported($aValues['MimeType'], $aValues['FileName'])) {
             $oAccount = $this->getAccountFromParam(false);
             if ($oAccount) {
                 $sNewUrl = '';
                 $sNewHash = '';
                 $sResultUrl = '';
                 $aSubParts = \CApi::DecodeKeyValues($aParts[3]);
                 if (isset($aSubParts['Iframed']) && (int) $aParts[2] === (int) $oAccount->IdAccount && 0 < $oAccount->IdAccount) {
                     $aSubParts['Time'] = \time();
                     $sNewHash = \CApi::EncodeKeyValues($aSubParts);
                 }
                 if (!empty($sNewHash)) {
                     $aParts[3] = $sNewHash;
                     $sNewUrl = rtrim(trim($this->oHttp->GetFullUrl()), '/') . '/?/' . implode('/', $aParts);
                     \CApi::Plugin()->RunHook('webmail.filter.iframed-attachments-url', array(&$sResultUrl, $sNewUrl, $aValues['MimeType'], $aValues['FileName']));
                     if (empty($sResultUrl) && \CApi::GetConf('labs.allow-officeapps-viewer', true)) {
                         $sResultUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' . urlencode($sNewUrl);
                     }
                 }
                 if (!empty($sResultUrl)) {
                     header('Content-Type: text/html', true);
                     echo '<html style="height: 100%; width: 100%; margin: 0; padding: 0"><head></head><body' . ' style="height: 100%; width: 100%; margin: 0; padding: 0">' . '<iframe style="height: 100%; width: 100%; margin: 0; padding: 0; border: 0" src="' . $sResultUrl . '"></iframe></body></html>';
                     return true;
                 }
             }
         }
     }
     return false;
 }
开发者ID:nsine,项目名称:webmail-lite,代码行数:47,代码来源:Actions.php


示例13: getFullQuotaInfo

 public function getFullQuotaInfo()
 {
     $iFreeSize = 0;
     $sRootPath = $this->getRootPath(\EFileStorageTypeStr::Personal);
     $aSize = \api_Utils::GetDirectorySize($sRootPath);
     $iUsageSize = (int) $aSize['size'];
     $sRootPath = $this->getRootPath(\EFileStorageTypeStr::Corporate);
     $aSize = \api_Utils::GetDirectorySize($sRootPath);
     $iUsageSize += (int) $aSize['size'];
     $oAccount = $this->getAccount();
     if ($oAccount) {
         $oTenant = $this->getTenant();
         if ($oTenant) {
             $iFreeSize = $oTenant->FilesUsageDynamicQuotaInMB * 1024 * 1024 - $iUsageSize;
         }
     }
     return array($iUsageSize, $iFreeSize);
 }
开发者ID:Git-Host,项目名称:email,代码行数:18,代码来源:Directory.php


示例14: InitLoginAndEmail

 /**
  * @param string $sLogin
  * @param string $sAtChar = '@'
  */
 public function InitLoginAndEmail($sLogin, $sAtChar = '@')
 {
     $this->Email = '';
     $this->IncomingMailLogin = $sLogin;
     $sLoginPart = api_Utils::GetAccountNameFromEmail($sLogin);
     $sDomainPart = api_Utils::GetDomainFromEmail($sLogin);
     $sDomainName = $this->Domain->IsDefaultDomain || $this->Domain->IsDefaultTenantDomain ? $sDomainPart : $this->Domain->Name;
     if (!empty($sDomainName)) {
         $this->Email = $sLoginPart . $sAtChar . $sDomainName;
         if ($this->Domain && $this->Domain->IsInternal && 0 < strlen($this->Domain->Name)) {
             $this->IncomingMailLogin = $sLoginPart . $sAtChar . $this->Domain->Name;
         }
     }
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:18,代码来源:account.php


示例15: updateSieveFilters

 /**
  * @param CAcount $oAccount
  * @param array $aFilters
  *
  * @return bool
  */
 public function updateSieveFilters($oAccount, $aFilters)
 {
     $sFilters = "#sieve filter\n\n";
     if ($oAccount) {
         foreach ($aFilters as $oFilter) {
             if ('' === trim($oFilter->Filter)) {
                 continue;
             }
             if (EFilterAction::MoveToFolder === $oFilter->Action && '' === trim($oFilter->FolderFullName)) {
                 continue;
             }
             $aFields = array();
             switch ($oFilter->Field) {
                 default:
                 case EFilterFiels::From:
                     $aFields[] = 'From';
                     break;
                 case EFilterFiels::To:
                     $aFields[] = 'To';
                     $aFields[] = 'CC';
                     break;
                 case EFilterFiels::Subject:
                     $aFields[] = 'Subject';
                     break;
             }
             // condition
             foreach ($aFields as $iIndex => $sField) {
                 $aFields[$iIndex] = '"' . $this->_quoteValue($sField) . '"';
             }
             $sCondition = '';
             $sFields = implode(',', $aFields);
             switch ($oFilter->Condition) {
                 case EFilterCondition::ContainSubstring:
                     $sCondition = 'if header :contains [' . $sFields . '] "' . $this->_quoteValue($oFilter->Filter) . '" {';
                     break;
                 case EFilterCondition::ContainExactPhrase:
                     $sCondition = 'if header :is [' . $sFields . '] "' . $this->_quoteValue($oFilter->Filter) . '" {';
                     break;
                 case EFilterCondition::NotContainSubstring:
                     $sCondition = 'if not header :contains [' . $sFields . '] "' . $this->_quoteValue($oFilter->Filter) . '" {';
                     break;
             }
             // folder
             $sFolderFullName = '';
             if (EFilterAction::MoveToFolder === $oFilter->Action) {
                 $sFolderFullName = api_Utils::ConvertEncoding($oFilter->FolderFullName, 'utf7-imap', $this->sSieveFolderCharset);
             }
             // action
             $sAction = '';
             switch ($oFilter->Action) {
                 case EFilterAction::DeleteFromServerImmediately:
                     $sAction = 'discard ;';
                     $sAction .= 'stop ;';
                     break;
                 case EFilterAction::MoveToFolder:
                     $sAction = 'fileinto "' . $this->_quoteValue($sFolderFullName) . '" ;' . "\n";
                     $sAction .= 'stop ;';
                     break;
             }
             $sEnd = '}';
             if (!$oFilter->Enable) {
                 $sCondition = '#' . $sCondition;
                 $sAction = '#' . $sAction;
                 $sEnd = '#' . $sEnd;
             }
             $sFilters .= "\n" . '#sieve_filter:' . implode(';', array($oFilter->Enable ? '1' : '0', $oFilter->Condition, $oFilter->Field, $oFilter->Filter, $oFilter->Action, $sFolderFullName)) . "\n";
             $sFilters .= $sCondition . "\n";
             $sFilters .= $sAction . "\n";
             $sFilters .= $sEnd . "\n";
         }
         $sFilters = $sFilters . "\n" . '#end sieve filter' . "\n";
         return $this->setFiltersRawData($oAccount, $sFilters);
     }
     return false;
 }
开发者ID:Git-Host,项目名称:email,代码行数:81,代码来源:manager.php


示例16: hasGdSupport

 /**
  * @return bool
  */
 public function hasGdSupport()
 {
     return api_Utils::HasGdSupport();
 }
开发者ID:Git-Host,项目名称:email,代码行数:7,代码来源:manager.php


示例17: GetFile

 public function GetFile($oAccount, $sType, $sPath, $sName, &$bResult, &$bBreak)
 {
     $oClient = $this->GetClient($oAccount, $sType);
     if ($oClient) {
         $bResult = false;
         $bBreak = true;
         $oDrive = new Google_Service_Drive($oClient);
         $oFile = $oDrive->files->get($sName);
         \api_Utils::PopulateGoogleDriveFileInfo($oFile);
         $oRequest = new Google_Http_Request($oFile->downloadUrl, 'GET', null, null);
         $oClientAuth = $oClient->getAuth();
         $oClientAuth->sign($oRequest);
         $oHttpRequest = $oClientAuth->authenticatedRequest($oRequest);
         if ($oHttpRequest->getResponseHttpCode() === 200) {
             $bResult = fopen('php://memory', 'r+');
             fwrite($bResult, $oHttpRequest->getResponseBody());
             rewind($bResult);
         }
     }
 }
开发者ID:afterlogic,项目名称:plugin-filestorage-google-drive,代码行数:20,代码来源:index.php


示例18: Process

 public static function Process($mResult)
 {
     $sSocialRedirect = '';
     if (isset($_COOKIE["SocialRedirect"])) {
         $sSocialRedirect = $_COOKIE["SocialRedirect"];
         @setcookie('SocialRedirect', null);
     }
     if ($sSocialRedirect === 'helpdesk') {
         self::SetValuesToCookie($mResult);
         $sTenantHash = self::GetTenantHashFromCookie();
         if ($sTenantHash) {
             \CApi::Location('./?helpdesk=' . $sTenantHash);
         } else {
             \CApi::Location('./?helpdesk');
         }
     } else {
         $oAccount = \api_Utils::GetDefaultAccount();
         if ($oAccount) {
             $oApiSocial = \CApi::Manager('social');
             $oSocial = new \CSocial();
             $oSocial->IdAccount = $oAccount->IdAccount;
             switch ($mResult['type']) {
                 case 'google':
                     $oSocial->Type = \ESocialType::Google;
                     $oSocial->AccessToken = $mResult['access_token'];
                     $oSocial->RefreshToken = $mResult['refresh_token'];
                     break;
                 case 'dropbox':
                     $oSocial->Type = \ESocialType::Dropbox;
                     $oSocial->AccessToken = $mResult['access_token'];
                     break;
             }
             $oSocial->IdSocial = $mResult['id'];
             $oSocial->Name = $mResult['name'];
             $bCreateResult = $oApiSocial->CreateSocial($oSocial);
             echo "<script>" . "if (typeof(window.opener.servicesSettingsViewModelCallback) !== 'undefined')" . "{" . "window.opener.servicesSettingsViewModelCallback('" . $mResult['type'] . "', " . $bCreateResult . ");" . "window.close();" . "}" . "</script>";
         }
     }
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:39,代码来源:social.php


示例19: DataPath

 /**
  * @return string
  */
 public static function DataPath()
 {
     $dataPath = 'data';
     if (!defined('API_DATA_FOLDER') && @file_exists(CApi::WebMailPath() . 'inc_settings_path.php')) {
         include CApi::WebMailPath() . 'inc_settings_path.php';
     }
     if (!defined('API_DATA_FOLDER') && isset($dataPath) && null !== $dataPath) {
         define('API_DATA_FOLDER', api_Utils::GetFullPath($dataPath, CApi::WebMailPath()));
     }
     return defined('API_DATA_FOLDER') ? API_DATA_FOLDER : '';
 }
开发者ID:afterlogic,项目名称:aurora-core,代码行数:14,代码来源:api.php


示例20: DbInsertArrays

 /**
  * @param object $oObject
  * @param object $oHelper
  * @return array
  */
 public static function DbInsertArrays($oObject, $oHelper)
 {
     $aResult = array(false, false);
     $sQueryParams = '';
     $bUseLogQueryParams = (bool) CApi::GetConf('labs.db.log-query-params', false);
     $oObject->initBeforeChange();
     $aStaticMap = $oObject->getMap();
     $aMap = api_AContainer::DbWriteKeys($aStaticMap, true);
     $aDbKeys = array_keys($aMap);
     $aResult[0] = array_map(array(&$oHelper, 'EscapeColumn'), $aDbKeys);
     $aDbValues = array_values($aMap);
     foreach ($aDbValues as $iIndex => $sKey) {
         $mValue = $oObject->{$sKey};
         if (isset($aStaticMap[$sKey][0])) {
             if ('password' === $aStaticMap[$sKey][0]) {
                 $mValue = api_Utils::EncodePassword($mValue);
             } else {
                 if ('datetime' === $aStaticMap[$sKey][0]) {
                     $mValue = $oHelper->TimeStampToDateFormat($mValue);
                 } else {
                     if ('serialize' === $aStaticMap[$sKey][0]) {
                         $mValue = '' === $mValue ? '' : serialize($mValue);
                     }
                 }
             }
         }
         $a 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP app类代码示例发布时间:2022-05-23
下一篇:
PHP api_AContainer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap