From e1055150c9cbf12b524e238ce750f07bbd725898 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 8 Jul 2008 19:29:02 +0000 Subject: [PATCH] Dont make newly created users passwords expire as soon as they login Allow firstname and lastname to be POSTed through on the install3 script so the name can be set instead of using 'Superuser Account' --- install3.php | 11 ++++++++--- user.inc.php | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/install3.php b/install3.php index a89bd29..4fabcc0 100644 --- a/install3.php +++ b/install3.php @@ -141,10 +141,15 @@ if($_POST['action']=="save") echo "Done!
"; echo "Creating superuser account..."; - $u = user_create('committee'); - $u['firstname'] = ''; - $u['lastname'] = 'Superuser Account'; + if($_POST['firstname'] && $_POST['lastname']) { + $u['firstname']=mysql_escape_string(stripslashes($_POST['firstname'])); + $u['lastname']=mysql_escape_string(stripslashes($_POST['lastname'])); + } + else { + $u['firstname'] = 'Superuser'; + $u['lastname'] = 'Account'; + } $u['emailprivate'] = mysql_escape_string(stripslashes($_POST['email'])); $u['username'] = mysql_escape_string(stripslashes($_POST['email'])); $u['password'] = mysql_escape_string(stripslashes($_POST['pass1'])); diff --git a/user.inc.php b/user.inc.php index 7a6cde7..27eb33a 100644 --- a/user.inc.php +++ b/user.inc.php @@ -338,7 +338,7 @@ function user_create($type, $u = NULL) { if(!is_array($u)) { mysql_query("INSERT INTO users (`types`,`passwordset`,`created`) - VALUES ('$type', '0000-00-00', NOW())"); + VALUES ('$type', NOW(), NOW())"); $uid = mysql_insert_id(); } else { /* The user has been specified and already exists,