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


PHP AuthComponent::startup方法代碼示例

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


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

示例1: startup

 /** 
  * Main execution method.  Initializes CAS client and force authentication if required before passing user to parent startup method.
  * 
  * @param object $controller A reference to the instantiating controller object 
  * @return boolean 
  * @access public 
  */
 function startup(&$controller)
 {
     // CAS authentication required if user is not logged in
     //debug($controller);exit;
     //if (!$this->user()) {
     if (!isset($this->request->query['ticket'])) {
         // Set debug mode
         phpCAS::setDebug(false);
         //if(!empty(phpCAS::getUser()))
         //    debug($this);
         //Initialize phpCAS
         //debug(isset($this->request->query['ticket']));
         phpCAS::client(CAS_VERSION_2_0, Configure::read('CAS.hostname'), Configure::read('CAS.port'), Configure::read('CAS.uri'));
         // No SSL validation for the CAS server
         phpCAS::setNoCasServerValidation();
         // Force CAS authentication if required
         phpCAS::forceAuthentication();
         //debug();exit;
         $model =& $this->getModel();
         $controller->data[$model->alias][$this->fields['username']] = phpCAS::getUser();
         $controller->data[$model->alias][$this->fields['password']] = 'a';
         //$this->User->['username']=phpCAS::getUser();
         //$this->User->['password']='a';
     }
     return parent::startup($controller);
     //$this->redirect(array('controller'=>'User','action'=>'login'));
 }
開發者ID:rajankz,項目名稱:webspace,代碼行數:34,代碼來源:CasAuthComponent+copy.php

示例2: startup

 /**
  * Sets the user ID on RequestLoggable component, if it is being used
  * 
  * @access public
  * @param object $Controller
  * @return void
  */
 function startup($Controller)
 {
     parent::startup($Controller);
     if (isset($this->Controller->RequestLoggable)) {
         $this->Controller->RequestLoggable->set('user_id', $this->user('id'));
     }
 }
開發者ID:rcaravita,項目名稱:jodeljodel,代碼行數:14,代碼來源:jj_auth.php

示例3: startup

 public function startup($Controller)
 {
     $result = $this->Authenticators->triggerCallback('before', 'startup', array($Controller));
     if (!$this->Authenticators->interrupted) {
         // workaround warning error with 'expected argument 1 as a reference'
         $result = parent::startup($Controller);
     }
     $result = $this->Authenticators->triggerCallback('after', 'startup', array($result), 'enchain');
     return $result;
 }
開發者ID:hiromi2424,項目名稱:modular_auth,代碼行數:10,代碼來源:base_modular_auth.php

示例4: startup

 /**
  * Over-ride of startup function. Adds 'User' with id of 0 if not logged in for use in ACL
  *
  * @return null
  * @access public
  */
 public function startup(&$controller)
 {
     $user = ClassRegistry::init(Configure::read('Permissible.UserModel'));
     $this->actionPath = 'app/';
     $this->authorize = 'actions';
     if ($this->user($user->primaryKey) === null) {
         $this->_unlogged = true;
         $this->Session->write($this->sessionKey, array($user->primaryKey => 0));
     }
     parent::startup($controller);
     if ($this->_unlogged) {
         $this->Session->delete($this->sessionKey);
     }
 }
開發者ID:parker00811,項目名稱:elections,代碼行數:20,代碼來源:PAuthComponent.php

示例5: startup

 /**
  * Démarrage du composant.
  * Autorisation si pas de préfixe dans la Route qui a conduit ici.
  *
  * @param object $controller Le contrôleur qui a appelé le composant.
  */
 function startup($controller)
 {
     $prefix = null;
     if (empty($controller->params['prefix'])) {
         $this->allow();
     } else {
         $prefix = $controller->params['prefix'];
     }
     // Cas spécial des actions de login et logout, pour lesquelles le préfixe n'existe pas
     if (in_array($controller->action, array('login', 'logout'))) {
         switch ($controller->name) {
             case 'Users':
                 $prefix = 'admin';
                 break;
             case 'Members':
                 $prefix = 'members';
                 break;
         }
     }
     $this->_setup($prefix);
     parent::startup($controller);
 }
開發者ID:GuillaumeLarroque,項目名稱:festimpro,代碼行數:28,代碼來源:appAuth.php


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