diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-01-03 19:31:34 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-01-03 19:31:34 +0000 |
commit | def737885ff1dbaf25c2ea192b296f89a32d33c7 (patch) | |
tree | 772a1934449f6b9d7087f0be278d3fae7296a7a5 | |
parent | 5926e202041976aad63351e741973a35a41b67c1 (diff) |
user restricitions are now stored in the database
git-svn-id: http://piwigo.org/svn/branches/release-1_3@241 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | include/user.inc.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/user.inc.php b/include/user.inc.php index a91a4b61b..e33809430 100644 --- a/include/user.inc.php +++ b/include/user.inc.php @@ -16,6 +16,7 @@ * the Free Software Foundation; * * * ***************************************************************************/ + // retrieving user informations // $infos array is used to know the fields to retrieve in the table "users" // Each field becomes an information of the array $user. @@ -24,7 +25,7 @@ $infos = array( 'id', 'username', 'mail_address', 'nb_image_line', 'nb_line_page', 'status', 'language', 'maxwidth', 'maxheight', 'expand', 'show_nb_comments', 'short_period', - 'long_period', 'template' ); + 'long_period', 'template', 'forbidden_categories' ); $query_user = 'SELECT '; foreach ( $infos as $i => $info ) { @@ -102,12 +103,21 @@ $row = mysql_fetch_array( mysql_query( $query_user ) ); // affectation of each value retrieved in the users table into a variable // of the array $user. foreach ( $infos as $info ) { - $user[$info] = $row[$info]; // If the field is true or false, the variable is transformed into a // boolean value. if ( $row[$info] == 'true' or $row[$info] == 'false' ) { $user[$info] = get_boolean( $row[$info] ); } + else if ( $info == 'forbidden_categories' ) + { + $user[$info] = $row[$info]; + $user['restrictions'] = explode( ',', $row[$info] ); + if ( $user['restrictions'][0] == '' ) $user['restrictions'] = array(); + } + else + { + $user[$info] = $row[$info]; + } } ?>
\ No newline at end of file |