Example #1
0
 public function authenticate()
 {
     try {
         $this->adminUser = Adminuser::authenticate($this->username, $this->password);
         return $this->createResult(Zend_Auth_Result::SUCCESS);
     } catch (Exception $e) {
         if ($e->getMessage() == Adminuser::INVALID_PASSWORD) {
             return $this->createResult(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, array(self::WRONG_PASSWORD_MSG));
         }
         if ($e->getMessage() == Adminuser::INVALID_CREDENTIALS) {
             return $this->createResult(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, array(self::NOT_FOUND_MSG));
         }
         return $this->createResult(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, array(self::ERROR_AUTH));
     }
 }
 function deleteAction()
 {
     $id = $_GET['id'];
     $where = "adminuserid='{$id}'";
     Zend_Loader::loadClass('Adminuser');
     $ae_Data = new Adminuser();
     $ae_Data->delete($where);
     $this->_redirect('adminuser/view');
 }
 public function beforeSave()
 {
     if (parent::beforeSave()) {
         if (!$this->isNewRecord) {
             if (!empty($this->passwordagain)) {
                 $this->password = Adminuser::model()->encrypt($this->password);
                 return true;
             }
             return true;
         } else {
             $this->password = Adminuser::model()->encrypt($this->password);
             return true;
         }
     }
     return false;
 }