php - Admin Access control not working -
i'm trying check if user logged in or not wan't check if admin or not if not redirect login page ain't working
// access control if (!$this->session->userdata('logged_in') ) { if(!$this->session->userdata('user_rol') == 'administrator'){ $this->session->set_flashdata('error_msg','please login admin first!'); redirect('admin/login'); } }
any please ??
actually script different. logic if not logged in, checks if user rolle isn't admin.
i believe should this, try achieve.
if (!$this->session->userdata('logged_in') or $this->session->userdata('user_rol') != 'administrator') { $this->session->set_flashdata('error_msg','please login admin first!'); redirect('admin/login'); }
Comments
Post a Comment