| Conditions | 5 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 13 | public function handle() { |
||
| 14 | |||
| 15 | # Init user by secret code |
||
| 16 | |||
| 17 | if (false !== ($code = Auth::secret())) $this->code = $code; |
||
| 18 | |||
| 19 | else Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/reset'); |
||
| 20 | |||
| 21 | # Create form |
||
| 22 | |||
| 23 | $this->form = new Auth\Form\Recover(); |
||
| 24 | |||
| 25 | # Handle form |
||
| 26 | |||
| 27 | if ($this->form->handle(new Auth\Controller\Recover())) { |
||
| 28 | |||
| 29 | Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/login?submitted=recover'); |
||
| 30 | } |
||
| 31 | |||
| 32 | # ------------------------ |
||
| 33 | |||
| 34 | return $this->getContents(); |
||
| 35 | } |
||
| 36 | } |
||
| 38 |