public function actionPassword($user, $password)
    {
        $user = $this->getUser($user);
        $user->applyForNewPassword();
        $result = $user->resetPassword($password, $user->getPasswordResetToken());
        if ($result) {
            echo "Password changed.\n";
        } else {
            echo "Password not changed.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }
public function actionPassword($user, $password)
    {
        $user = $this->getUser($user);
        $user->applyForNewPassword();
        $result = $user->resetPassword($password, $user->getPasswordResetToken());
        if ($result) {
            echo "Password changed.\n";
        } else {
            echo "Password not changed.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }
public function actionPassword ( $ user , $ password ) { $ user = $ this -> getUser ( $ user ) ; $ user -> applyForNewPassword ( ) ; $ result = $ user -> resetPassword ( $ password , $ user -> getPasswordResetToken ( ) ) ; if ( $ result ) { echo "Password changed.\n" ; } else { echo "Password not changed.\n" ; } return static :: EXIT_CODE_NORMAL ; }
Change password directly.
@param User|string|integer $user User ID.
@param string $password Password.
@return int
Change password directly .