From 54e38b5f6788dc0370eaba030703f3cc3eb9b6b5 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 9 Aug 2021 04:25:18 +0000 Subject: [PATCH 1/2] change dontBasicAuth to useBasicAuth --- conststr.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conststr.php b/conststr.php index 7fbe1a8..6a3af61 100644 --- a/conststr.php +++ b/conststr.php @@ -101,7 +101,7 @@ $constStr = [ 'disableShowThumb' => 'if 1, the ShowThumbnail button will not display', 'disableChangeTheme' => 'if 1, the Theme selection button will not display', 'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password', - 'dontBasicAuth' => 'if 1, will not popup user/pass windows in encrypted folder, but show the page in theme.', + 'useBasicAuth' => 'if 1, will popup user/pass windows in encrypted folder.', 'background' => 'Set an url as background photo.', 'backgroundm' => 'Set an url as background in mobile phone.', 'forceHttps' => 'if 1, force to redirect to https when visit via http.', @@ -129,7 +129,7 @@ $constStr = [ 'disableShowThumb' => '如果填 1, ‘显示缩略’按钮将被隐藏。', 'disableChangeTheme' => '如果为 1,则不会显示主题选择按钮', 'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。', - 'dontBasicAuth' => '如果为 1,加密目录不再弹出用户名密码窗口,只会显示主题自带的页面。', + 'useBasicAuth' => '如果为 1,加密目录将弹出用户名密码窗口,不会显示主题自带的输入密码页面。', 'background' => '设置一个url作为背景。', 'backgroundm' => '设置一个url作为手机端用的背景。', 'forceHttps' => '0或1。如果设置为1,会强制跳https', From 12494b62ed33ebe02061275c6d8b6440cf1bc7b1 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 9 Aug 2021 04:27:25 +0000 Subject: [PATCH 2/2] change dontBasicAuth to useBasicAuth --- common.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.php b/common.php index defc676..f7ead28 100644 --- a/common.php +++ b/common.php @@ -35,7 +35,7 @@ $EnvConfigs = [ 'customCss' => 0b011, 'customTheme' => 0b011, 'theme' => 0b010, - 'dontBasicAuth' => 0b010, + 'useBasicAuth' => 0b010, 'referrer' => 0b011, 'forceHttps' => 0b010, @@ -727,7 +727,7 @@ function comppass($pass) return 2; } if ($_COOKIE['password'] !== '') if ($_COOKIE['password'] === $pass ) return 3; - if (!getConfig('dontBasicAuth')) { + if (getConfig('useBasicAuth')) { // use Basic Auth //$_SERVER['PHP_AUTH_USER'] 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 (!getConfig('dontBasicAuth')) { + if (getConfig('useBasicAuth')) { // use Basic Auth return output('Need password.', 401, ['WWW-Authenticate'=>'Basic realm="Secure Area"']); }