diff --git a/advanced/index.php b/advanced/index.php index 999acebb..14da9ecf 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -98,9 +98,6 @@ if ($serverName === "pi.hole") { /* Start processing Block Page from here */ -// Determine placeholder text based off $svPasswd presence -$wlPlaceHolder = empty($svPasswd) ? "No admin password set" : "Javascript disabled"; - // Define admin email address text based off $svEmail presence $bpAskAdmin = !empty($svEmail) ? '' : ""; @@ -236,11 +233,21 @@ setHeader(); window.onload = function () { 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);'; + } + // Otherwise hide the input + else { + echo '$("#bpWLPassword").hide();'; + } } ?> } @@ -294,7 +301,7 @@ setHeader();