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


PHP phpCAS::hasAttribute方法代碼示例

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


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

示例1: setName

 private function setName()
 {
     if ($this->config->get('cas-name-attribute-key') !== null && phpCAS::hasAttribute($this->config->get('cas-name-attribute-key'))) {
         $_SESSION[':cas']['name'] = phpCAS::getAttribute($this->config->get('cas-name-attribute-key'));
     } else {
         $_SESSION[':cas']['name'] = $this->getUser();
     }
 }
開發者ID:bpalme,項目名稱:osTicket-auth-cas,代碼行數:8,代碼來源:cas.php

示例2: __construct

 /**
  * Constructor
  *
  * @param AuthenticationAuthority $AuthenticationAuthority
  * @return void
  */
 public function __construct(AuthenticationAuthority $AuthenticationAuthority)
 {
     parent::__construct($AuthenticationAuthority);
     if (!phpCAS::isAuthenticated()) {
         phpCAS::forceAuthentication();
     }
     $this->setUserID(phpCAS::getUser());
     if (!method_exists('phpCAS', 'getAttribute')) {
         throw new KurogoConfigurationException('CASAuthentication attribute mapping requires phpCAS 1.2.0 or greater.');
     }
     foreach (self::$attributeMap as $property => $attribute) {
         if (phpCAS::hasAttribute($attribute)) {
             $method = 'set' . $property;
             $this->{$method}(phpCAS::getAttribute($property));
         }
     }
 }
開發者ID:nncsang,項目名稱:Kurogo,代碼行數:23,代碼來源:CASAuthentication.php

示例3: UpdateUser

 /**
  * Called after the user has been authenticated and found in iTop. This method can
  * Update the user's definition (profiles...) on the fly to keep it in sync with an external source 
  * @param User $oUser The user to update/synchronize
  * @param string $sLoginMode The login mode used (cas|form|basic|url)
  * @param string $sAuthentication The authentication method used
  * @return void
  */
 public static function UpdateUser(User $oUser, $sLoginMode, $sAuthentication)
 {
     $bCASUpdateProfiles = MetaModel::GetConfig()->Get('cas_update_profiles');
     if ($sLoginMode == 'cas' && $bCASUpdateProfiles && phpCAS::hasAttribute('memberOf')) {
         $aMemberOf = phpCAS::getAttribute('memberOf');
         if (!is_array($aMemberOf)) {
             $aMemberOf = array($aMemberOf);
         }
         // Just one entry, turn it into an array
         return self::SetProfilesFromCAS($oUser, $aMemberOf);
     }
     // No groups defined in CAS or not CAS at all: do nothing...
     return true;
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:22,代碼來源:userrights.class.inc.php


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