Interface luya\admin\aws\ChangePasswordInterface

Implemented byluya\admin\models\ApiUser, luya\admin\models\User
Available since version1.0.0
Source Code https://github.com/luyadev/luya-module-admin/blob/master/src/aws/ChangePasswordInterface.php

Change Password Active Window Interface.

Each {{luya\admin\aws\ChangePasswordActiveWindow}} must implemented this interface

class User extends \luya\admin\ngrest\base\NgRestModel implements \luya\admin\aws\ChangePasswordInterface
{
   public function changePassword($newPassword)
   {
       return $this->updateAttributes(['password' => Yii::$app->security->generatePasswordHash($newPassword)]);
   }
}

The changePassword method must return whether the password change was successful or not.

Public Methods

Hide inherited methods

Method Description Defined By
changePassword() The method which is going to change the password on the current model. luya\admin\aws\ChangePasswordInterface

Method Details

Hide inherited methods

changePassword() public abstract method

The method which is going to change the password on the current model.

The implementation of this must make sure if the $newPassword and $newPasswordRepetition are equals!

public abstract boolean changePassword ( $newPassword )
$newPassword string

The new password (as plain input) which must be encoded an set.

return boolean

Whether password change was successful or not.

                public function changePassword($newPassword);