aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-07-21 19:47:14 +0000
committerz0rglub <z0rglub@piwigo.org>2003-07-21 19:47:14 +0000
commit2fa9252446a78d349ca2f50096430591cc5e012f (patch)
treebbf5cd282c8b9424b05d970c70e30610ea8b0e4f /include/functions_user.inc.php
parent55a0a61aaf58a02e2ac5d2c489f81b1be4730cd8 (diff)
*** empty log message ***
git-svn-id: http://piwigo.org/svn/trunk@26 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_user.inc.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 0f286b970..1d55d4bbe 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -313,7 +313,7 @@ function get_all_restrictions( $user_id, $user_status )
function is_user_allowed( $category_id, $restrictions )
{
$lowest_category_id = $category_id;
-
+
$is_root = false;
while ( !$is_root and !in_array( $category_id, $restrictions ) )
{
@@ -322,21 +322,12 @@ function is_user_allowed( $category_id, $restrictions )
$query.= ' WHERE id = '.$category_id;
$query.= ';';
$row = mysql_fetch_array( mysql_query( $query ) );
- if ( $row['id_uppercat'] == '' )
- {
- $is_root = true;
- }
+ if ( $row['id_uppercat'] == '' ) $is_root = true;
$category_id = $row['id_uppercat'];
}
-
- if ( in_array( $lowest_category_id, $restrictions ) )
- {
- return 1;
- }
- if ( in_array( $category_id, $restrictions ) )
- {
- return 2;
- }
+
+ if ( in_array( $lowest_category_id, $restrictions ) ) return 1;
+ if ( in_array( $category_id, $restrictions ) ) return 2;
// this user is allowed to go in this category
return 0;
}