當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CApi::GetModuleDecorator方法代碼示例

本文整理匯總了PHP中CApi::GetModuleDecorator方法的典型用法代碼示例。如果您正苦於以下問題:PHP CApi::GetModuleDecorator方法的具體用法?PHP CApi::GetModuleDecorator怎麽用?PHP CApi::GetModuleDecorator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CApi的用法示例。


在下文中一共展示了CApi::GetModuleDecorator方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPrincipalsByPrefix

 /**
  * Returns a list of principals based on a prefix.
  *
  * This prefix will often contain something like 'principals'. You are only
  * expected to return principals that are in this base path.
  *
  * You are expected to return at least a 'uri' for every user, you can
  * return any additional properties if you wish so. Common properties are:
  *   {DAV:}displayname
  *   {http://sabredav.org/ns}email-address - This is a custom SabreDAV
  *     field that's actualy injected in a number of other properties. If
  *     you have an email address, use this property.
  *
  * @param string $prefixPath
  * @return array
  */
 function getPrincipalsByPrefix($prefixPath)
 {
     $principals = [];
     $aUsers = \CApi::GetModuleDecorator('Core')->GetUserList(0, 0);
     if (is_array($aUsers)) {
         foreach ($aUsers as $oUser) {
             $principals[] = array('id' => $oUser['UUID'], 'uri' => 'principals/' . $oUser['UUID'], '{DAV:}displayname' => $oUser['Name']);
         }
     }
     return $principals;
 }
開發者ID:afterlogic,項目名稱:dav,代碼行數:27,代碼來源:PDO.php

示例2: getUser

 protected function getUser($principalUri)
 {
     if (null === $this->iUserId) {
         $oCoreModuleDecorador = \CApi::GetModuleDecorator('Core');
         if ($oCoreModuleDecorador) {
             $oUser = $oCoreModuleDecorador->GetUser(basename($principalUri));
             if ($oUser) {
                 $this->iUserId = basename($principalUri);
             }
         }
     }
     return $this->iUserId;
 }
開發者ID:afterlogic,項目名稱:dav,代碼行數:13,代碼來源:AddressBookRoot.php

示例3: 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)
 {
     $mResult = false;
     if (class_exists('CApi') && \CApi::IsValid()) {
         /* @var $oApiCapabilityManager \CApiCapabilityManager */
         $oApiCapabilityManager = \CApi::GetSystemManager('capability');
         if ($oApiCapabilityManager) {
             $oDavDecorator = \CApi::GetModuleDecorator('Dav');
             if ($oDavDecorator) {
                 $mResult = $oDavDecorator->Login($sUserName, $sPassword);
             }
             $bIsOutlookSyncClient = \Afterlogic\DAV\Utils::ValidateClient('outlooksync');
             $bIsMobileSync = false;
             $bIsOutlookSync = false;
             $bIsDemo = false;
             //				if ($mResult !== false) {
             //					$iIdUser = isset($mResult['id']) ? $mResult['id'] : 0;
             //					return true;
             /*					
             					$bIsMobileSync = $oApiCapabilityManager->isMobileSyncSupported($iIdUser);
             					$bIsOutlookSync = $oApiCapabilityManager->isOutlookSyncSupported($iIdUser);
             					
             					\CApi::Plugin()->RunHook(
             							'plugin-is-demo-account', 
             							array(&$oAccount, &$bIsDemo)
             					);
             * 
             */
             //				}
             /*
             				if (($oAccount && $oAccount->IncomingMailPassword === $sPassword &&
             						(($bIsMobileSync && !$bIsOutlookSyncClient) || 
             						($bIsOutlookSync && $bIsOutlookSyncClient))) ||
             						$bIsDemo || $sUserName === \CApi::ExecuteMethod('Dav::GetPublicUser')) {
             					return true;
             				}
             * 
             */
         }
     }
     return $mResult;
 }
開發者ID:afterlogic,項目名稱:dav,代碼行數:50,代碼來源:Basic.php

示例4: getAuthenticatedUserByIdHelper

 /**
  * @param int $iUserId Default value is empty string.
  *
  * @return \CUser
  */
 public function getAuthenticatedUserByIdHelper($iUserId = '')
 {
     $oCoreDecorator = \CApi::GetModuleDecorator('Core');
     $oUser = null;
     if (0 < $iUserId) {
         $oUser = $oCoreDecorator->GetUser($iUserId);
     } elseif ($iUserId === -1) {
         $oUser = $oCoreDecorator->GetAdminUser();
     }
     return $oUser;
 }
開發者ID:afterlogic,項目名稱:aurora-core,代碼行數:16,代碼來源:manager.php


注:本文中的CApi::GetModuleDecorator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。