Merge branch 'qkqpttgf:master' into master

pull/610/head
gd1214b 2021-08-15 12:00:24 +08:00 committed by GitHub
commit 27421138b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 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"']);
} }

View File

@ -101,7 +101,7 @@ $constStr = [
'disableShowThumb' => 'if 1, the ShowThumbnail button will not display', 'disableShowThumb' => 'if 1, the ShowThumbnail button will not display',
'disableChangeTheme' => 'if 1, the Theme selection 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', '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.', 'background' => 'Set an url as background photo.',
'backgroundm' => 'Set an url as background in mobile phone.', 'backgroundm' => 'Set an url as background in mobile phone.',
'forceHttps' => 'if 1, force to redirect to https when visit via http.', 'forceHttps' => 'if 1, force to redirect to https when visit via http.',
@ -129,7 +129,7 @@ $constStr = [
'disableShowThumb' => '如果填 1, ‘显示缩略’按钮将被隐藏。', 'disableShowThumb' => '如果填 1, ‘显示缩略’按钮将被隐藏。',
'disableChangeTheme' => '如果为 1则不会显示主题选择按钮', 'disableChangeTheme' => '如果为 1则不会显示主题选择按钮',
'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。', 'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。',
'dontBasicAuth' => '如果为 1加密目录不再弹出用户名密码窗口只会显示主题自带的页面。', 'useBasicAuth' => '如果为 1加密目录将弹出用户名密码窗口不会显示主题自带的输入密码页面。',
'background' => '设置一个url作为背景。', 'background' => '设置一个url作为背景。',
'backgroundm' => '设置一个url作为手机端用的背景。', 'backgroundm' => '设置一个url作为手机端用的背景。',
'forceHttps' => '0或1。如果设置为1会强制跳转https', 'forceHttps' => '0或1。如果设置为1会强制跳转https',