Browse Source

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

pull/17/head
Skylar Ittner 1 year ago
parent
commit
922ea55cdb
4 changed files with 14 additions and 1 deletions
  1. +2
    -1
      langs/en/login.json
  2. +6
    -0
      login/index.php
  3. +3
    -0
      login/parts/password.php
  4. +3
    -0
      login/parts/totp.php

+ 2
- 1
langs/en/login.json View File

@@ -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
- 0
login/index.php View File

@@ -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
- 0
login/parts/password.php View File

@@ -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
- 0
login/parts/totp.php View File

@@ -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