Skip to content
Snippets Groups Projects
Commit 2f8a48f0 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #611 from greezybacon/issue/forgot-my-password


oops: Fix display of forgot-my-password link

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents b6df489d 59007702
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array(); ...@@ -12,7 +12,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array();
<input type="text" name="userid" id="name" value="<?php echo $info['userid']; ?>" placeholder="username" autocorrect="off" autocapitalize="off"> <input type="text" name="userid" id="name" value="<?php echo $info['userid']; ?>" placeholder="username" autocorrect="off" autocapitalize="off">
<input type="password" name="passwd" id="pass" placeholder="password" autocorrect="off" autocapitalize="off"> <input type="password" name="passwd" id="pass" placeholder="password" autocorrect="off" autocapitalize="off">
</fieldset> </fieldset>
<?php if ($_SESSION['_staff']['strikes'] > 1 && $cfg->allowPasswordReset()) { ?> <?php if ($show_reset && $cfg->allowPasswordReset()) { ?>
<h3 style="display:inline"><a href="pwreset.php">Forgot my password</a></h3> <h3 style="display:inline"><a href="pwreset.php">Forgot my password</a></h3>
<?php } ?> <?php } ?>
<input class="submit" type="submit" name="submit" value="Log In"> <input class="submit" type="submit" name="submit" value="Log In">
......
...@@ -23,6 +23,7 @@ $dest = $_SESSION['_staff']['auth']['dest']; ...@@ -23,6 +23,7 @@ $dest = $_SESSION['_staff']['auth']['dest'];
$msg = $_SESSION['_staff']['auth']['msg']; $msg = $_SESSION['_staff']['auth']['msg'];
$msg = $msg?$msg:'Authentication Required'; $msg = $msg?$msg:'Authentication Required';
$dest=($dest && (!strstr($dest,'login.php') && !strstr($dest,'ajax.php')))?$dest:'index.php'; $dest=($dest && (!strstr($dest,'login.php') && !strstr($dest,'ajax.php')))?$dest:'index.php';
$show_reset = false;
if($_POST) { if($_POST) {
// Lookup support backends for this staff // Lookup support backends for this staff
$username = trim($_POST['userid']); $username = trim($_POST['userid']);
...@@ -34,6 +35,7 @@ if($_POST) { ...@@ -34,6 +35,7 @@ if($_POST) {
} }
$msg = $errors['err']?$errors['err']:'Invalid login'; $msg = $errors['err']?$errors['err']:'Invalid login';
$show_reset = true;
} }
// Consider single sign-on authentication backends // Consider single sign-on authentication backends
else if (!$thisstaff || !($thisstaff->getId() || $thisstaff->isValid())) { else if (!$thisstaff || !($thisstaff->getId() || $thisstaff->isValid())) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment