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
1 changed files with 10 additions and 4 deletions

View File

@ -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);';
}
}
?>
}