Changeset 241


Ignore:
Timestamp:
Jan 3, 2004, 8:31:34 PM (20 years ago)
Author:
z0rglub
Message:

user restricitions are now stored in the database

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/include/user.inc.php

    r90 r241  
    1717 *                                                                         *
    1818 ***************************************************************************/
     19
    1920// retrieving user informations
    2021// $infos array is used to know the fields to retrieve in the table "users"
     
    2526                'nb_line_page', 'status', 'language', 'maxwidth',
    2627                'maxheight', 'expand', 'show_nb_comments', 'short_period',
    27                 'long_period', 'template' );
     28                'long_period', 'template', 'forbidden_categories' );
    2829
    2930$query_user  = 'SELECT ';
     
    103104// of the array $user.
    104105foreach ( $infos as $info ) {
    105   $user[$info] = $row[$info];
    106106  // If the field is true or false, the variable is transformed into a
    107107  // boolean value.
     
    110110    $user[$info] = get_boolean( $row[$info] );
    111111  }
     112  else if ( $info == 'forbidden_categories' )
     113  {
     114    $user[$info] = $row[$info];
     115    $user['restrictions'] = explode( ',', $row[$info] );
     116    if ( $user['restrictions'][0] == '' ) $user['restrictions'] = array();
     117  }
     118  else
     119  {
     120    $user[$info] = $row[$info];   
     121  }
    112122}
    113123?>
Note: See TracChangeset for help on using the changeset viewer.