From d5e94e4d528421d2613f2a79507fc6e7a6fafce2 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Mon, 7 Mar 2016 22:28:24 +0100 Subject: [PATCH] Redirect put right --- application/controllers/Login.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/controllers/Login.php b/application/controllers/Login.php index ae582fb..6138a7a 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -16,8 +16,9 @@ class Login extends CI_Controller { // redirect if session exists $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'); @@ -84,7 +85,7 @@ class Login extends CI_Controller $this->session->set_userdata($userdata); // Redirect to dashboard - redirect('/dashboard'); + redirect(base_url('/dashboard')); } }