Changeset 680
- Timestamp:
- Jan 8, 2005, 12:23:52 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r675 r680 322 322 // - all the favorites linked to this user 323 323 // - all sessions linked to this user 324 // - all categories informations linked to thisuser324 // - calculated permissions linked to the user 325 325 function delete_user($user_id) 326 326 { … … 349 349 $query = ' 350 350 DELETE FROM '.SESSIONS_TABLE.' 351 WHERE user_id = '.$user_id.' 352 ;'; 353 pwg_query($query); 354 355 // deletion of calculated permissions linked to the user 356 $query = ' 357 DELETE FROM '.USER_FORBIDDEN_TABLE.' 351 358 WHERE user_id = '.$user_id.' 352 359 ;'; -
trunk/include/functions_user.inc.php
r675 r680 268 268 * 269 269 * @param int user_id 270 * @param string user_status 270 271 * @return string forbidden_categories 271 272 */ 272 function calculate_permissions($user_id )273 function calculate_permissions($user_id, $user_status) 273 274 { 274 275 $private_array = array(); … … 284 285 { 285 286 array_push($private_array, $row['id']); 287 } 288 289 // if user is not an admin, locked categories can be considered as private$ 290 if ($user_status != 'admin') 291 { 292 $query = ' 293 SELECT id 294 FROM '.CATEGORIES_TABLE.' 295 WHERE visible = \'false\' 296 ;'; 297 $result = pwg_query($query); 298 while ($row = mysql_fetch_array($result)) 299 { 300 array_push($private_array, $row['id']); 301 } 302 303 $private_array = array_unique($private_array); 286 304 } 287 305 -
trunk/include/user.inc.php
r675 r680 129 129 or $user['need_update'] == true) 130 130 { 131 $user['forbidden_categories'] = calculate_permissions($user['id']); 131 $user['forbidden_categories'] = calculate_permissions($user['id'], 132 $user['status']); 132 133 } 133 134 }
Note: See TracChangeset
for help on using the changeset viewer.