HosipLan

Untitled

Aug 11th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public function taskFormSubmitted(Form $form)
  2.     {
  3.         $hash = $this->calculateHash($form->values->password) ;
  4.  
  5.         try {
  6.             $this->registrations->registrationUser($form->values->username, $hash, $form->values->name);
  7.             $this->flashMessage('byl jste registrovan', 'success');      
  8.  
  9.         } catch (Exception $e) {
  10.             if ($e->getCode() == 23000) {
  11.                 $this->flashMessage('tenhle nick uz je pouzivan.', 'danger');
  12.  
  13.             } else {
  14.                 $this->flashMessage('registrace se nepovedla, zkuste to prosím za chviličku znovu', 'danger');
  15.             }
  16.         };
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment