console/controllers/UserController.php
public function actionConfirmPasswordHistory($user, $password)
    {
        $user = $this->getUser($user);
        $passwordHistory = $user->passwordHistories;
        $passwordInHistory = 0;
        foreach ($passwordHistory as $pass) {
            if ($pass->validatePassword($password)) {
                $passwordInHistory++;
                echo "This password was created at " . $pass->getCreatedAt() . ".\n";
            }
        }
        if ($passwordInHistory) {
            echo "$passwordInHistory matched.\n";
            return static::EXIT_CODE_NORMAL;
        }
        echo "No password matched.\n";
        return static::EXIT_CODE_ERROR;
    }
public function actionConfirmPasswordHistory($user, $password)
    {
        $user = $this->getUser($user);
        $passwordHistory = $user->passwordHistories;
        $passwordInHistory = 0;
        foreach ($passwordHistory as $pass) {
            if ($pass->validatePassword($password)) {
                $passwordInHistory++;
                echo "This password was created at " . $pass->getCreatedAt() . ".\n";
            }
        }
        if ($passwordInHistory) {
            echo "$passwordInHistory matched.\n";
            return static::EXIT_CODE_NORMAL;
        }
        echo "No password matched.\n";
        return static::EXIT_CODE_ERROR;
    }
public function actionConfirmPasswordHistory ( $ user , $ password ) { $ user = $ this -> getUser ( $ user ) ; $ passwordHistory = $ user -> passwordHistories ; $ passwordInHistory = 0 ; foreach ( $ passwordHistory as $ pass ) { if ( $ pass -> validatePassword ( $ password ) ) { $ passwordInHistory ++ ; echo "This password was created at " . $ pass -> getCreatedAt ( ) . ".\n" ; } } if ( $ passwordInHistory ) { echo "$passwordInHistory matched.\n" ; return static :: EXIT_CODE_NORMAL ; } echo "No password matched.\n" ; return static :: EXIT_CODE_ERROR ; }
Confirm password in history.
This command will list all matching passwords in reverse order.
@param User|string|integer $user User ID.
@param string $password Password.
@return int
Confirm password in history . This command will list all matching passwords in reverse order .