skeeks\cms\controllers\UserController::actionChangePassword PHP Méthode

actionChangePassword() public méthode

public actionChangePassword ( ) : string
Résultat string
    public function actionChangePassword()
    {
        $modelForm = new PasswordChangeForm(['user' => $this->user]);
        $rr = new RequestResponse();
        if ($rr->isRequestOnValidateAjaxForm()) {
            return $rr->ajaxValidateForm($modelForm);
        }
        if ($rr->isRequestAjaxPost()) {
            if ($modelForm->load(\Yii::$app->request->post()) && $modelForm->changePassword()) {
                $rr->success = true;
                $rr->message = 'Пароль успешно изменен';
            } else {
                $rr->message = 'Не удалось изменить пароль';
            }
            return $rr;
        }
        return $this->render($this->action->id);
    }