From 2714815bb312308e881ccce72c289371e8053178 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 3 Mar 2020 13:27:18 +0800 Subject: [PATCH 1/4] Update common.php --- function/common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/function/common.php b/function/common.php index a753d46..7381c7d 100644 --- a/function/common.php +++ b/function/common.php @@ -348,12 +348,15 @@ function get_timezone($timezone = '8') function message($message, $title = 'Message', $statusCode = 200) { return output(' +
+ ' . $message . ' +
', $statusCode); @@ -482,6 +485,7 @@ function main($path) $constStr['language'] = $_COOKIE['language']; if ($constStr['language']=='') $constStr['language'] = getConfig('language'); if ($constStr['language']=='') $constStr['language'] = 'en-us'; + $_SERVER['language'] = $constStr['language']; $_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['base_disk_path'] = $_SERVER['base_path']; $disktags = explode("|",getConfig('disktag')); @@ -789,7 +793,7 @@ function adminoperate($path) return output($result['body'], $result['stat']); } if ($_GET['RefreshCache']) { - //savecache('path_' . $path1, json_decode('{}',true), 1); + savecache('path_' . $path1 . '/?password', '', 1); savecache('path_' . $path . '/?password', '', 1); return message('', getconstStr('RefreshCache'), 302); } From 46a8466b5725995e7619c407b99f002e4ce28520 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 3 Mar 2020 14:11:45 +0800 Subject: [PATCH 2/4] Create ruoli_violet.php --- theme/ruoli_violet.php | 1259 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1259 insertions(+) create mode 100644 theme/ruoli_violet.php diff --git a/theme/ruoli_violet.php b/theme/ruoli_violet.php new file mode 100644 index 0000000..ce71dfc --- /dev/null +++ b/theme/ruoli_violet.php @@ -0,0 +1,1259 @@ + + + + +' . json_encode($ispassfile, JSON_PRETTY_PRINT) . ''; @@ -280,14 +281,14 @@ function gethiddenpass($path,$passfile) $passwordf=explode("\n",$arr['body']); $password=$passwordf[0]; $password=md5($password); - savecache('path_' . $path . '/?password', $password); + savecache('path_' . $path1 . '/?password', $password); return $password; } else { //return md5('DefaultP@sswordWhenNetworkError'); return md5( md5(time()).rand(1000,9999) ); } } else { - savecache('path_' . $path . '/?password', 'null'); + savecache('path_' . $path1 . '/?password', 'null'); if ($path !== '' ) { $path = substr($path,0,strrpos($path,'/')); return gethiddenpass($path,$passfile); @@ -793,8 +794,8 @@ function adminoperate($path) return output($result['body'], $result['stat']); } if ($_GET['RefreshCache']) { + $path1 = path_format($_SERVER['list_path'] . path_format($path)); savecache('path_' . $path1 . '/?password', '', 1); - savecache('path_' . $path . '/?password', '', 1); return message('', getconstStr('RefreshCache'), 302); } return $tmparr; From 4aff58c777a959771c16a36da79a6de5ca68bd67 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 3 Mar 2020 17:45:33 +0800 Subject: [PATCH 4/4] 2nd try to fix encrypt cache --- function/common.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/function/common.php b/function/common.php index effc37a..8c50136 100644 --- a/function/common.php +++ b/function/common.php @@ -271,16 +271,16 @@ function encode_str_replace($str) function gethiddenpass($path,$passfile) { $path1 = path_format($_SERVER['list_path'] . path_format($path)); - $password = getcache('path_' . $path1 . '/?password'); + $password=getcache('path_' . $path1 . '/?password'); if ($password=='') { - $ispassfile = fetch_files(spurlencode(path_format($path . '/' . $passfile),'/')); + $ispassfile = fetch_files(path_format($path . '/' . urlencode($passfile))); //echo $path . '
' . json_encode($ispassfile, JSON_PRETTY_PRINT) . ''; if (isset($ispassfile['file'])) { $arr = curl_request($ispassfile['@microsoft.graph.downloadUrl']); if ($arr['stat']==200) { $passwordf=explode("\n",$arr['body']); $password=$passwordf[0]; - $password=md5($password); + if ($password!='') $password=md5($password); savecache('path_' . $path1 . '/?password', $password); return $password; } else { @@ -395,6 +395,7 @@ function passhidden($path) $path = str_replace('+','%2B',$path); $path = str_replace('&','&', path_format(urldecode($path))); if (getConfig('passfile') != '') { + $path = spurlencode($path,'/'); if (substr($path,-1)=='/') $path=substr($path,0,-1); $hiddenpass=gethiddenpass($path,getConfig('passfile')); if ($hiddenpass != '') { @@ -707,7 +708,8 @@ function adminoperate($path) $filename = path_format($path1 . '/' . $foldername . '/' . getConfig('passfile')); //echo $foldername; $result = MSAPI('PUT', $filename, $_GET['encrypt_newpass'], $_SERVER['access_token']); - //savecache('path_' . $path1, json_decode('{}',true), 1); + $path1 = path_format($path1 . '/' . $foldername ); + savecache('path_' . $path1 . '/?password', '', 1); return output($result['body'], $result['stat']); } if ($_GET['move_folder']!='') {