示例#1
0
 /**
  * Performs an authentication attempt
  *
  * @throws Zend_Auth_Adapter_Exception If authentication cannot
  *                                     be performed
  * @return Zend_Auth_Result
  */
 public function authenticate()
 {
     $stub = Zupal_People::getInstance();
     $user = $stub->find_one(array('username' => array($this->get_username(), 'LIKE')));
     $encrypted = Zupal_People::encrypt_password($this->get_password(), $user->identity());
     if ($user && $user->is_saved() && $this->get_password() == $user->password) {
         // TODO: incorpoprate encryption
         $result = new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $user->toArray());
     } else {
         $result = new Zend_Auth_Result(Zend_Auth_Result::FAILURE, NULL);
     }
     return $result;
 }
 /**
  *
  */
 public function dataAction()
 {
     $this->_helper->layout->disableLayout();
     $this->view->data = Zupal_People::getInstance()->render_data(array(), 'email');
 }