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