当前位置: 首页>>代码示例>>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;未经允许,请勿转载。