aboutsummaryrefslogtreecommitdiffstats
path: root/admin/user_modify.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-05-10 16:07:23 +0000
committerz0rglub <z0rglub@piwigo.org>2003-05-10 16:07:23 +0000
commit0cc55ec468a8535c7bde3505a6449f07df7de654 (patch)
tree1908b2aa3b89de90d1b76f614c46def29076dd55 /admin/user_modify.php
parent0d4089e914c91a080b7ce90715aa20bd9fcc06df (diff)
file added, to separate add and modify user infos
git-svn-id: http://piwigo.org/svn/trunk@8 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/user_modify.php63
1 files changed, 63 insertions, 0 deletions
diff --git a/admin/user_modify.php b/admin/user_modify.php
new file mode 100644
index 000000000..fad131d81
--- /dev/null
+++ b/admin/user_modify.php
@@ -0,0 +1,63 @@
+<?php
+/***************************************************************************
+ * user_modify.php *
+ * ------------------- *
+ * application : PhpWebGallery 1.3 *
+ * author : Pierrick LE GALL <pierrick@z0rglub.com> *
+ * *
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; *
+ * *
+ ***************************************************************************/
+include_once( './include/isadmin.inc.php' );
+//----------------------------------------------------- template initialization
+$sub = $vtp->Open( '../template/'.$user['template'].'/admin/user_modify.vtp' );
+$error = array();
+$tpl = array( 'user_err_modify', 'user_err_unknown' );
+templatize_array( $tpl, 'lang' );
+//--------------------------------------------------------- form criteria check
+$display_form = true;
+
+$query = 'select';
+$query.= ' username,status,mail_address';
+$query.= ' from '.$prefixeTable.'users';
+$query.= ' where id = '.$_GET['user_id'];
+$query.= ';';
+$row = mysql_fetch_array( mysql_query( $query ) );
+
+$username = $row['username'];
+$status = $row['status'];
+$mail_address = $row['mail_address'];
+
+if ( $username == 'guest'
+ or ( $username == $conf['webmaster']
+ and $user['username'] != $conf['webmaster'] ) )
+{
+ $vtp->addSession( $sub, 'err_modify' );
+ $vtp->closeSession( $sub, 'err_modify' );
+ $display_form = false;
+}
+if ( $username == '' )
+{
+ $vtp->addSession( $sub, 'err_unknown' );
+ $vtp->closeSession( $sub, 'err_unknown' );
+ $display_form = false;
+}
+
+if ( $display_form and isset( $_POST['submit'] ) )
+{
+ $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'] );
+}
+?> \ No newline at end of file