public function login() { $this->load->helper('form'); $this->load->library('form_validation'); if ($this->form_validation->run('user/login') === FALSE) { $this->load->view("templates/errorForm.php", array("fields" => array('email', 'username', 'password', 'captcha'))); } else { try { $this->user->login($this->input->post("username"), $this->input->post("password")); $this->load->view("user/user_redirect", array("page" => CALENDAR)); } catch (Username_Not_Exist $e) { $this->load->view("user/user_error.php"); User_Error::login_username_not_exist(); } catch (Password_Wrong $e) { $this->load->view("user/user_error.php"); User_Error::login_password_wrong(); } } }