1 | <?php |
||
22 | class LostPasswordHandler extends RequestHandler |
||
23 | { |
||
24 | protected $authenticatorClass = MemberAuthenticator::class; |
||
25 | |||
26 | private static $url_handlers = [ |
||
|
|||
27 | 'passwordsent/$EmailAddress' => 'passwordsent', |
||
28 | '' => 'lostpassword', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * Since the logout and dologin actions may be conditionally removed, it's necessary to ensure these |
||
33 | * remain valid actions regardless of the member login state. |
||
34 | * |
||
35 | * @var array |
||
36 | * @config |
||
37 | */ |
||
38 | private static $allowed_actions = [ |
||
39 | 'lostpassword', |
||
40 | 'LostPasswordForm', |
||
41 | 'passwordsent', |
||
42 | ]; |
||
43 | |||
44 | private $link = null; |
||
45 | |||
46 | /** |
||
47 | * @param $link The URL to recreate this request handler |
||
48 | */ |
||
49 | public function __construct($link) |
||
54 | |||
55 | /** |
||
56 | * Return a link to this request handler. |
||
57 | * The link returned is supplied in the constructor |
||
58 | * @return string |
||
59 | */ |
||
60 | public function link($action = null) |
||
68 | |||
69 | /** |
||
70 | * URL handler for the initial lost-password screen |
||
71 | */ |
||
72 | public function lostpassword() |
||
85 | |||
86 | /** |
||
87 | * Show the "password sent" page, after a user has requested |
||
88 | * to reset their password. |
||
89 | */ |
||
90 | public function passwordsent() |
||
112 | |||
113 | |||
114 | /** |
||
115 | * Factory method for the lost password form |
||
116 | * |
||
117 | * @skipUpgrade |
||
118 | * @return Form Returns the lost password form |
||
119 | */ |
||
120 | public function lostPasswordForm() |
||
138 | |||
139 | /** |
||
140 | * Redirect to password recovery form |
||
141 | * |
||
142 | * @return HTTPResponse |
||
143 | */ |
||
144 | public function redirectToLostPassword() |
||
149 | |||
150 | public function getReturnReferer() |
||
154 | |||
155 | /** |
||
156 | * Log out form handler method |
||
157 | * |
||
158 | * This method is called when the user clicks on "logout" on the form |
||
159 | * created when the parameter <i>$checkCurrentUser</i> of the |
||
160 | * {@link __construct constructor} was set to TRUE and the user was |
||
161 | * currently logged in. |
||
162 | * |
||
163 | * @return HTTPResponse |
||
164 | */ |
||
165 | public function logout() |
||
169 | |||
170 | /** |
||
171 | * Try to authenticate the user |
||
172 | * |
||
173 | * @param array $data Submitted data |
||
174 | * @return Member Returns the member object on successful authentication |
||
175 | * or NULL on failure. |
||
176 | */ |
||
177 | public function performLogin($data) |
||
192 | |||
193 | /** |
||
194 | * Forgot password form handler method. |
||
195 | * Called when the user clicks on "I've lost my password". |
||
196 | * Extensions can use the 'forgotPassword' method to veto executing |
||
197 | * the logic, by returning FALSE. In this case, the user will be redirected back |
||
198 | * to the form without further action. It is recommended to set a message |
||
199 | * in the form detailing why the action was denied. |
||
200 | * |
||
201 | * @skipUpgrade |
||
202 | * @param array $data Submitted data |
||
203 | * @return HTTPResponse |
||
204 | */ |
||
205 | public function forgotPassword($data) |
||
247 | |||
248 | /** |
||
249 | * @todo copypaste from FormRequestHandler - refactor |
||
250 | */ |
||
251 | protected function addBackURLParam($link) |
||
259 | } |
||
260 |