public function restorepasswordAction() { if ($this->getParam('hash') && $this->getParam('newpassword')) { $user = $this->_model->fetchRow($this->_model->select()->where('salt = ?', $this->getParam('hash'))); if ($user) { $this->_model->update(array('password' => md5(Zend_Registry::get('config')->Db->staticSalt . md5($this->getParam('newpassword')) . $user->salt)), $this->_model->getAdapter()->quoteInto('username = ?', $user->username)); } } }
public function isValid($value) { $isValid = true; $model = new Modules_Access_Model_Users(); $sql = $model->select()->where('email = ?', $value); if ($login = Zend_Controller_Front::getInstance()->getRequest()->getParam('login')) { $sql = $sql->where('username != ?', $login); } if (sizeof($model->fetchAll($sql))) { $this->_error(self::ERROR, $value); $isValid = false; } return $isValid; }