Changeset 1117
- Timestamp:
- Apr 1, 2006, 3:24:21 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r1092 r1117 235 235 if (is_adviser()) 236 236 { 237 ob_start();// buffer output so that cookies work 237 238 echo ' 238 239 <div class="titrePage"> -
trunk/include/functions_user.inc.php
r1113 r1117 301 301 } 302 302 303 // if user is not an admin, locked categories can be considered as private$304 if (!is_admin($user_status))305 {306 $query = '307 SELECT id308 FROM '.CATEGORIES_TABLE.'309 WHERE visible = \'false\'310 ;';311 $result = pwg_query($query);312 while ($row = mysql_fetch_array($result))313 {314 array_push($private_array, $row['id']);315 }316 317 $private_array = array_unique($private_array);318 }319 320 303 // retrieve category ids directly authorized to the user 321 304 $query = ' … … 346 329 $forbidden_array = array_diff($private_array, $authorized_array); 347 330 348 // at least, the list contains -1 values. This category does not exists so 349 // where clauses such as "WHERE category_id NOT IN(-1)" will always be 350 // true. 351 array_push($forbidden_array, '-1'); 331 // if user is not an admin, locked categories are forbidden 332 if (!is_admin($user_status)) 333 { 334 $query = ' 335 SELECT id 336 FROM '.CATEGORIES_TABLE.' 337 WHERE visible = \'false\' 338 ;'; 339 $result = pwg_query($query); 340 while ($row = mysql_fetch_array($result)) 341 { 342 array_push($forbidden_array, $row['id']); 343 } 344 $forbidden_array = array_unique($forbidden_array); 345 } 346 347 if ( empty($forbidden_array) ) 348 {// at least, the list contains -1 values. This category does not exists so 349 // where clauses such as "WHERE category_id NOT IN(-1)" will always be 350 // true. 351 array_push($forbidden_array, '-1'); 352 } 352 353 353 354 return implode(',', $forbidden_array); -
trunk/index.php
r1113 r1117 45 45 session_unset(); 46 46 session_destroy(); 47 setcookie(session_name(),'',0, cookie_path() );47 setcookie(session_name(),'',0, ini_get('session.cookie_path') ); 48 48 redirect( make_index_url() ); 49 49 }
Note: See TracChangeset
for help on using the changeset viewer.