skeeks\cms\controllers\AdminUserController::actionChangePassword PHP Method

actionChangePassword() public method

If update is successful, the browser will be redirected to the 'view' page.
public actionChangePassword ( ) : mixed
return mixed
    public function actionChangePassword()
    {
        $model = $this->model;
        $modelForm = new PasswordChangeForm(['user' => $model]);
        $rr = new RequestResponse();
        if (\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) {
            return $rr->ajaxValidateForm($modelForm);
        }
        if ($modelForm->load(\Yii::$app->request->post()) && $modelForm->changePassword()) {
            \Yii::$app->getSession()->setFlash('success', 'Успешно сохранено');
        } else {
            if (\Yii::$app->request->isPost) {
                \Yii::$app->getSession()->setFlash('error', 'Не удалось изменить пароль');
            }
        }
        return $this->render($this->action->id, ['model' => $modelForm]);
    }