Update index.php

pull/13/head
qkqpttgf 2020-01-09 14:37:16 +08:00 committed by GitHub
parent 61978fac5f
commit f429da776e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -357,7 +357,7 @@ function adminoperate($path)
$data = '{"name":"' . $_GET['rename_newname'] . '"}'; $data = '{"name":"' . $_GET['rename_newname'] . '"}';
//echo $oldname; //echo $oldname;
$result = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']); $result = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']);
savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
return output($result['body'], $result['stat']); return output($result['body'], $result['stat']);
} }
if ($_GET['delete_name']!='') { if ($_GET['delete_name']!='') {
@ -366,7 +366,7 @@ function adminoperate($path)
$filename = path_format($path1 . '/' . $filename); $filename = path_format($path1 . '/' . $filename);
//echo $filename; //echo $filename;
$result = MSAPI('DELETE', $filename, '', $_SERVER['access_token']); $result = MSAPI('DELETE', $filename, '', $_SERVER['access_token']);
savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
return output($result['body'], $result['stat']); return output($result['body'], $result['stat']);
} }
if ($_GET['operate_action']==$constStr['encrypt'][$constStr['language']]) { if ($_GET['operate_action']==$constStr['encrypt'][$constStr['language']]) {
@ -377,7 +377,7 @@ function adminoperate($path)
$filename = path_format($path1 . '/' . $foldername . '/' . getConfig('passfile')); $filename = path_format($path1 . '/' . $foldername . '/' . getConfig('passfile'));
//echo $foldername; //echo $foldername;
$result = MSAPI('PUT', $filename, $_GET['encrypt_newpass'], $_SERVER['access_token']); $result = MSAPI('PUT', $filename, $_GET['encrypt_newpass'], $_SERVER['access_token']);
savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
return output($result['body'], $result['stat']); return output($result['body'], $result['stat']);
} }
if ($_GET['move_folder']!='') { if ($_GET['move_folder']!='') {
@ -391,7 +391,7 @@ function adminoperate($path)
$foldername = path_format('/'.urldecode($path1).'/'.$_GET['move_folder']); $foldername = path_format('/'.urldecode($path1).'/'.$_GET['move_folder']);
$data = '{"parentReference":{"path": "/drive/root:'.$foldername.'"}}'; $data = '{"parentReference":{"path": "/drive/root:'.$foldername.'"}}';
$result = MSAPI('PATCH', $filename, $data, $_SERVER['access_token']); $result = MSAPI('PATCH', $filename, $data, $_SERVER['access_token']);
savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
if ($_GET['move_folder'] == '/../') $path2 = path_format( substr($path1, 0, strrpos($path1, '/')) . '/' ); if ($_GET['move_folder'] == '/../') $path2 = path_format( substr($path1, 0, strrpos($path1, '/')) . '/' );
else $path2 = path_format( $path1 . '/' . $_GET['move_folder'] . '/' ); else $path2 = path_format( $path1 . '/' . $_GET['move_folder'] . '/' );
savecache('path_' . $path2, json_decode('{}',true), 1); savecache('path_' . $path2, json_decode('{}',true), 1);
@ -424,12 +424,12 @@ function adminoperate($path)
$data = '{ "name": "' . $_GET['create_name'] . '", "folder": { }, "@microsoft.graph.conflictBehavior": "rename" }'; $data = '{ "name": "' . $_GET['create_name'] . '", "folder": { }, "@microsoft.graph.conflictBehavior": "rename" }';
$result = MSAPI('children', $path1, $data, $_SERVER['access_token']); $result = MSAPI('children', $path1, $data, $_SERVER['access_token']);
} }
savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
return output($result['body'], $result['stat']); return output($result['body'], $result['stat']);
} }
if ($_GET['RefreshCache']) { if ($_GET['RefreshCache']) {
savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
return output('', 302, [ 'Location' => $_SERVER['PHP_SHELL'] ]); return output('<meta http-equiv="refresh" content="2;URL=./">', 302);
} }
return $tmparr; return $tmparr;
} }