Changeset 1850 for trunk/include/functions_user.inc.php
- Timestamp:
- Feb 22, 2007, 6:31:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r1817 r1850 393 393 function calculate_permissions($user_id, $user_status) 394 394 { 395 global $user;396 397 395 $private_array = array(); 398 396 $authorized_array = array(); … … 438 436 439 437 // if user is not an admin, locked categories are forbidden 440 if ( !is_admin($user_status))438 if ( $user_status!='administrator' and $user_status!='webmaster' ) 441 439 { 442 440 $query = ' … … 982 980 * @return bool 983 981 */ 984 function get_access_type_status($user_status ='')982 function get_access_type_status($user_status='') 985 983 { 986 984 global $user; 987 985 988 if ( ($user_status == '') and isset($user['status']))986 if ($user_status == '' and isset($user['status']) ) 989 987 { 990 988 $user_status = $user['status']; … … 1025 1023 * @return bool 1026 1024 */ 1027 function is_autorize_status($access_type, $user_status = '') 1028 { 1029 return (get_access_type_status($user_status) >= $access_type); 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); 1030 1037 } 1031 1038 … … 1036 1043 * @return none 1037 1044 */ 1038 function check_status( $access_type, $user_status = '')1039 { 1040 if (!is_autorize_status($access_type , $user_status))1045 function check_status( $access_type ) 1046 { 1047 if (!is_autorize_status($access_type) ) 1041 1048 { 1042 1049 access_denied(); … … 1048 1055 * @return bool 1049 1056 */ 1050 function is_admin( $user_status = '')1051 { 1052 return is_autorize_status(ACCESS_ADMINISTRATOR , $user_status);1057 function is_admin() 1058 { 1059 return is_autorize_status(ACCESS_ADMINISTRATOR); 1053 1060 } 1054 1061
Note: See TracChangeset
for help on using the changeset viewer.