Displaying errors on user login failures

This commit is contained in:
Corby Krick
2013-03-24 16:31:45 -05:00
parent 99213ed063
commit b0d87e5edf
2 changed files with 53 additions and 5 deletions

View File

@@ -305,13 +305,11 @@ class User extends CI_Controller {
$this->form_validation->set_rules('user_name', 'Username', 'required');
$this->form_validation->set_rules('user_password', 'Password', 'required');
$data = $query->row();
if ($this->form_validation->run() == FALSE)
{
//$data['page_title'] = Login;
$data['page_title'] = "Login";
$this->load->view('layout/header', $data);
$this->load->view('user/login');
@@ -324,7 +322,7 @@ class User extends CI_Controller {
$this->user_model->update_session($data->user_id);
redirect('dashboard');
} else {
$this->session->set_flashdata('notice', 'Incorrect username or password!');
$this->session->set_flashdata('error', 'Incorrect username or password!');
redirect('user/login');
}
}