change dontBasicAuth to useBasicAuth

pull/397/merge
qkqpttgf 2021-08-09 04:27:25 +00:00 committed by GitHub
parent 54e38b5f67
commit 12494b62ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ $EnvConfigs = [
'customCss' => 0b011, 'customCss' => 0b011,
'customTheme' => 0b011, 'customTheme' => 0b011,
'theme' => 0b010, 'theme' => 0b010,
'dontBasicAuth' => 0b010, 'useBasicAuth' => 0b010,
'referrer' => 0b011, 'referrer' => 0b011,
'forceHttps' => 0b010, 'forceHttps' => 0b010,
@ -727,7 +727,7 @@ function comppass($pass)
return 2; return 2;
} }
if ($_COOKIE['password'] !== '') if ($_COOKIE['password'] === $pass ) return 3; if ($_COOKIE['password'] !== '') if ($_COOKIE['password'] === $pass ) return 3;
if (!getConfig('dontBasicAuth')) { if (getConfig('useBasicAuth')) {
// use Basic Auth // use Basic Auth
//$_SERVER['PHP_AUTH_USER'] //$_SERVER['PHP_AUTH_USER']
if ($_SERVER['PHP_AUTH_PW'] !== '') if (md5($_SERVER['PHP_AUTH_PW']) === $pass ) { if ($_SERVER['PHP_AUTH_PW'] !== '') if (md5($_SERVER['PHP_AUTH_PW']) === $pass ) {
@ -1935,7 +1935,7 @@ function render_list($path = '', $files = [])
if ($_SERVER['ishidden']==4) { if ($_SERVER['ishidden']==4) {
// 加密状态 // 加密状态
if (!getConfig('dontBasicAuth')) { if (getConfig('useBasicAuth')) {
// use Basic Auth // use Basic Auth
return output('Need password.', 401, ['WWW-Authenticate'=>'Basic realm="Secure Area"']); return output('Need password.', 401, ['WWW-Authenticate'=>'Basic realm="Secure Area"']);
} }