From 867c2379ff66ce0f2c4f872a13027fd649aa076d Mon Sep 17 00:00:00 2001 From: z0rglub Date: Fri, 9 May 2003 12:42:42 +0000 Subject: Initial revision git-svn-id: http://piwigo.org/svn/trunk@2 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/user_add.php | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 admin/user_add.php (limited to 'admin/user_add.php') diff --git a/admin/user_add.php b/admin/user_add.php new file mode 100644 index 000000000..cf67dcaa3 --- /dev/null +++ b/admin/user_add.php @@ -0,0 +1,255 @@ +".$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 ""; + 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"
+ + + + +
+ + + + + + + + + + + "; + echo" + + + + "; + echo" + + "; + echo " + + "; + echo" + + + + + + + +
".$lang['adduser_fill_form']."
 
".$lang['adduser_login'].""; + if ( $_GET['mode'] == "modif" ) + { + echo"$pseudo [".$lang['adduser_unmodify']."]"; + echo""; + } + else + { + echo""; + } + echo" +
"; + if ( $_GET['mode'] == "modif" ) + { + echo $lang['new']." ".$lang['password'].""; + } + else + { + echo $lang['password']; + } + echo""; + echo"
".$lang['reg_mail_address']."
".$lang['adduser_status'].""; + if ( $pseudo == $conf['webmaster'] ) + { + echo "$status [".$lang['adduser_unmodify']."] + "; + } + else + { + echo" + "; + } + echo" +
+
+
"; + if ( $_GET['mode'] == "modif" ) + { + echo "
[ ".$lang['adduser_info_back']." ]
"; + } + } +} +?> \ No newline at end of file -- cgit v1.2.3