cookie
Showing
1 changed file
with
2 additions
and
0 deletions
| ... | @@ -25,6 +25,7 @@ if(!function_exists('hasRole')) { | ... | @@ -25,6 +25,7 @@ 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 | if($login_user) { | ||
| 28 | $login_user = json_decode($login_user, true); | 29 | $login_user = json_decode($login_user, true); |
| 29 | foreach($login_user['roleKeys'] as $v){ | 30 | foreach($login_user['roleKeys'] as $v){ |
| 30 | if(in_array($v, $roles)){ | 31 | if(in_array($v, $roles)){ |
| ... | @@ -33,4 +34,5 @@ if(!function_exists('hasRole')) { | ... | @@ -33,4 +34,5 @@ if(!function_exists('hasRole')) { |
| 33 | } | 34 | } |
| 34 | return false; | 35 | return false; |
| 35 | } | 36 | } |
| 37 | } | ||
| 36 | } | 38 | } | ... | ... |
-
Please register or sign in to post a comment