From 761bc02fe3d87e9596920f7b53c2ca8e50b98af2 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 6 Jan 2020 11:11:28 +0800 Subject: [PATCH] Update index.php --- index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.php b/index.php index 99f480a..791fa9d 100644 --- a/index.php +++ b/index.php @@ -343,6 +343,7 @@ function adminoperate($path) $data = '{"name":"' . $_GET['rename_newname'] . '"}'; //echo $oldname; $result = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']); + $cache->save('path_' . $path1, json_decode('{}',true), 1); return output($result['body'], $result['stat']); } if ($_GET['delete_name']!='') { @@ -351,6 +352,7 @@ function adminoperate($path) $filename = path_format($path1 . '/' . $filename); //echo $filename; $result = MSAPI('DELETE', $filename, '', $_SERVER['access_token']); + $cache->save('path_' . $path1, json_decode('{}',true), 1); return output($result['body'], $result['stat']); } if ($_GET['operate_action']==$constStr['encrypt'][$constStr['language']]) { @@ -361,6 +363,7 @@ function adminoperate($path) $filename = path_format($path1 . '/' . $foldername . '/' . getConfig('passfile')); //echo $foldername; $result = MSAPI('PUT', $filename, $_GET['encrypt_newpass'], $_SERVER['access_token']); + $cache->save('path_' . $path1, json_decode('{}',true), 1); return output($result['body'], $result['stat']); } if ($_GET['move_folder']!='') { @@ -374,6 +377,10 @@ function adminoperate($path) $foldername = path_format('/'.urldecode($path1).'/'.$_GET['move_folder']); $data = '{"parentReference":{"path": "/drive/root:'.$foldername.'"}}'; $result = MSAPI('PATCH', $filename, $data, $_SERVER['access_token']); + $cache->save('path_' . $path1, json_decode('{}',true), 1); + if ($_GET['move_folder'] == '/../') $path2 = substr($path1, 0, strrpos($path1, '/')); + else $path2 = path_format( '/' . $path1 . '/' . $_GET['move_folder'] ); + $cache->save('path_' . $path2, json_decode('{}',true), 1); return output($result['body'], $result['stat']); } else { return output('{"error":"Can not Move!"}', 403); @@ -403,6 +410,7 @@ function adminoperate($path) $data = '{ "name": "' . $_GET['create_name'] . '", "folder": { }, "@microsoft.graph.conflictBehavior": "rename" }'; $result = MSAPI('children', $path1, $data, $_SERVER['access_token']); } + $cache->save('path_' . $path1, json_decode('{}',true), 1); return output($result['body'], $result['stat']); } return $tmparr;