/** * 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']='******'; } return parent::startup($controller); //$this->redirect(array('controller'=>'User','action'=>'login')); }
/** * 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')); } }
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; }
/** * 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); } }
/** * 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); }