".$lang['user_err_unknown']."";
$erreur = true;
}
if ( $row['pseudo'] == $conf['webmaster'] )
{
echo"
".$lang['user_err_modify']."
";
$erreur = true;
}
}
//---------------------------------------------------données de la catégorie
if ( isset( $HTTP_GET_VARS['cat_id'] ) )
{
$HTTP_GET_VARS['cat'] = $HTTP_GET_VARS['cat_id'];
check_cat_id( $HTTP_GET_VARS['cat_id'] );
if ( isset( $page['cat'] ) )
{
$result = get_cat_info( $page['cat'] );
$page['cat_name'] = $result['name'];
$page['id_uppercat'] = $result['id_uppercat'];
}
}
//--------------------------------------------------------------- mise à jour
if ( isset( $HTTP_POST_VARS['submit'] ) )
{
if ( isset( $HTTP_GET_VARS['user_id'] ) )
{
mysql_query ( "delete from PREFIX_TABLE"."restrictions where user_id = ".$HTTP_GET_VARS['user_id'].";" );
$result = mysql_query ( "select id from PREFIX_TABLE"."categories;" );
while ( $row = mysql_fetch_array ( $result ) )
{
$nom_select = "acces-".$row['id'];
if ( $HTTP_POST_VARS[$nom_select] == 1 )
{
mysql_query ( "insert into PREFIX_TABLE"."restrictions (user_id,cat_id) values ('".$HTTP_GET_VARS['user_id']."','".$row['id']."');" );
}
}
check_favorites( $HTTP_GET_VARS['user_id'] );
echo "";
}
else if ( isset( $HTTP_GET_VARS['cat_id'] ) )
{
mysql_query ( "delete from PREFIX_TABLE"."restrictions where cat_id = '".$page['cat']."';" );
$result = mysql_query( "select id from PREFIX_TABLE"."users where pseudo != '".$conf['webmaster']."';" );
while ( $row = mysql_fetch_array ( $result ) )
{
$nom_select = "acces-".$row['id'];
if ( $HTTP_POST_VARS[$nom_select] == 1 )
{
mysql_query ( "insert into PREFIX_TABLE"."restrictions (user_id,cat_id) values ('".$row['id']."','".$page['cat']."');" );
}
check_favorites( $row['id'] );
}
echo "";
}
}
//--------------------------------------------------------------- formulaire
function display_cat_manager( $id_uppercat, $indent, $uppercat_authorized, $level, $restriction )
{
global PREFIX_TABLE,$lang,$conf;
$output = "";
// will we use or lines ?
if ( $level == 0 )
{
$start_line = " ";
}
else
{
$start_line = " ";
if ( $level == 1 )
{
$start_line2 = " ";
$output.= "\n\t".$start_line."style=\"width:85%;text-align:left;\">$indent ";
if ( in_array( $row['id'], $restriction ) || !$uppercat_authorized )
{
$subcat_authorized = false;
$color = "red";
}
else
{
$color = "green";
}
$output.= "";
if ( $row['name'] == "" )
{
$output.= str_replace( "_", " ", $row['dir'] );
}
else
{
$output.= $row['name'];
}
$output.= " [ dir : ".$row['dir']." ]";
$output.= " ".$end_line;
$output.= "\n\t".$start_line2." style=\"width:15%;white-space:nowrap;text-align:right;font-weight:normal;\">";
$output.= "\n\t\t ".$lang['permuser_authorized'];
$output.= "\n\t\t ".$lang['permuser_forbidden'];
$output.= $end_line;
$output.= "\n ";
$output.= display_cat_manager( $row['id'], $indent." ", $subcat_authorized, $level + 1, $restriction );
}
return $output;
}
if ( !$erreur )
{
//----------------------------------------------
// cas 1 : permissions pour un utilisateur donné
if ( isset( $HTTP_GET_VARS['user_id'] ) )
{
echo"
".$lang['permuser_title']." \"".$page['pseudo']."\"
";
$restriction = get_restrictions( $HTTP_GET_VARS['user_id'], $page['status'], false );
echo"