forked from science-ation/science-ation
Fixup all other uses of user_create
This commit is contained in:
parent
6a1de0f2f3
commit
cb39440d16
@ -32,10 +32,9 @@ if($_POST['users_uid'])
|
|||||||
$uid = intval($_POST['users_uid']);
|
$uid = intval($_POST['users_uid']);
|
||||||
|
|
||||||
/* Some actions we want to redirect to the personal editor, so deal with those first */
|
/* Some actions we want to redirect to the personal editor, so deal with those first */
|
||||||
if($_POST['add_member'])
|
if($_POST['add_member']) {
|
||||||
{
|
$email = $_POST['add_member'];
|
||||||
$u = user_create('committee');
|
$u = user_create('committee', $email);
|
||||||
list($u['firstname'], $u['lastname']) = split(' ', $_POST['add_member']);
|
|
||||||
user_save($u);
|
user_save($u);
|
||||||
header("location: {$config['SFIABDIRECTORY']}/user_personal.php?edit={$u['id']}");
|
header("location: {$config['SFIABDIRECTORY']}/user_personal.php?edit={$u['id']}");
|
||||||
exit;
|
exit;
|
||||||
@ -244,7 +243,7 @@ if($_POST['add_member_to_committees_id'])
|
|||||||
echo "<h4>".i18n("Add Committee Member")."</h4>\n";
|
echo "<h4>".i18n("Add Committee Member")."</h4>\n";
|
||||||
echo "<form method=\"post\" action=\"committees.php\">\n";
|
echo "<form method=\"post\" action=\"committees.php\">\n";
|
||||||
echo "<table>\n";
|
echo "<table>\n";
|
||||||
echo "<tr><td>".i18n("Member Name").": </td><td>";
|
echo "<tr><td>".i18n("Member Email").": </td><td>";
|
||||||
echo "<input type=\"text\" size=\"15\" name=\"add_member\" />\n";
|
echo "<input type=\"text\" size=\"15\" name=\"add_member\" />\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo " <td><input type=\"submit\" value=\"".i18n("Add")."\" /></td></tr>\n";
|
echo " <td><input type=\"submit\" value=\"".i18n("Add")."\" /></td></tr>\n";
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
$p = ($_POST['primary']=='yes')?'yes':'no';
|
$p = ($_POST['primary']=='yes')?'yes':'no';
|
||||||
|
|
||||||
if($_POST['save']=="add") {
|
if($_POST['save']=="add") {
|
||||||
$u=user_create("sponsor");
|
$u=user_create("sponsor", $_POST['email']);
|
||||||
$id=$u['id'];
|
$id=$u['id'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -141,7 +141,7 @@ if($_POST['action']=="save")
|
|||||||
echo "<b>Done!</b><br />";
|
echo "<b>Done!</b><br />";
|
||||||
echo "Creating superuser account...";
|
echo "Creating superuser account...";
|
||||||
|
|
||||||
$u = user_create('committee');
|
$u = user_create('committee',$_POST['email']);
|
||||||
if($_POST['firstname'] && $_POST['lastname']) {
|
if($_POST['firstname'] && $_POST['lastname']) {
|
||||||
$u['firstname']=mysql_escape_string(stripslashes($_POST['firstname']));
|
$u['firstname']=mysql_escape_string(stripslashes($_POST['firstname']));
|
||||||
$u['lastname']=mysql_escape_string(stripslashes($_POST['lastname']));
|
$u['lastname']=mysql_escape_string(stripslashes($_POST['lastname']));
|
||||||
|
@ -184,7 +184,9 @@
|
|||||||
|
|
||||||
switch($action) {
|
switch($action) {
|
||||||
case 'notexist': /* Create the user */
|
case 'notexist': /* Create the user */
|
||||||
$u = user_create($type);
|
$u = user_create($type, $email);
|
||||||
|
$u['email'] = $email;
|
||||||
|
user_save($u);
|
||||||
email_send("{$type}_new_invite",$u['email'],
|
email_send("{$type}_new_invite",$u['email'],
|
||||||
array("FAIRNAME"=>$config['fairname']),
|
array("FAIRNAME"=>$config['fairname']),
|
||||||
array("FAIRNAME"=>$config['fairname'],
|
array("FAIRNAME"=>$config['fairname'],
|
||||||
@ -195,7 +197,7 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'norole': /* Add role to the existing user */
|
case 'norole': /* Add role to the existing user */
|
||||||
user_create($type, $u);
|
user_create($type, $u['username'], $u);
|
||||||
email_send("{$type}_add_invite",$u['email'],
|
email_send("{$type}_add_invite",$u['email'],
|
||||||
array("FAIRNAME"=>$config['fairname']),
|
array("FAIRNAME"=>$config['fairname']),
|
||||||
array("FAIRNAME"=>$config['fairname']));
|
array("FAIRNAME"=>$config['fairname']));
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
* ensuring a student doesn't try to also
|
* ensuring a student doesn't try to also
|
||||||
* register as a judge */
|
* register as a judge */
|
||||||
$u = user_load($_SESSION['users_id']);
|
$u = user_load($_SESSION['users_id']);
|
||||||
$u = user_create($type, $u);
|
$u = user_create($type, $u['username'], $u);
|
||||||
$_SESSION['users_type'] = $type;
|
$_SESSION['users_type'] = $type;
|
||||||
message_push(notice(i18n("Login to finish adding the new role to your account")));
|
message_push(notice(i18n("Login to finish adding the new role to your account")));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user