Log new users in automatically if the user was successfully created
This commit is contained in:
@@ -105,12 +105,18 @@ function cmd_do_new()
|
|||||||
|
|
||||||
if($result == true)
|
if($result == true)
|
||||||
{
|
{
|
||||||
$user->login($_POST['ext_email'], $_POST['ext_password']);
|
/* if we can log the user in, log them in automatically */
|
||||||
|
if($user->login($_POST['ext_email'], $_POST['ext_password']))
|
||||||
|
$_SESSION['current'] = $user;
|
||||||
|
|
||||||
addmsg("Account created! (".$_POST['ext_email'].")", "green");
|
addmsg("Account created! (".$_POST['ext_email'].")", "green");
|
||||||
redirect(apidb_fullurl());
|
redirect(apidb_fullurl());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
$_SESSION['current'] = "";
|
||||||
retry("new", "Failed to create account");
|
retry("new", "Failed to create account");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -156,7 +162,6 @@ function cmd_send_passwd()
|
|||||||
redirect(apidb_fullurl("account.php?cmd=login"));
|
redirect(apidb_fullurl("account.php?cmd=login"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* on login handler
|
* on login handler
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user