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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -