Exemplo n.º 1
0
 public function action_postRegister()
 {
     if (!$this->userNotAllowed()) {
         return;
     }
     try {
         Model_User::validate($_POST);
         Model_User::register($_POST['username'], $_POST['email'], $_POST['password']);
         Session::set('message', "Rejestracja przebiegła pomyślnie. Możesz się teraz zalogować.");
         $this->redirect(FRONT_CONTROLLER . '/user/login');
     } catch (Validation_Exception $exception) {
         $this->content = new View("user/register");
         $this->content->passData('errorField', $exception->field);
         $this->content->passData('error', $exception->error);
     }
 }