src/apis/UserController.php
public function actionChangePassword()
    {
        $model = new UserChangePassword();
        $model->setUser(Yii::$app->adminuser->identity);
        $model->attributes = Yii::$app->request->bodyParams;
        
        if ($this->module->strongPasswordPolicy) {
            $model->validators->append(StrengthValidator::createValidator(StrengthValidator::class, $model, ['newpass']));
        }
        
        if ($model->validate()) {
            $model->checkAndStore();
        }
        
        return $model;
    }
public function actionChangePassword()
    {
        $model = new UserChangePassword();
        $model->setUser(Yii::$app->adminuser->identity);
        $model->attributes = Yii::$app->request->bodyParams;
        
        if ($this->module->strongPasswordPolicy) {
            $model->validators->append(StrengthValidator::createValidator(StrengthValidator::class, $model, ['newpass']));
        }
        
        if ($model->validate()) {
            $model->checkAndStore();
        }
        
        return $model;
    }
public function actionChangePassword ( ) { $ model = new UserChangePassword ( ) ; $ model -> setUser ( Yii :: $ app -> adminuser -> identity ) ; $ model -> attributes = Yii :: $ app -> request -> bodyParams ; if ( $ this -> module -> strongPasswordPolicy ) { $ model -> validators -> append ( StrengthValidator :: createValidator ( StrengthValidator :: class , $ model , [ 'newpass' ] ) ) ; } if ( $ model -> validate ( ) ) { $ model -> checkAndStore ( ) ; } return $ model ; }
Action to change the password for the given User.

@return \luya\admin\models\UserChangePassword
Action to change the password for the given User .