From 8db2ff5da679b3c2d5a53f67f67863d786057f36 Mon Sep 17 00:00:00 2001 From: Marcel Korpel Date: Sun, 19 Jul 2015 22:32:06 +0200 Subject: Set correct 'My Account' link after changing username Don't print messages (and the account form) in process_account_form() anymore, but return them to the caller. When updating accounts, this function will be called before the headers are written. If a username has been changed by process_account_form(), the headers now show the updated username from the database in the 'My Account' link. Clicking on it immediately after changing a username will no longer lead to a non-existing URL. Signed-off-by: Marcel Korpel Signed-off-by: Lukas Fleischer --- web/html/register.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'web/html/register.php') diff --git a/web/html/register.php b/web/html/register.php index cb3e8dd2..9c5c1cc1 100644 --- a/web/html/register.php +++ b/web/html/register.php @@ -19,11 +19,20 @@ echo '
'; echo '

' . __('Register') . '

'; if (in_request("Action") == "NewAccount") { - process_account_form("new", "NewAccount", in_request("U"), 1, 0, + list($success, $message) = process_account_form( + "new", "NewAccount", in_request("U"), 1, 0, in_request("E"), '', '', in_request("R"), in_request("L"), in_request("I"), in_request("K"), in_request("PK")); + print $message; + + if (!$success) { + display_account_form("NewAccount", in_request("U"), 1, 0, + in_request("E"), '', '', in_request("R"), + in_request("L"), in_request("I"), in_request("K"), + in_request("PK")); + } } else { print '

' . __("Use this form to create an account.") . '

'; display_account_form("NewAccount", "", "", "", "", "", "", "", $LANG); -- cgit v1.2.3-24-g4f1b