|
@@ 68-76 (lines=9) @@
|
| 65 |
|
@list($username, $password) = $this->captureUserAndPassword($command->input); |
| 66 |
|
|
| 67 |
|
if ($username && $password && $workflow->can($subject, 'enter_username_n_password')) { |
| 68 |
|
if ($username === 'demo' && $password === 'demo') { |
| 69 |
|
$workflow->apply($subject, 'enter_username_n_password'); |
| 70 |
|
|
| 71 |
|
$command->storage->setLineLastLogin(new \DateTimeImmutable()); |
| 72 |
|
$command->active = false; |
| 73 |
|
$command->message->text = 'Success!'; |
| 74 |
|
} else { |
| 75 |
|
$command->message->text = 'Try again ...'; |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
return $next($command); |
| 79 |
|
} |
|
@@ 96-104 (lines=9) @@
|
| 93 |
|
$password = $username; |
| 94 |
|
|
| 95 |
|
if ($password && $workflow->can($subject, 'enter_password')) { |
| 96 |
|
if ($password === 'demo') { |
| 97 |
|
$workflow->apply($subject, 'enter_password'); |
| 98 |
|
|
| 99 |
|
$command->storage->setLineLastLogin(new \DateTimeImmutable()); |
| 100 |
|
$command->active = false; |
| 101 |
|
$command->message->text = 'Success!'; |
| 102 |
|
} else { |
| 103 |
|
$command->message->text = 'Password not match, Try again ...'; |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
return $next($command); |
| 107 |
|
} |