| @@ 84-98 (lines=15) @@ | ||
| 81 | return $this->redirect($this->link); |
|
| 82 | } |
|
| 83 | ||
| 84 | if (Session::get('AutoLoginHash')) { |
|
| 85 | $message = DBField::create_field( |
|
| 86 | 'HTMLFragment', |
|
| 87 | '<p>' . _t( |
|
| 88 | 'SilverStripe\\Security\\Security.ENTERNEWPASSWORD', |
|
| 89 | 'Please enter a new password.' |
|
| 90 | ) . '</p>' |
|
| 91 | ); |
|
| 92 | ||
| 93 | // Subsequent request after the "first load with hash" (see previous if clause). |
|
| 94 | return [ |
|
| 95 | 'Content' => $message, |
|
| 96 | 'Form' => $this->changePasswordForm() |
|
| 97 | ]; |
|
| 98 | } |
|
| 99 | ||
| 100 | if (Security::getCurrentUser()) { |
|
| 101 | // Logged in user requested a password change form. |
|
| @@ 100-114 (lines=15) @@ | ||
| 97 | ]; |
|
| 98 | } |
|
| 99 | ||
| 100 | if (Security::getCurrentUser()) { |
|
| 101 | // Logged in user requested a password change form. |
|
| 102 | $message = DBField::create_field( |
|
| 103 | 'HTMLFragment', |
|
| 104 | '<p>' . _t( |
|
| 105 | 'SilverStripe\\Security\\Security.CHANGEPASSWORDBELOW', |
|
| 106 | 'You can change your password below.' |
|
| 107 | ) . '</p>' |
|
| 108 | ); |
|
| 109 | ||
| 110 | return [ |
|
| 111 | 'Content' => $message, |
|
| 112 | 'Form' => $this->changePasswordForm() |
|
| 113 | ]; |
|
| 114 | } |
|
| 115 | // Show a friendly message saying the login token has expired |
|
| 116 | if ($token !== null && $member && !$member->validateAutoLoginToken($token)) { |
|
| 117 | $message = [ |
|