SHOW:
|
|
- or go back to the newest paste.
| 1 | - | public function taskFormSubmitted(Form $form) |
| 1 | + | public function taskFormSubmitted(Form $form) |
| 2 | - | {
|
| 2 | + | {
|
| 3 | - | |
| 3 | + | $hash = $this->calculateHash($form->values->password) ; |
| 4 | - | |
| 4 | + | |
| 5 | - | $hash = $this->calculateHash($form->values->password) ; |
| 5 | + | try {
|
| 6 | - | try |
| 6 | + | $this->registrations->registrationUser($form->values->username, $hash, $form->values->name); |
| 7 | - | {
|
| 7 | + | $this->flashMessage('byl jste registrovan', 'success');
|
| 8 | - | $this->registrations->registrationUser($form->values->username, $hash, $form->values->name); |
| 8 | + | |
| 9 | - | } catch(Exception $e) |
| 9 | + | } catch (Exception $e) {
|
| 10 | if ($e->getCode() == 23000) {
| |
| 11 | - | {
|
| 11 | + | $this->flashMessage('tenhle nick uz je pouzivan.', 'success');
|
| 12 | } else {
| |
| 13 | - | //echo 'Chyba: ', $e->getMessage(); |
| 13 | + | $this->flashMessage('registrace se nepovedla, zkuste to prosím za chviličku znovu', 'success');
|
| 14 | - | if ( $e->getCode() == 23000) {
|
| 14 | + | } |
| 15 | - | $this->flashMessage('tenhle nick uz je pouzivan.', 'success');
|
| 15 | + | }; |
| 16 | - | } |
| 16 | + | } |