From a4a4326d082bd23b88a374e92684cff813735236 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 3 Jan 2020 16:50:36 +0800 Subject: [PATCH] Update index.php --- index.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index f975e1e..71e0c99 100644 --- a/index.php +++ b/index.php @@ -93,6 +93,8 @@ function main($path) if ($_GET['action']=='del_upload_cache'&&substr($_GET['filename'],-4)=='.tmp') { // del '.tmp' without login. 无需登录即可删除.tmp后缀文件 $tmp = MSAPI('DELETE',path_format(path_format($_SERVER['list_path'] . path_format($path)) . '/' . spurlencode($_GET['filename']) ),'',$_SERVER['access_token']); + $path1 = path_format($_SERVER['list_path'] . path_format($path)); + $cache->save('path_' . $path1, json_decode('{}',true), 1); return output($tmp['body'],$tmp['stat']); } if ($_GET['action']=='uploaded_rename') { @@ -106,6 +108,8 @@ function main($path) //echo $oldname .'
'. $data; $tmp = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']); if ($tmp['stat']==409) MSAPI('DELETE',$oldname,'',$_SERVER['access_token'])['body']; + $path1 = path_format($_SERVER['list_path'] . path_format($path)); + $cache->save('path_' . $path1, json_decode('{}',true), 1); return output($tmp['body'],$tmp['stat']); } if ($_GET['action']=='upbigfile') return bigfileupload($path); @@ -199,10 +203,12 @@ function EnvOpt($function_name, $needUpdate = 0) global $constStr; $constEnv = [ //'admin', - 'adminloginpage', 'domain_path', 'guestup_path', 'passfile', 'private_path', 'public_path', 'sitename', 'language' + 'adminloginpage', 'domain_path', 'guestup_path', 'passfile', + //'private_path', + 'public_path', 'sitename', 'language', 'theme' ]; asort($constEnv); - $html = 'Heroku '.$constStr['Setup'][$constStr['language']].''; + $html = 'OneManager '.$constStr['Setup'][$constStr['language']].''; /*if ($_POST['updateProgram']==$constStr['updateProgram'][$constStr['language']]) { $response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response']; if (isset($response['Error'])) { @@ -228,10 +234,8 @@ namespace:' . $namespace . '
} } $response = setConfig($tmp); - if (isset($response['id'])&&isset($response['message'])) { - $html = $response['id'] . '
-' . $response['message'] . '

-function_name:' . $_SERVER['function_name'] . '
+ if (!$response) { + $html = $response . '
'; $title = 'Error'; } else { @@ -245,7 +249,7 @@ function_name:' . $_SERVER['function_name'] . '
} $html .= ' '.$constStr['Back'][$constStr['language']].'    - Github
'; + Github
'; /*if ($needUpdate) { $html .= '
' . $_SERVER['github_version'] . '
@@ -272,6 +276,21 @@ function_name:' . $_SERVER['function_name'] . '
'; + } elseif ($key=='theme') { + $theme_arr = scandir('theme'); + $html .= ' + + + + + + '; } else $html .= '