forked from science-ation/science-ation
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:
parent
66ec01cd60
commit
e1055150c9
11
install3.php
11
install3.php
@ -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']));
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user