|
|
@ -16,8 +16,9 @@ class Login extends CI_Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
// redirect if session exists |
|
|
|
// redirect if session exists |
|
|
|
$this->load->library('session'); |
|
|
|
$this->load->library('session'); |
|
|
|
if(! $this->session->userdata('validated')){ |
|
|
|
|
|
|
|
redirect('/dashboard'); |
|
|
|
if($this->session->userdata('validated')){ |
|
|
|
|
|
|
|
redirect(base_url('/dashboard')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$this->form_validation->set_rules('username', 'Username', 'required'); |
|
|
|
$this->form_validation->set_rules('username', 'Username', 'required'); |
|
|
@ -84,7 +85,7 @@ class Login extends CI_Controller |
|
|
|
$this->session->set_userdata($userdata); |
|
|
|
$this->session->set_userdata($userdata); |
|
|
|
|
|
|
|
|
|
|
|
// Redirect to dashboard |
|
|
|
// Redirect to dashboard |
|
|
|
redirect('/dashboard'); |
|
|
|
redirect(base_url('/dashboard')); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|