Пример #1
0
 /**
  * Authenticates against the attached adapter
  *
  * All parameters are passed along to the adapter's authenticate() method.
  *
  * @param  array $options
  * @uses   Zend_Auth_Adapter::authenticate()
  * @return Zend_Auth_Token_Interface
  */
 public function authenticate($options)
 {
     $token = $this->_adapter->authenticate($options);
     if ($this->_useSession) {
         require_once 'Zend/Session.php';
         $session = new Zend_Session($this->_sessionNamespace);
         $session->{$this->_sessionTokenName} = $token;
     }
     return $token;
 }
Пример #2
0
 /**
  * authenticate the request
  *
  * @return Zend_Auth_Response
  */
 public function authenticate()
 {
     //authenticate the user
     $this->_authAdapter->setIdentity($this->_username);
     $this->_authAdapter->setCredential($this->_password);
     $result = $this->_authAdapter->authenticate();
     if ($result->isValid()) {
         //save the user and return the result
         $row = $this->_authAdapter->getResultRowObject($this->_resultRowColumns);
         $this->_storage->user = $row;
         return $result;
     }
 }
Пример #3
0
 /**
  * Authenticates against the attached adapter
  *
  * All parameters are passed along to the adapter's authenticate() method.
  *
  * @param  array $options
  * @uses   Zend_Auth_Adapter::authenticate()
  * @return Zend_Auth_Token_Interface
  */
 public function authenticate($options)
 {
     $token = $this->_adapter->authenticate($options);
     if ($this->_useSession) {
         require_once 'Zend/Session/Core.php';
         if (!Zend_Session_Core::isStarted()) {
             Zend_Session_Core::start();
         }
         Zend_Session_Core::setOptions(array('strict' => true));
         require_once 'Zend/Session.php';
         $session = new Zend_Session($this->_sessionNamespace, Zend_Session::SINGLE_INSTANCE);
         $session->{$this->_sessionTokenName} = $token;
     }
     return $token;
 }