Fix #16: add back button to login flow that redirects to username entry

pull/17/head
Skylar Ittner 5 years ago
parent df79def142
commit 922ea55cdb

@ -21,5 +21,6 @@
"account locked": "This account has been disabled. Contact technical support.", "account locked": "This account has been disabled. Contact technical support.",
"password expired": "You must change your password before continuing.", "password expired": "You must change your password before continuing.",
"account terminated": "Account terminated. Access denied.", "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"
} }

@ -29,6 +29,12 @@ if (empty($_SESSION['thisstep'])) {
$_SESSION['thisstep'] = "username"; $_SESSION['thisstep'] = "username";
} }
if (!empty($_GET['reset'])) {
$_SESSION['thisstep'] = "username";
$_SESSION['check'] = "";
header("Location: ./?code=$_GET[code]&redirect=$_GET[redirect]");
}
$error = ""; $error = "";
function sendUserBack($code, $url, $uid) { function sendUserBack($code, $url, $uid) {

@ -22,6 +22,9 @@ $username = (new User($_SESSION['login_uid']))->getUsername();
</div> </div>
<div class="d-flex"> <div class="d-flex">
<a href="./?code=<?php echo htmlentities($_GET['code']); ?>&amp;redirect=<?php echo htmlentities($_GET['redirect']); ?>&amp;reset=1" class="btn btn-link mr-2">
<i class="fas fa-chevron-left"></i> <?php $Strings->get("Back"); ?>
</a>
<button type="submit" class="btn btn-primary ml-auto"> <button type="submit" class="btn btn-primary ml-auto">
<i class="fas fa-chevron-right"></i> <?php $Strings->get("continue"); ?> <i class="fas fa-chevron-right"></i> <?php $Strings->get("continue"); ?>
</button> </button>

@ -21,6 +21,9 @@ $_SESSION['check'] = "totp";
</div> </div>
<div class="d-flex"> <div class="d-flex">
<a href="./?code=<?php echo htmlentities($_GET['code']); ?>&amp;redirect=<?php echo htmlentities($_GET['redirect']); ?>&amp;reset=1" class="btn btn-link mr-2">
<i class="fas fa-chevron-left"></i> <?php $Strings->get("Back"); ?>
</a>
<button type="submit" class="btn btn-primary ml-auto"> <button type="submit" class="btn btn-primary ml-auto">
<i class="fas fa-chevron-right"></i> <?php $Strings->get("continue"); ?> <i class="fas fa-chevron-right"></i> <?php $Strings->get("continue"); ?>
</button> </button>

Loading…
Cancel
Save