app\controllers\SiteController::actionResetPassword PHP Method

actionResetPassword() public method

Reset password
public actionResetPassword ( $token )
    public function actionResetPassword($token)
    {
        $userDriver = isset(\Yii::$app->params['user_driver']) == true && empty(\Yii::$app->params['user_driver']) == false ? \Yii::$app->params['user_driver'] : 'local';
        if ($userDriver != 'local') {
            throw new BadRequestHttpException(Yii::t('walle', 'the login type does not provide security', array('loginType' => $userDriver)));
        }
        try {
            $model = new ResetPasswordForm($token);
        } catch (InvalidParamException $e) {
            throw new BadRequestHttpException($e->getMessage());
        }
        if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) {
            Yii::$app->getSession()->setFlash('success', 'New password was saved.');
            return $this->goHome();
        }
        return $this->render('resetPassword', ['model' => $model]);
    }