public function postLogin() { $email = Request::post('email', 'email'); $pass = Request::post('password'); $login_result = UserModel::login($email, $pass); $data = array(); if (!$login_result) { // BAD PASSWORD COMBO Messenger::error('Invalid password.'); } else { $session = Session::getInstance(); $session->setState(Session::STATE_APP); $data['cookies'] = array('session' => $session->session_key); Output::setJsonCookies(true); return $data; } }
/** * Handle the user attempting to log in. */ public function postLogin() { $email = Request::post('email', 'email'); $pass = Request::post('password'); $login_result = UserModel::login($email, $pass); if (!$login_result) { // BAD PASSWORD COMBO Messenger::error("You entered the wrong password. If you are having problems and would like to reset your password, <a href='/user?action=reset'>click here</a>"); Template::getInstance()->set('action', 'login'); return $this->get(); } else { $this->loginRedirect(); exit; } }