From 369d5f4df03a937e35575ad4f46d5ac3a954196f Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sun, 14 Aug 2005 18:56:35 +0000 Subject: [PATCH] Log new users in automatically if the user was successfully created --- account.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account.php b/account.php index 3f474b1..28e5a7d 100644 --- a/account.php +++ b/account.php @@ -105,12 +105,18 @@ function cmd_do_new() 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"); redirect(apidb_fullurl()); } else + { + $_SESSION['current'] = ""; retry("new", "Failed to create account"); + } } @@ -156,7 +162,6 @@ function cmd_send_passwd() redirect(apidb_fullurl("account.php?cmd=login")); } - /** * on login handler */