".$lang['user_err_modify']."";
$absent = true;
}
if ( $_GET['mode'] == 'modif' )
{
if ( $pseudo == '' )
{
echo"
".$lang['user_err_unknown']."
";
$absent = true;
}
}
if ( !$absent )
{
if ( $_GET['valider'] == 1 )
{
if ( $_GET['mode'] != 'modif' )
{
$error = register_user( $_POST['pseudo'], $_POST['password'],
$_POST['password'], $_POST['mail_address'],
$_POST['status'] );
}
else
{
$use_new_password = false;
if ( $_POST['use_new_pwd'] == 1)
{
$use_new_password = true;
}
$error = update_user( $_GET['user_id'], $_POST['mail_address'],
$_POST['status'], $use_new_password,
$_POST['password'] );
}
}
if ( sizeof( $error ) > 0 )
{
echo "".$lang['adduser_err_message'].sizeof( $error )." :";
echo "
";
for ( $i = 0; $i < sizeof( $error ); $i++ )
{
echo "- ".$error[$i]."
";
}
echo "
";
echo "
";
}
if ( sizeof( $error ) == 0 && $_GET['valider'] == 1 )
{
echo"".$lang['adduser_info_message']."\"$pseudo\" ";
if ( $_POST['use_new_pwd'] == 1 )
{
echo $lang['adduser_info_password_updated']." ";
}
echo"[
".$lang['adduser_info_back']." ]
";
}
if ( $_GET['valider'] != 1 || $_GET['mode'] != "modif" || sizeof( $error ) > 0 )
{
if ( $_GET['mode'] != "modif" && sizeof( $error ) == 0 )
{
unset( $pseudo, $password, $status, $mail_address );
}
if ( !isset( $_POST['use_new_pwd'] ) || $_POST['use_new_pwd'] != 1 )
{
unset( $password );
}
$action = "./admin.php?page=ajout&valider=1";
if ( $_GET['mode'] == "modif" )
{
$action.= "&mode=modif&user_id=".$_GET['user_id'];
}
echo"";
if ( $_GET['mode'] == "modif" )
{
echo "";
}
}
}
?>