From e7589945a28f1c741a82423b7683b42d1c8b27ca Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 7 Oct 2017 16:41:30 -0400 Subject: [PATCH] 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. --- advanced/index.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/advanced/index.php b/advanced/index.php index 911f3cc8..1fa6a53c 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -209,11 +209,17 @@ if (explode("-", $phVersion)[1] != "0") 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);'; + } } ?> }