Browse Source

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

master
Skylar Ittner 3 years ago
parent
commit
922ea55cdb
  1. 3
      langs/en/login.json
  2. 6
      login/index.php
  3. 3
      login/parts/password.php
  4. 3
      login/parts/totp.php

3
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"
}

6
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) {

3
login/parts/password.php

@ -22,6 +22,9 @@ $username = (new User($_SESSION['login_uid']))->getUsername();
</div>
<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">
<i class="fas fa-chevron-right"></i> <?php $Strings->get("continue"); ?>
</button>

3
login/parts/totp.php

@ -21,6 +21,9 @@ $_SESSION['check'] = "totp";
</div>
<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">
<i class="fas fa-chevron-right"></i> <?php $Strings->get("continue"); ?>
</button>

Loading…
Cancel
Save