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'
This commit is contained in:
james 2008-07-08 19:29:02 +00:00
parent 66ec01cd60
commit e1055150c9
2 changed files with 9 additions and 4 deletions

View File

@ -141,10 +141,15 @@ if($_POST['action']=="save")
echo "<b>Done!</b><br />";
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']));

View File

@ -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,