src/commands/UserController.php
public function actionChangePassword()
    {
        $username = $this->prompt('Username:', ['required' => true]);
        $user = $this->findModel($username);
        $user->setPassword($this->prompt('New password:', [
            'required' => true,
            'pattern' => '#^.{6,255}$#i',
            'error' => 'More than 6 symbols',
        ]));
        $this->log($this->repository->save($user));
    }
public function actionChangePassword()
    {
        $username = $this->prompt('Username:', ['required' => true]);
        $user = $this->findModel($username);
        $user->setPassword($this->prompt('New password:', [
            'required' => true,
            'pattern' => '#^.{6,255}$#i',
            'error' => 'More than 6 symbols',
        ]));
        $this->log($this->repository->save($user));
    }
public function actionChangePassword ( ) { $ username = $ this -> prompt ( 'Username:' , [ 'required' => true ] ) ; $ user = $ this -> findModel ( $ username ) ; $ user -> setPassword ( $ this -> prompt ( 'New password:' , [ 'required' => true , 'pattern' => '#^.{6,255}$#i' , 'error' => 'More than 6 symbols' , ] ) ) ; $ this -> log ( $ this -> repository -> save ( $ user ) ) ; }
Changes user password.
Changes user password .