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


PHP CApi::Manager方法代码示例

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


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

示例1: CommonSocial

 public function CommonSocial(ap_Standard_Screen &$oScreen)
 {
     $oApiCapa = CApi::Manager('capability');
     /* @var $oApiCapa CApiCapabilityManager */
     if ($oApiCapa && !$this->oAdminPanel->IsOnlyReadAuthType()) {
         $oTenant = $this->oModule->GetTenantAdminObject();
         if ($oTenant) {
             $aConnectors = array();
             $oPlugin = \CApi::Plugin()->GetPluginByName('external-services');
             if ($oPlugin) {
                 $aEnableConnectors = $oPlugin->GetEnabledConnectors();
                 $aSocials = $oTenant->getSocials();
                 foreach ($aSocials as $sKey => $oSocial) {
                     if (in_array($sKey, $aEnableConnectors)) {
                         $oSocial->SupportedScopes = $oPlugin->GetSupportedScopes($sKey);
                         $oSocial->TranslatedScopes = $oPlugin->GetTranslatedScopes($oSocial->SupportedScopes);
                         $oSocial->HasApiKey = $oPlugin->HasApiKey($sKey);
                         $aConnectors[$sKey] = $oSocial;
                     }
                 }
             }
             $oScreen->Data->SetValue('Socials', $aConnectors);
         }
     }
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:25,代码来源:populate.php

示例2: CommonSocial

 public function CommonSocial()
 {
     $oApiCapa = CApi::Manager('capability');
     /* @var $oApiCapa CApiCapabilityManager */
     if ($oApiCapa) {
         $oTenant = $this->oModule->GetTenantAdminObject();
         if ($oTenant) {
             $aSocials = $oTenant->GetDefaultSocials();
             $aTenentSocials = array();
             foreach ($aSocials as $sKey => $oSocial) {
                 $oTenentSocial = new CTenantSocials();
                 $oTenentSocial->IdTenant = $oTenant->IdTenant;
                 $oTenentSocial->SocialAllow = CPost::GetCheckBox($sKey . '_chSocialAllow');
                 $oTenentSocial->SocialName = ucfirst($sKey);
                 $oTenentSocial->SocialId = CPost::Get($sKey . '_txtSocialId');
                 $oTenentSocial->SocialSecret = CPost::Get($sKey . '_txtSocialSecret');
                 $oTenentSocial->SocialApiKey = CPost::Get($sKey . '_txtSocialApiKey');
                 $oTenentSocial->SocialScopes = CPost::Get($sKey . '_txtSocialScopes');
                 $aTenentSocials[$sKey] = $oTenentSocial;
             }
             $oTenant->SetSocials($aTenentSocials);
         }
         if ($oTenant && $this->oModule->UpdateTenantAdminObject($oTenant)) {
             $this->LastMessage = AP_LANG_SAVESUCCESSFUL;
             $this->LastError = '';
         } else {
             $this->LastMessage = '';
             $this->LastError = AP_LANG_SAVEUNSUCCESSFUL;
         }
     }
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:31,代码来源:post.php

示例3: BeforeValidateLicenseKey

 /**
  * @param CAccount $oAccount
  */
 public function BeforeValidateLicenseKey()
 {
     $oLicensingApi = CApi::Manager('licensing');
     if ($oLicensingApi && 0 === strlen($oLicensingApi->GetLicenseKey())) {
         $oLicensingApi->UpdateLicenseKey($oLicensingApi->GetT());
     }
 }
开发者ID:afterlogic,项目名称:plugin-trial-license-key,代码行数:10,代码来源:index.php

示例4: CommonSocial

 public function CommonSocial()
 {
     $oApiCapa = CApi::Manager('capability');
     /* @var $oApiCapa CApiCapabilityManager */
     if ($oApiCapa) {
         $oTenant = $this->oModule->GetTenantAdminObject();
         if ($oTenant) {
             $oTenant->SocialFacebookAllow = CPost::Get('chSocialFacebookAllow');
             $oTenant->SocialFacebookId = CPost::Get('txtSocialFacebookId');
             $oTenant->SocialFacebookSecret = CPost::Get('txtSocialFacebookSecret');
             $oTenant->SocialGoogleAllow = CPost::Get('chSocialGoogleAllow');
             $oTenant->SocialGoogleId = CPost::Get('txtSocialGoogleId');
             $oTenant->SocialGoogleSecret = CPost::Get('txtSocialGoogleSecret');
             $oTenant->SocialGoogleApiKey = CPost::Get('txtSocialGoogleApiKey');
             $oTenant->SocialTwitterAllow = CPost::Get('chSocialTwitterAllow');
             $oTenant->SocialTwitterId = CPost::Get('txtSocialTwitterId');
             $oTenant->SocialTwitterSecret = CPost::Get('txtSocialTwitterSecret');
             $oTenant->SocialDropboxAllow = CPost::Get('chSocialDropboxAllow');
             $oTenant->SocialDropboxKey = CPost::Get('txtSocialDropboxKey');
             $oTenant->SocialDropboxSecret = CPost::Get('txtSocialDropboxSecret');
         }
         if ($oTenant && $this->oModule->UpdateTenantAdminObject($oTenant)) {
             $this->LastMessage = AP_LANG_SAVESUCCESSFUL;
             $this->LastError = '';
         } else {
             $this->LastMessage = '';
             $this->LastError = AP_LANG_SAVEUNSUCCESSFUL;
         }
     }
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:30,代码来源:post.php

示例5: validateUserPass

 /**
  * Validates a username and password
  *
  * This method should return true or false depending on if login
  * succeeded.
  *
  * @return bool
  */
 protected function validateUserPass($sUserName, $sPassword)
 {
     if (class_exists('CApi') && \CApi::IsValid()) {
         /* @var $oApiCalendarManager \CApiCalendarManager */
         $oApiCalendarManager = \CApi::Manager('calendar');
         /* @var $oApiCapabilityManager \CApiCapabilityManager */
         $oApiCapabilityManager = \CApi::Manager('capability');
         if ($oApiCalendarManager && $oApiCapabilityManager) {
             $oAccount = \afterlogic\DAV\Utils::GetAccountByLogin($sUserName);
             if ($oAccount && $oAccount->IsDisabled) {
                 return false;
             }
             $bIsOutlookSyncClient = \afterlogic\DAV\Utils::ValidateClient('outlooksync');
             $bIsMobileSync = false;
             $bIsOutlookSync = false;
             $bIsDemo = false;
             if ($oAccount) {
                 $bIsMobileSync = $oApiCapabilityManager->IsMobileSyncSupported($oAccount);
                 $bIsOutlookSync = $oApiCapabilityManager->IsOutlookSyncSupported($oAccount);
                 \CApi::Plugin()->RunHook('plugin-is-demo-account', array(&$oAccount, &$bIsDemo));
             }
             if ($oAccount && $oAccount->IncomingMailPassword === $sPassword && ($bIsMobileSync && !$bIsOutlookSyncClient || $bIsOutlookSync && $bIsOutlookSyncClient) || $bIsDemo || $sUserName === $oApiCalendarManager->GetPublicUser()) {
                 \afterlogic\DAV\Utils::CheckPrincipals($sUserName);
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:37,代码来源:Basic.php

示例6: getMinMan

 public function getMinMan()
 {
     if ($this->oApiMin == null) {
         $this->oApiMin = \CApi::Manager('min');
     }
     return $this->oApiMin;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:7,代码来源:Plugin.php

示例7: ApiGContacts

 /**
  * @return \CApiGcontactsManager
  */
 public function ApiGContacts()
 {
     if (null === $this->oApiGcontacts) {
         $this->oApiGcontacts = \CApi::Manager('gcontacts');
     }
     return $this->oApiGcontacts;
 }
开发者ID:Git-Host,项目名称:email,代码行数:10,代码来源:ActionsBase.php

示例8: GetTwofactorauthManager

 protected function GetTwofactorauthManager()
 {
     if (null === $this->oApiTwofactorauth) {
         $this->oApiTwofactorauth = \CApi::Manager('twofactorauth');
     }
     return $this->oApiTwofactorauth;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:7,代码来源:two-factor-auth.php

示例9: __construct

 /**
  * Sets up the backend.
  */
 public function __construct()
 {
     $oPdo = \CApi::GetPDO();
     $dbPrefix = \CApi::GetSettings()->GetConf('Common/DBPrefix');
     $this->oApiUsersManager = \CApi::Manager('users');
     parent::__construct($oPdo, $dbPrefix . Constants::T_PRINCIPALS, $dbPrefix . Constants::T_GROUPMEMBERS);
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:10,代码来源:PDOExt.php

示例10: getUsersMan

 public function getUsersMan()
 {
     if ($this->oApiUsers == null) {
         $this->oApiUsers = \CApi::Manager('users');
     }
     return $this->oApiUsers;
 }
开发者ID:Git-Host,项目名称:email,代码行数:7,代码来源:Directory.php

示例11: getContactsManager

 public function getContactsManager()
 {
     if (!isset($this->oApiContactsManager)) {
         $this->oApiContactsManager = \CApi::Manager('contacts');
     }
     return $this->oApiContactsManager;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:7,代码来源:AddressBook.php

示例12: __construct

 /**
  * @param CAdminPanel $oAdminPanel
  * @param string $sPath
  * @return CCommonModule
  */
 public function __construct(CAdminPanel &$oAdminPanel, $sPath)
 {
     parent::__construct($oAdminPanel, $sPath);
     $this->oDomainsApi = CApi::Manager('domains');
     $this->oUsersApi = CApi::Manager('users');
     $this->oCapabilityApi = CApi::Manager('capability');
     $this->oWebmailApi = CApi::Manager('webmail');
     $this->oIntegratorApi = CApi::Manager('integrator');
     $this->oTenantsApi = CApi::Manager('tenants');
     if (\CApi::GetConf('labs.allow-social-integration', true)) {
         $this->aTabs[] = AP_TAB_COMMON;
     }
     $this->aTabs[] = AP_TAB_DOMAINS;
     $this->aTabs[] = AP_TAB_SYSTEM;
     $this->aQueryActions[] = 'edit';
     $this->aQueryActions[] = 'list';
     $this->oPopulateData = new CCommonPopulateData($this);
     $this->oStandardPostAction = new CCommonPostAction($this);
     $this->oStandardPopAction = new CCommonPopAction($this);
     $this->oTableAjaxAction = new CCommonAjaxAction($this);
     $aTabs =& $oAdminPanel->GetTabs();
     if (\CApi::GetConf('labs.allow-social-integration', true)) {
         array_push($aTabs, array(CApi::I18N('ADMIN_PANEL/TABNAME_COMMON'), AP_TAB_COMMON));
     }
     array_push($aTabs, array(CApi::I18N('ADMIN_PANEL/TABNAME_DOMAINS'), AP_TAB_DOMAINS), array(CApi::I18N('ADMIN_PANEL/TABNAME_SYSTEM'), AP_TAB_SYSTEM));
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:31,代码来源:index.php

示例13: _getApiTenantsManager

 /**
  * @return CApiTenantsManager|null
  */
 private function _getApiTenantsManager()
 {
     if (null === $this->oApiTenantsManager) {
         $this->oApiTenantsManager = CApi::Manager('tenants');
     }
     return $this->oApiTenantsManager;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:10,代码来源:manager.php

示例14: SystemLogging

 public function SystemLogging()
 {
     if (isset($_POST['btnClearLog']) || isset($_POST['btnUserActivityClearLog'])) {
         /* @var $oApiLoggerManager CApiLoggerManager */
         $oApiLoggerManager = CApi::Manager('logger');
         $bResult = false;
         if (isset($_POST['btnClearLog'])) {
             $bResult = $oApiLoggerManager->DeleteCurrentLog();
         } else {
             $bResult = $oApiLoggerManager->DeleteCurrentUserActivityLog();
         }
         if ($bResult) {
             $this->LastMessage = WM_INFO_LOGCLEARSUCCESSFUL;
         } else {
             $this->LastError = AP_LANG_ERROR;
         }
     } else {
         if ($this->isStandartSubmit()) {
             $this->oSettings->SetConf('Common/EnableLogging', CPost::GetCheckBox('ch_EnableDebugLogging'));
             $this->oSettings->SetConf('Common/EnableEventLogging', CPost::GetCheckBox('ch_EnableUserActivityLogging'));
             $this->oSettings->SetConf('Common/LoggingLevel', EnumConvert::FromPost(CPost::Get('selVerbosity', ''), 'ELogLevel'));
             $this->checkBolleanWithMessage($this->oSettings->SaveToXml());
         }
     }
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:25,代码来源:post.php

示例15: 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


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