@@ 57-65 (lines=9) @@ | ||
54 | @list($username, $password) = $this->captureUserAndPassword($command->input); |
|
55 | ||
56 | if ($username && $password && $workflow->can($subject, 'enter_username_n_password')) { |
|
57 | if ($username === 'demo' && $password === 'demo') { |
|
58 | $workflow->apply($subject, 'enter_username_n_password'); |
|
59 | ||
60 | $command->storage->setLineLastLogin(new \DateTimeImmutable()); |
|
61 | $command->active = false; |
|
62 | $command->message->text = 'Success!'; |
|
63 | } else { |
|
64 | $command->message->text = 'Try again ...'; |
|
65 | } |
|
66 | ||
67 | return $next($command); |
|
68 | } |
|
@@ 85-93 (lines=9) @@ | ||
82 | $password = $username; |
|
83 | ||
84 | if ($password && $workflow->can($subject, 'enter_password')) { |
|
85 | if ($password === 'demo') { |
|
86 | $workflow->apply($subject, 'enter_password'); |
|
87 | ||
88 | $command->storage->setLineLastLogin(new \DateTimeImmutable()); |
|
89 | $command->active = false; |
|
90 | $command->message->text = 'Success!'; |
|
91 | } else { |
|
92 | $command->message->text = 'Password not match, Try again ...'; |
|
93 | } |
|
94 | ||
95 | return $next($command); |
|
96 | } |