Resets password.

@return boolean if password was reset.
436329
public function resetPassword()
    {
        $user = $this->_user;
        $user->setPassword($this->password);
        $user->removePasswordResetToken();
        Event::off(BaseActiveRecord::className(), BaseActiveRecord::EVENT_AFTER_UPDATE);

        return $user->save(false);
    }
750301
def reset_passwd(self, data):
        
        error = False
        msg = ""

        # Check input format
        if len(data["passwd"]) < 6:
            error = True
            msg = _("Password too short.")
        elif data["passwd"] != data["passwd2"]:
            error = True
            msg = _("Passwords don't match !")

        if not error:
            passwd_hash = hashlib.sha512(data["passwd"].encode("utf-8")).hexdigest()
            user = self.database.users.find_one_and_update({"reset": data["reset_hash"]},
                                                           {"$set": {"password": passwd_hash},
                                                            "$unset": {"reset": True, "activate": True}})
            if user is None:
                error = True
                msg = _("Invalid reset hash.")
            else:
                msg = _("Your password has been successfully changed.")

        return msg, error
1027404
public function resetPassword($password)
    {
        try {
            return (bool)$this->updateAttributes(['password_hash' => PasswordHelper::hash($password)]);
        } catch (Exception $e) {
            return false;
        }
    }
415027
protected function userSetupPassword()
    {
        $pass        = $this->secret('Please enter the user password');
        $passConfirm = $this->secret('Please confirm the user password');

        if ($pass != $passConfirm) {
            $this->error('[ERROR] Passwords do not match.');
            $this->userSetupPassword();
        }

        return $pass;

    }
1187694
@PostMapping(
      value = "/password/reset",
      headers = "Content-Type=application/x-www-form-urlencoded")
  @ResponseStatus(HttpStatus.NO_CONTENT)
  public void resetPassword(@Valid @ModelAttribute PasswordResetRequest passwordResetRequest) {
    accountService.resetPassword(passwordResetRequest.getEmail());
  }
80538
public function resetPassword()
    {
        if ($this->hasErrors()) {
            return false;
        }
        $identity = $this->getIdentity();
        $trx = $identity->db->transaction !== null ? null : $identity->db->beginTransaction();
        if (!$identity || !$identity->resetPassword($this->newPassword)) {
            $this->addError('newPassword', Yii::t('usr', 'Failed to reset the password.'));
            if ($trx !== null) {
                $trx->rollback();
            }

            return false;
        }
        if ($trx !== null) {
            $trx->commit();
        }

        return true;
    }
182024
public function passwordForgot()
    {
        //Checks if reset password is enabled
        if (!getConfig('users.reset_password')) {
            $this->Flash->error(I18N_DISABLED);

            return $this->redirect(['_name' => 'homepage']);
        }

        $entity = $this->Users->newEntity($this->request->getData(), ['validate' => 'DoNotRequirePresence']);

        if ($this->request->is('post')) {
            //Checks for reCAPTCHA, if requested
            if (!getConfig('security.recaptcha') || $this->Recaptcha->verify()) {
                $user = $this->Users->findActiveByEmail($this->request->getData('email'))->first();

                if ($user) {
                    $token = $this->Token->create($user->email, ['type' => 'password_forgot', 'user_id' => $user->id]);
                    $this->getMailer('MeCms.User')
                        ->set('url', Router::url(['_name' => 'passwordReset', $user->id, $token], true))
                        ->send('passwordForgot', [$user]);
                    $this->Flash->success(__d('me_cms', 'We have sent you an email to reset your password'));

                    return $this->redirect(['_name' => 'login']);
                }

                if ($this->request->getData('email')) {
                    Log::error(sprintf(
                        '%s - Forgot password request with invalid email `%s`',
                        $this->request->clientIp(),
                        $this->request->getData('email')
                    ), 'users');
                }

                $this->Flash->error(__d('me_cms', 'No account found'));
            } else {
                $this->Flash->error(__d('me_cms', 'You must fill in the {0} control correctly', 'reCAPTCHA'));
            }
        }

        $this->set('user', $entity);
        $this->viewBuilder()->setLayout('login');
    }
451306
public function getPassword()
    {
        if (null !== $this->password) {
            return $this->password;
        }

        $this->parseUserInfo();

        return $this->password;
    }
