Changeset 2029 for trunk/include/functions_user.inc.php
- Timestamp:
- Jun 6, 2007, 12:01:15 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r1985 r2029 147 147 $user['id'] = $user_id; 148 148 $user = array_merge( $user, getuserdata($user_id, $use_cache) ); 149 $user['is_the_guest'] = ($user['id'] == $conf['guest_id']);150 $user['is_the_default'] = ($user['id'] == $conf['default_user_id']);151 149 152 150 // calculation of the number of picture to display per page … … 1016 1014 $cookie = array('id' => (int)$user_id, 'key' => $key); 1017 1015 setcookie($conf['remember_me_name'], 1018 1019 1020 1021 1022 1016 serialize($cookie), 1017 time()+$conf['remember_me_length'], 1018 cookie_path() 1019 ); 1020 } 1023 1021 } 1024 1022 else … … 1091 1089 1092 1090 /* 1091 * Return user status used in this library 1092 * @return string 1093 */ 1094 function get_user_status($user_status) 1095 { 1096 global $user; 1097 1098 if (empty($user_status)) 1099 { 1100 if (isset($user['status'])) 1101 { 1102 $user_status = $user['status']; 1103 } 1104 else 1105 { 1106 // swicth to default value 1107 $user_status = ''; 1108 } 1109 } 1110 return $user_status; 1111 } 1112 1113 /* 1093 1114 * Return access_type definition of uuser 1094 1115 * Test does with user status … … 1097 1118 function get_access_type_status($user_status='') 1098 1119 { 1099 global $user, $conf; 1100 1101 if (empty($user_status)) 1102 { 1103 if (isset($user['status'])) 1104 { 1105 $user_status = $user['status']; 1106 } 1107 else 1108 { 1109 // swicth to default value 1110 $user_status = ''; 1111 } 1112 } 1113 1114 switch ($user_status) 1120 global $conf; 1121 1122 switch (get_user_status($user_status)) 1115 1123 { 1116 1124 case 'guest': … … 1174 1182 1175 1183 /* 1176 * Return if user is an administrator 1184 * Return if user is only a guest 1185 * @return bool 1186 */ 1187 function is_a_guest($user_status = '') 1188 { 1189 return get_user_status($user_status) == 'guest'; 1190 } 1191 1192 /* 1193 * Return if user is, at least, a classic user 1194 * @return bool 1195 */ 1196 function is_classic_user($user_status = '') 1197 { 1198 return is_autorize_status(ACCESS_CLASSIC, $user_status); 1199 } 1200 1201 /* 1202 * Return if user is, at least, an administrator 1177 1203 * @return bool 1178 1204 */
Note: See TracChangeset
for help on using the changeset viewer.