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(' +

' . $title . '

+ ' . $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 @@ + + + + + <?php echo $pretitle;?> - <?php echo $_SERVER['sitename'];?> + + + + + + + + + + +
+ + + +
  • + + +
    + +
    + +

    + +

    +1) { ?> +
    +
    +
    +
    +=strlen(path_format($_SERVER['base_path'].'/'.$disk))){ + if(substr($_SERVER['REQUEST_URI'],0,strlen(path_format($_SERVER['base_path'].'/'.$disk)))===path_format($_SERVER['base_path'].'/'.$disk)) + echo ''.$diskname.''; + else + echo ''.$diskname.''; + } + else + echo ''.$diskname.''; + + } ?> +
    +
    +
    +
    + +
    +
    +
    + + + + + +

    +
    +
    + +
    +
    + + +
    +
    +' . $files['error']['message'] . '
    '; + $statusCode=404; + } else { + if (isset($files['file'])) { +?> +
    +
    + +   +
    +
    +document.getElementById(\'url\').offsetWidth) this.style.width=\'100%\';" /> +'; + } elseif (in_array($ext, $exts['video'])) { + //echo ''; + $DPvideo=$files['@microsoft.graph.downloadUrl']; + echo '
    +'; + } elseif (in_array($ext, $exts['music'])) { + echo ' +'; + } elseif (in_array($ext, ['pdf'])) { + /*echo ' + +';*/ + $pdfurl = $files['@microsoft.graph.downloadUrl']; + echo '
    +'; + } elseif (in_array($ext, $exts['office'])) { + echo ' +'; + } elseif (in_array($ext, $exts['txt'])) { + $txtstr = htmlspecialchars(curl_request($files['@microsoft.graph.downloadUrl'])['body']); +?> +
    + +
    + +     + + + +'; ?> +
    + + +
    +'; + }*/ else { + echo ''.getconstStr('FileNotSupport').''; + } ?> +
    +
    + + + + + + + + + + + + + + +'; + foreach ($files['children'] as $file) { + // Files + if (isset($file['file'])) { + if ($_SERVER['admin'] or (substr($file['name'],0,1) !== '.' and $file['name'] !== getConfig('passfile') ) ) { + if (strtolower($file['name']) === 'head.md') $head = $file; + if (strtolower($file['name']) === 'readme.md') $readme = $file; + if (strtolower($file['name']) === 'index.html' && !$_SERVER['admin']) { + $html = curl_request(fetch_files(spurlencode(path_format($path . '/' .$file['name']),'/'))['@microsoft.graph.downloadUrl'])['body']; + return output($html,200); + } + $filenum++; ?> + + + + + + + +
       
    + +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • + + + +
    + +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • + + + + + + + + + + + + + + + + + + + + + + +
    +200) { + $pagenum = $files['folder']['page']; + $maxpage = ceil($files['folder']['childCount']/200); + $prepagenext = ' + + + + + + + + +
    '; + if ($pagenum!=1) { + $prepagenum = $pagenum-1; + $prepagenext .= ' + '.getconstStr('PrePage').''; + } + $prepagenext .= ' + '; + for ($page=1;$page<=$maxpage;$page++) { + if ($page == $pagenum) { + $prepagenext .= ' + ' . $page . ' '; + } else { + $prepagenext .= ' + ' . $page . ' '; + } + } + $prepagenext = substr($prepagenext,0,-1); + $prepagenext .= ' + '; + if ($pagenum!=$maxpage) { + $nextpagenum = $pagenum+1; + $prepagenext .= ' + '.getconstStr('NextPage').''; + } + $prepagenext .= ' +
    + '; + echo $prepagenext; + } + if ($_SERVER['admin']) { ?> +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    + + +
    +'; + } + if ($readme) { + echo ' +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +'; + } + } + } else { + echo ' +
    +
    +
    + + +
    +
    +
    '; + $statusCode = 401; + } + } ?> +
    +
    +
    + + + +
    + + + + + + +
    + + + +
    +
    Powred by 逸笙 | Theme by 若离
    + + + + + + + + + + From 1a7358672c9c9250e6e0bdf1184a598a49f04419 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 3 Mar 2020 15:17:38 +0800 Subject: [PATCH 3/4] try to fix encrypt cache --- function/common.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/function/common.php b/function/common.php index 7381c7d..effc37a 100644 --- a/function/common.php +++ b/function/common.php @@ -270,7 +270,8 @@ function encode_str_replace($str) function gethiddenpass($path,$passfile) { - $password=getcache('path_' . $path . '/?password'); + $path1 = path_format($_SERVER['list_path'] . path_format($path)); + $password = getcache('path_' . $path1 . '/?password'); if ($password=='') { $ispassfile = fetch_files(spurlencode(path_format($path . '/' . $passfile),'/')); //echo $path . '
    ' . 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']!='') {