mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Added cookie test of login page
This commit is contained in:
@@ -204,3 +204,24 @@ $(document).keypress(function(e) {
|
|||||||
$("#loginform").submit();
|
$("#loginform").submit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function testCookies()
|
||||||
|
{
|
||||||
|
if (navigator.cookieEnabled) return true;
|
||||||
|
|
||||||
|
// set and read cookie
|
||||||
|
document.cookie = "cookietest=1";
|
||||||
|
var ret = document.cookie.indexOf("cookietest=") != -1;
|
||||||
|
|
||||||
|
// delete cookie
|
||||||
|
document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
if(!testCookies() && $("#cookieInfo").length)
|
||||||
|
{
|
||||||
|
$("#cookieInfo").show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
<div class="panel-title text-center"><span class="logo-lg" style="font-size: 25px;"><b>Pi</b>-hole</span></div>
|
<div class="panel-title text-center"><span class="logo-lg" style="font-size: 25px;"><b>Pi</b>-hole</span></div>
|
||||||
<p class="login-box-msg">Sign in to start your session</p>
|
<p class="login-box-msg">Sign in to start your session</p>
|
||||||
|
<div id="cookieInfo" class="panel-title text-center" style="color:#F00; font-size: 150%" hidden>Verify that cookies are allowed for <tt><?php echo $_SERVER['HTTP_HOST']; ?></tt></div>
|
||||||
<?php if ($wrongpassword) { ?>
|
<?php if ($wrongpassword) { ?>
|
||||||
<div class="form-group has-error login-box-msg">
|
<div class="form-group has-error login-box-msg">
|
||||||
<label class="control-label"><i class="fa fa-times-circle-o"></i> Wrong password!</label>
|
<label class="control-label"><i class="fa fa-times-circle-o"></i> Wrong password!</label>
|
||||||
@@ -54,7 +55,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user