*** empty log message ***

git-svn-id: http://piwigo.org/svn/trunk@26 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
z0rglub
2003-07-21 19:47:14 +00:00
parent 55a0a61aaf
commit 2fa9252446
25 changed files with 1065 additions and 1123 deletions
+5 -14
View File
@@ -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;
}