Changeset 1851 for trunk/include/functions_user.inc.php
- Timestamp:
- Feb 22, 2007, 9:20:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r1850 r1851 436 436 437 437 // if user is not an admin, locked categories are forbidden 438 if ( $user_status!='administrator' and $user_status!='webmaster')438 if (!is_admin($user_status)) 439 439 { 440 440 $query = ' … … 982 982 function get_access_type_status($user_status='') 983 983 { 984 global $user ;984 global $user, $conf; 985 985 986 986 if ($user_status == '' and isset($user['status']) ) … … 993 993 { 994 994 case 'guest': 995 { 996 if 997 ( 998 !isset($user) or 999 ($user['id']==$conf['guest_id'] and !$conf['guest_access']) 1000 ) 1001 { 1002 $access_type_status = ACCESS_NONE; 1003 } 1004 else 1005 { 1006 $access_type_status = ACCESS_GUEST; 1007 } 1008 break; 1009 } 995 1010 case 'generic': 996 1011 { … … 1023 1038 * @return bool 1024 1039 */ 1025 function is_autorize_status($access_type) 1026 { 1027 global $user, $conf; 1028 if ( 1029 !isset($user) or 1030 ($user['id']==$conf['guest_id'] and $conf['guest_access']==false) 1031 ) 1032 { 1033 return ACCESS_NONE>=$access_type; 1034 } 1035 1036 return (get_access_type_status() >= $access_type); 1040 function is_autorize_status($access_type, $user_status = '') 1041 { 1042 return (get_access_type_status($user_status) >= $access_type); 1037 1043 } 1038 1044 … … 1043 1049 * @return none 1044 1050 */ 1045 function check_status( $access_type)1046 { 1047 if (!is_autorize_status($access_type ))1051 function check_status($access_type, $user_status = '') 1052 { 1053 if (!is_autorize_status($access_type, $user_status)) 1048 1054 { 1049 1055 access_denied(); … … 1055 1061 * @return bool 1056 1062 */ 1057 function is_admin()1058 { 1059 return is_autorize_status(ACCESS_ADMINISTRATOR );1063 function is_admin($user_status = '') 1064 { 1065 return is_autorize_status(ACCESS_ADMINISTRATOR, $user_status); 1060 1066 } 1061 1067
Note: See TracChangeset
for help on using the changeset viewer.