| @@ 49-64 (lines=16) @@ | ||
| 46 | $this->setLayout('login'); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function signInFormSubmitted($form) |
|
| 50 | { |
|
| 51 | try { |
|
| 52 | $values = $form->getValues(); |
|
| 53 | if ($values->remember) { |
|
| 54 | $this->getUser()->setExpiration('+ 14 days', false); |
|
| 55 | } else { |
|
| 56 | $this->getUser()->setExpiration('+ 20 minutes', true); |
|
| 57 | } |
|
| 58 | $this->getUser()->login($values->username, $values->password); |
|
| 59 | $this->forward('Homepage:'); |
|
| 60 | } catch (NS\AuthenticationException $e) { |
|
| 61 | $this->flashMessage($this->translation[$e->getMessage()], 'danger'); |
|
| 62 | $form->addError($e->getMessage()); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | ||
| 66 | public function actionOut() |
|
| 67 | { |
|
| @@ 63-83 (lines=21) @@ | ||
| 60 | $this->setLayout('login'); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function signInFormSubmitted($form) |
|
| 64 | { |
|
| 65 | ||
| 66 | try { |
|
| 67 | $values = $form->getValues(); |
|
| 68 | if ($values->remember) { |
|
| 69 | $this->getUser()->setExpiration('+ 14 days', false); |
|
| 70 | } else { |
|
| 71 | $this->getUser()->setExpiration('+ 20 minutes', true); |
|
| 72 | } |
|
| 73 | $this->getUser()->login($values->username, $values->password); |
|
| 74 | $this->flashMessage('Přihlášení bylo úspěšné', 'success'); |
|
| 75 | ||
| 76 | //TODO bude upraveno - ted nestiham :) |
|
| 77 | //$this->forward('Homepage:'); |
|
| 78 | $this->redirectUrl('https://www.zajistenainvestice.cz/uvod'); |
|
| 79 | } catch (NS\AuthenticationException $e) { |
|
| 80 | $this->flashMessage($this->translation[$e->getMessage()], 'danger'); |
|
| 81 | $form->addError($e->getMessage()); |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| 85 | public function actionOut() |
|
| 86 | { |
|