1 | <?php |
||
25 | class LostPasswordHandler extends RequestHandler |
||
26 | { |
||
27 | /** |
||
28 | * Authentication class to use |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $authenticatorClass = MemberAuthenticator::class; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private static $url_handlers = [ |
||
|
|||
37 | 'passwordsent/$EmailAddress' => 'passwordsent', |
||
38 | '' => 'lostpassword', |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * Since the logout and dologin actions may be conditionally removed, it's necessary to ensure these |
||
43 | * remain valid actions regardless of the member login state. |
||
44 | * |
||
45 | * @var array |
||
46 | * @config |
||
47 | */ |
||
48 | private static $allowed_actions = [ |
||
49 | 'lostpassword', |
||
50 | 'LostPasswordForm', |
||
51 | 'passwordsent', |
||
52 | ]; |
||
53 | |||
54 | private $link = null; |
||
55 | |||
56 | /** |
||
57 | * @param string $link The URL to recreate this request handler |
||
58 | */ |
||
59 | public function __construct($link) |
||
64 | |||
65 | /** |
||
66 | * Return a link to this request handler. |
||
67 | * The link returned is supplied in the constructor |
||
68 | * |
||
69 | * @param string $action |
||
70 | * @return string |
||
71 | */ |
||
72 | public function link($action = null) |
||
80 | |||
81 | /** |
||
82 | * URL handler for the initial lost-password screen |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | public function lostpassword() |
||
99 | |||
100 | /** |
||
101 | * Show the "password sent" page, after a user has requested |
||
102 | * to reset their password. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | public function passwordsent() |
||
128 | |||
129 | |||
130 | /** |
||
131 | * Factory method for the lost password form |
||
132 | * |
||
133 | * @skipUpgrade |
||
134 | * @return Form Returns the lost password form |
||
135 | */ |
||
136 | public function lostPasswordForm() |
||
147 | |||
148 | /** |
||
149 | * Redirect to password recovery form |
||
150 | * |
||
151 | * @return HTTPResponse |
||
152 | */ |
||
153 | public function redirectToLostPassword() |
||
159 | |||
160 | /** |
||
161 | * Forgot password form handler method. |
||
162 | * Called when the user clicks on "I've lost my password". |
||
163 | * Extensions can use the 'forgotPassword' method to veto executing |
||
164 | * the logic, by returning FALSE. In this case, the user will be redirected back |
||
165 | * to the form without further action. It is recommended to set a message |
||
166 | * in the form detailing why the action was denied. |
||
167 | * |
||
168 | * @skipUpgrade |
||
169 | * @param array $data Submitted data |
||
170 | * @return HTTPResponse |
||
171 | */ |
||
172 | public function forgotPassword($data) |
||
214 | |||
215 | protected function sendEmail($member, $token) |
||
230 | } |
||
231 |