Exemplo n.º 1
0
 public function action_postLogin()
 {
     if (!$this->userNotAllowed()) {
         return;
     }
     try {
         Model_User::validate($_POST, true);
         $user = new Model_User();
         $user->login($_POST['username'], $_POST['password']);
         Session::set('message', "Zostałeś zalogowany.");
         $this->redirect(FRONT_CONTROLLER . '/');
     } catch (Validation_Exception $exception) {
         $this->content = new View("user/login");
         $this->content->passData('errorField', $exception->field);
         $this->content->passData('error', $exception->error);
     }
 }