Ignore:
Timestamp:
Aug 8, 2005, 10:52:19 PM (19 years ago)
Author:
plg
Message:
  • new : external authentication in another users table. Previous users table is divided between users (common properties with any web application) and user_infos (phpwebgallery specific informations). External table and fields can be configured.
  • modification : profile.php is not reachable through administration anymore (not useful).
  • modification : in profile.php, current password is mandatory only if user tries to change his password. Username can't be changed.
  • deletion : of obsolete functions get_user_restrictions, update_user_restrictions, get_user_all_restrictions, is_user_allowed, update_user
  • modification : user_forbidden table becomes user_cache so that not only restriction informations can be stored in this table.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_category.inc.php

    r773 r808  
    4141 * @return void
    4242 */
    43 function check_restrictions( $category_id )
    44 {
    45   global $user,$lang;
    46 
    47   if ( in_array( $category_id, $user['restrictions'] ) )
     43function check_restrictions($category_id)
     44{
     45  global $user, $lang;
     46
     47  if (in_array($category_id, explode(',', $user['forbidden_categories'])))
    4848  {
    4949    echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
     
    168168  $query = '
    169169SELECT COUNT(DISTINCT(image_id)) as total
    170   FROM '.IMAGE_CATEGORY_TABLE;
    171   if (count($user['restrictions']) > 0)
    172   {
    173     $query.= '
    174   WHERE category_id NOT IN ('.$user['forbidden_categories'].')';
    175   }
    176   $query.= '
    177 ;';
    178  
    179   $row = mysql_fetch_array(pwg_query($query));
    180 
    181   return isset($row['total']) ? $row['total'] : 0;
     170  FROM '.IMAGE_CATEGORY_TABLE.'
     171  WHERE category_id NOT IN ('.$user['forbidden_categories'].')
     172;';
     173  list($total) = mysql_fetch_array(pwg_query($query));
     174 
     175  return $total;
    182176}
    183177
Note: See TracChangeset for help on using the changeset viewer.