public function updatePassword($userId, $password) { $data = array('password' => BackofficeUser::hashPassword($password)); $this->update($data, $this->getPrimaryKey() . ' = ' . (int) $userId); }
/** * Changes the current user's password * * @param string $password * @access public * @return void */ public function changePassword($password) { if (!Zend_Auth::getInstance()->hasIdentity()) { throw new Zend_Exception('You must have one authenticated user in the application in order to be able to call this method'); } $user = Zend_Auth::getInstance()->getIdentity(); $password = BackofficeUser::hashPassword($password); $this->update(array('password' => $password, 'last_password_update' => new Zend_Db_Expr('NOW()'), 'password_valid' => 1), $this->_db->quoteInto('id = ?', $user->id)); }