From 922ea55cdbea3ee9c3dbfdfcf173bc16bfbdc7fa Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Tue, 19 Mar 2019 16:07:24 -0600 Subject: [PATCH] Fix #16: add back button to login flow that redirects to username entry --- langs/en/login.json | 3 ++- login/index.php | 6 ++++++ login/parts/password.php | 3 +++ login/parts/totp.php | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/langs/en/login.json b/langs/en/login.json index 2a333e5..b6adfed 100644 --- a/langs/en/login.json +++ b/langs/en/login.json @@ -21,5 +21,6 @@ "account locked": "This account has been disabled. Contact technical support.", "password expired": "You must change your password before continuing.", "account terminated": "Account terminated. Access denied.", - "account state error": "Your account state is not stable. Log out, restart your browser, and try again." + "account state error": "Your account state is not stable. Log out, restart your browser, and try again.", + "Back": "Back" } diff --git a/login/index.php b/login/index.php index 8b8ffc1..21ac925 100644 --- a/login/index.php +++ b/login/index.php @@ -29,6 +29,12 @@ if (empty($_SESSION['thisstep'])) { $_SESSION['thisstep'] = "username"; } +if (!empty($_GET['reset'])) { + $_SESSION['thisstep'] = "username"; + $_SESSION['check'] = ""; + header("Location: ./?code=$_GET[code]&redirect=$_GET[redirect]"); +} + $error = ""; function sendUserBack($code, $url, $uid) { diff --git a/login/parts/password.php b/login/parts/password.php index a35a34c..582d39a 100644 --- a/login/parts/password.php +++ b/login/parts/password.php @@ -22,6 +22,9 @@ $username = (new User($_SESSION['login_uid']))->getUsername();
+ + get("Back"); ?> + diff --git a/login/parts/totp.php b/login/parts/totp.php index b3e8800..28af319 100644 --- a/login/parts/totp.php +++ b/login/parts/totp.php @@ -21,6 +21,9 @@ $_SESSION['check'] = "totp";
+ + get("Back"); ?> +