d8b678f2 by Zelig

cookie

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