From 28e2f7b564d7f7ea12e1771aacf87db476dc9e17 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 23 Jun 2020 15:42:57 +0800 Subject: [PATCH] add a option to display theme selection or not --- common.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common.php b/common.php index 401a165..f2bbb63 100644 --- a/common.php +++ b/common.php @@ -12,6 +12,7 @@ $Base64Env = [ 'background', 'diskname', //'disableShowThumb', + //'disableChangeTheme', //'disktag', //'downloadencrypt', //'function_name', // used in heroku. @@ -53,6 +54,7 @@ $CommonEnv = [ 'background', 'disktag', 'disableShowThumb', + 'disableChangeTheme', 'function_name', // used in heroku. 'hideFunctionalityFile', 'timezone', @@ -76,6 +78,7 @@ $ShowedCommonEnv = [ 'background', //'disktag', 'disableShowThumb', + 'disableChangeTheme', //'function_name', // used in heroku. 'hideFunctionalityFile', 'timezone', @@ -2650,19 +2653,17 @@ function render_list($path = '', $files = '') $html = str_replace('', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runningtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html); } - $theme_arr = scandir('theme'); - $html .= ' + if ($_SERVER['admin']||!getConfig('disableChangeTheme')) { + $theme_arr = scandir('theme'); + $html .= '
'; + } $html = $authinfo . $html; if (isset($_SERVER['Set-Cookie'])) return output($html, $statusCode, [ 'Set-Cookie' => $_SERVER['Set-Cookie'], 'Content-Type' => 'text/html' ]);