Merge pull request #318 from pi-hole/tweak/loginpage

Ctrl+Return on login page -> Go immediately to Settings page
This commit is contained in:
Mcat12
2017-01-02 15:31:23 -05:00
committed by GitHub
3 changed files with 18 additions and 4 deletions

View File

@@ -196,3 +196,11 @@ if(versionCompare(piholeVersion, "v2.9.5") < 1)
{
$("#btnSearchExact").hide();
}
// Handle Strg + Enter button on Login page
$(document).keypress(function(e) {
if((e.keyCode === 10 || e.keyCode === 13) && e.ctrlKey && $("#loginpw").is(":focus")) {
$("#loginform").attr("action", "settings.php");
$("#loginform").submit();
}
});

View File

@@ -442,7 +442,7 @@
// Show Logout button if $auth is set and authorization is required
if(strlen($pwhash) > 0) { ?>
<li>
<a href="index.php?logout">
<a href="?logout">
<i class="fa fa-user-times"></i> <span>Logout</span>
</a>
</li>

View File

@@ -13,13 +13,19 @@
</div>
<div class="panel-body">
<form action="" method="post">
<form action="" id="loginform" method="post">
<div class="form-group has-feedback <?php if ($wrongpassword) { ?>has-error<?php } ?> ">
<input type="password" name="pw" class="form-control" placeholder="Password" autofocus>
<input type="password" id="loginpw" name="pw" class="form-control" placeholder="Password" autofocus>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-4 col-xs-offset-8">
<div class="col-xs-8">
<ul>
<li><tt>Return</tt> &rarr; Log in and go to requested page (<?php echo $scriptname; ?>)</li>
<li><tt>Ctrl+Return</tt> &rarr; Log in and go to Settings page</li>
</ul>
</div>
<div class="col-xs-4">
<button type="submit" href="#" class="btn btn-primary pull-right"><i class="glyphicon glyphicon-log-in"></i>&nbsp;&nbsp;&nbsp;Log in</button>
</div>
</div>