Update http_auth to use boolean

This commit is contained in:
FusionPBX 2024-11-01 14:17:32 -06:00 committed by GitHub
parent 175e88e15a
commit afdb029a25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -264,7 +264,7 @@
//http authentication - digest
if (!empty($provision["http_auth_username"]) && empty($provision["http_auth_type"])) { $provision["http_auth_type"] = "digest"; }
if (!empty($provision["http_auth_username"]) && $provision["http_auth_type"] === "digest" && !empty($provision["http_auth_enabled"]) && $provision["http_auth_enabled"] === "true") {
if (!empty($provision["http_auth_username"]) && $provision["http_auth_type"] === "digest" && !empty($provision["http_auth_enabled"]) && $provision["http_auth_enabled"]) {
//function to parse the http auth header
function http_digest_parse($txt) {
//protect against missing data
@ -336,7 +336,7 @@
}
//http authentication - basic
if (!empty($provision["http_auth_username"]) && $provision["http_auth_type"] === "basic" && $provision["http_auth_enabled"] === "true") {
if (!empty($provision["http_auth_username"]) && $provision["http_auth_type"] === "basic" && $provision["http_auth_enabled"]) {
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="'.$domain_name.'"');
header('HTTP/1.0 401 Authorization Required');