Exemplo n.º 1
0
 public function authenticate()
 {
     $mdlAccount = new Acl_Model_Account();
     $select = $mdlAccount->select()->where('email=?', $this->_email)->where('block=0')->limit(1);
     #trigger_error($select->__toString());
     $row = $mdlAccount->fetchRow($select);
     if ($row == null) {
         return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $this->_email);
     }
     $data = $row->toArray();
     if (crypt($this->_password, $data['password']) !== $data['password']) {
         return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $this->_email);
     } else {
         $this->_row = $row;
         return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, 'email');
         #return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $this->_email);
     }
 }