mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Disable password field if no password is set
For someone to actually whitelist a domain without a password, more changes will be needed on the PHP side.
This commit is contained in:
parent
7875df0d6b
commit
e7589945a2
@ -209,11 +209,17 @@ if (explode("-", $phVersion)[1] != "0")
|
||||
window.onload = function () {
|
||||
<?php
|
||||
// Remove href fallback from "Back to safety" button
|
||||
if ($featuredTotal > 0) echo '$("#bpBack").removeAttr("href");';
|
||||
// Enable whitelisting if $svPasswd is present & JS is available
|
||||
if (!empty($svPasswd) && $featuredTotal > 0) {
|
||||
echo '$("#bpWLPassword, #bpWhitelist").prop("disabled", false);';
|
||||
if ($featuredTotal > 0) {
|
||||
echo '$("#bpBack").removeAttr("href");';
|
||||
|
||||
// Enable whitelisting if JS is available
|
||||
echo '$("#bpWhitelist").prop("disabled", false);';
|
||||
|
||||
// Enable password input if necessary
|
||||
if (!empty($svPasswd)) {
|
||||
echo '$("#bpWLPassword").attr("placeholder", "Password");';
|
||||
echo '$("#bpWLPassword").prop("disabled", false);';
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user