1010461
protected function passwordExpired()
    {
        if (($minutes = $this->config('lifetime')) !== 0 && $this->minutesSinceLastActivity() > $minutes) {
            event(new OneTimePasswordExpired($this->getUser()));

            $this->logout();

            return true;
        }

        $this->keepAlive();

        return false;
    }
23063
public function resetPassword()
    {
        $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
        $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
        $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
        $this->post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
    }
234600
protected function resetPasswordUser()
    {
        $result = $this->user_action->resetPassword($this->getSubmitted());
        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
799485
public function remindSend()
	{
		$credentials = array('email' => Input::get('email'));

		return Password::remind($credentials, function($message, $user)
		{
			$message->subject('Reset your password');
		});
	}
173610
public function unusedNewPassword()
    {
        if ($this->hasErrors()) {
            return false;
        }

        /** @var IdentityInterface */
        $identity = $this->getIdentity();
        // check if new password hasn't been used before
        if ($identity instanceof PasswordHistoryIdentityInterface) {
            if (($lastUsed = $identity->getPasswordDate($this->newPassword)) !== null) {
                $this->addError('newPassword', Yii::t('usr', 'New password has been used before, last set on {date}.', ['date' => $lastUsed]));

                return false;
            }

            return true;
        }
        // check if new password is not the same as current one
        if (property_exists($this, 'password')) {
            if ($this->password === $this->newPassword) {
                $this->addError('newPassword', Yii::t('usr', 'New password must be different than the old one.'));

                return false;
            }
        }

        return true;
    }
149819
protected function resetPassword($user, $password)
    {
        $user->password = Hash::make($password);

        $user->setRememberToken(Str::random(60));

        $user->save();

        event(new PasswordReset($user));
    }
1290105
protected function reset()
    {
        $this->user = null;
        $this->lastAttempted = null;
        $this->viaRemember = false;
        $this->loggedOut = false;
        $this->tokenRetrievalAttempted = false;
        $this->recallAttempted  = false;
    }
979810
public function changePassword()
    {
        $this->setPassword($this->password);
        $this->generateAuthKey();
        $this->removePasswordResetToken();
        return $this->save();
    }
332366
public function resetpasswordAction() {
        $this->view->title = __('reset password page title');
        $authVars = Garp_Auth::getInstance()->getConfigValues();
        $activationCode = $this->getRequest()->getParam('c');
        $activationEmail = $this->getRequest()->getParam('e');
        $expirationColumn = $authVars['forgotpassword']['activation_code_expiration_date_column'];

        $userModel = new Model_User();
        $activationCodeClause = 'MD5(CONCAT(' .
                $userModel->getAdapter()->quoteIdentifier(
                    $authVars['forgotpassword']['activation_token_column']
                ) . ',' .
                'MD5(email),' .
                'MD5(' . $userModel->getAdapter()->quote($authVars['salt']) . '),' .
                'MD5(id)' .
            ')) = ?'
        ;
        $select = $userModel->select()
            // check if a user matches up to the given code
            ->where($activationCodeClause, $activationCode)
            // check if the given email address is part of the same user record
            ->where('MD5(email) = ?', $activationEmail);

        $user = $userModel->fetchRow($select);
        if (!$user) {
            $this->view->error = __('reset password user not found');
            return;
        }
        if (strtotime($user->{$expirationColumn}) < time()) {
            $this->view->error = __('reset password link expired');
            return;
        }
        if (!$this->getRequest()->isPost()) {
            return;
        }
        $password = $this->getRequest()->getPost('password');
        if (!$password) {
            $this->view->formError = sprintf(__('%s is a required field'), ucfirst(__('password')));
            return;
        }

        if (!empty($authVars['forgotpassword']['repeatPassword'])
            && !empty($authVars['forgotpassword']['repeatPasswordField'])
        ) {
            $repeatPasswordField = $this->getRequest()->getPost(
                $authVars['forgotpassword']['repeatPasswordField']
            );
            if ($password != $repeatPasswordField) {
                $this->view->formError = __('the passwords do not match');
                return;
            }
        }

        // Update the user's password and send him along to the login page
        $updateClause = $userModel->getAdapter()->quoteInto('id = ?', $user->id);
        $userModel->update(
            array(
            'password' => $password,
            $authVars['forgotpassword']['activation_token_column'] => null,
            $authVars['forgotpassword']['activation_code_expiration_date_column'] => null
            ), $updateClause
        );
        $this->_helper->flashMessenger(__($authVars['resetpassword']['success_message']));
        $this->_redirect('/g/auth/login');
    }