1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +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:
Mcat12 2017-10-07 16:41:30 -04:00 committed by GitHub
parent 7875df0d6b
commit e7589945a2

View File

@ -209,11 +209,17 @@ if (explode("-", $phVersion)[1] != "0")
window.onload = function () { window.onload = function () {
<?php <?php
// Remove href fallback from "Back to safety" button // Remove href fallback from "Back to safety" button
if ($featuredTotal > 0) echo '$("#bpBack").removeAttr("href");'; if ($featuredTotal > 0) {
// Enable whitelisting if $svPasswd is present & JS is available echo '$("#bpBack").removeAttr("href");';
if (!empty($svPasswd) && $featuredTotal > 0) {
echo '$("#bpWLPassword, #bpWhitelist").prop("disabled", false);'; // 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").attr("placeholder", "Password");';
echo '$("#bpWLPassword").prop("disabled", false);';
}
} }
?> ?>
} }