HosipLan

Untitled

Aug 11th, 2012
95
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.', 'success');
  12.             } else {
  13.                 $this->flashMessage('registrace se nepovedla, zkuste to prosím za chviličku znovu', 'success');
  14.             }
  15.         };
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment