Log new users in automatically if the user was successfully created

This commit is contained in:
Chris Morgan
2005-08-14 18:56:35 +00:00
committed by WineHQ
parent c77e881999
commit 369d5f4df0

View File

@@ -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
*/ */