d8b678f2 by Zelig

cookie

1 parent 4db1e873
......@@ -25,12 +25,14 @@ if(!function_exists('hasRole')) {
$CI = &get_instance();
$CI->load->helper('cookie');
$login_user = get_cookie('login_user');
$login_user = json_decode($login_user, true);
foreach($login_user['roleKeys'] as $v){
if(in_array($v, $roles)){
return true;
if($login_user) {
$login_user = json_decode($login_user, true);
foreach($login_user['roleKeys'] as $v){
if(in_array($v, $roles)){
return true;
}
}
return false;
}
return false;
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!