Update index.php
parent
70a78a1f67
commit
a4a4326d08
33
index.php
33
index.php
|
@ -93,6 +93,8 @@ function main($path)
|
||||||
if ($_GET['action']=='del_upload_cache'&&substr($_GET['filename'],-4)=='.tmp') {
|
if ($_GET['action']=='del_upload_cache'&&substr($_GET['filename'],-4)=='.tmp') {
|
||||||
// del '.tmp' without login. 无需登录即可删除.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']);
|
$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']);
|
return output($tmp['body'],$tmp['stat']);
|
||||||
}
|
}
|
||||||
if ($_GET['action']=='uploaded_rename') {
|
if ($_GET['action']=='uploaded_rename') {
|
||||||
|
@ -106,6 +108,8 @@ function main($path)
|
||||||
//echo $oldname .'<br>'. $data;
|
//echo $oldname .'<br>'. $data;
|
||||||
$tmp = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']);
|
$tmp = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']);
|
||||||
if ($tmp['stat']==409) MSAPI('DELETE',$oldname,'',$_SERVER['access_token'])['body'];
|
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']);
|
return output($tmp['body'],$tmp['stat']);
|
||||||
}
|
}
|
||||||
if ($_GET['action']=='upbigfile') return bigfileupload($path);
|
if ($_GET['action']=='upbigfile') return bigfileupload($path);
|
||||||
|
@ -199,10 +203,12 @@ function EnvOpt($function_name, $needUpdate = 0)
|
||||||
global $constStr;
|
global $constStr;
|
||||||
$constEnv = [
|
$constEnv = [
|
||||||
//'admin',
|
//'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);
|
asort($constEnv);
|
||||||
$html = '<title>Heroku '.$constStr['Setup'][$constStr['language']].'</title>';
|
$html = '<title>OneManager '.$constStr['Setup'][$constStr['language']].'</title>';
|
||||||
/*if ($_POST['updateProgram']==$constStr['updateProgram'][$constStr['language']]) {
|
/*if ($_POST['updateProgram']==$constStr['updateProgram'][$constStr['language']]) {
|
||||||
$response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
|
$response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
|
||||||
if (isset($response['Error'])) {
|
if (isset($response['Error'])) {
|
||||||
|
@ -228,10 +234,8 @@ namespace:' . $namespace . '<br>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$response = setConfig($tmp);
|
$response = setConfig($tmp);
|
||||||
if (isset($response['id'])&&isset($response['message'])) {
|
if (!$response) {
|
||||||
$html = $response['id'] . '<br>
|
$html = $response . '<br>
|
||||||
' . $response['message'] . '<br><br>
|
|
||||||
function_name:' . $_SERVER['function_name'] . '<br>
|
|
||||||
<button onclick="location.href = location.href;">'.$constStr['Reflesh'][$constStr['language']].'</button>';
|
<button onclick="location.href = location.href;">'.$constStr['Reflesh'][$constStr['language']].'</button>';
|
||||||
$title = 'Error';
|
$title = 'Error';
|
||||||
} else {
|
} else {
|
||||||
|
@ -245,7 +249,7 @@ function_name:' . $_SERVER['function_name'] . '<br>
|
||||||
}
|
}
|
||||||
$html .= '
|
$html .= '
|
||||||
<a href="'.$preurl.'">'.$constStr['Back'][$constStr['language']].'</a>
|
<a href="'.$preurl.'">'.$constStr['Back'][$constStr['language']].'</a>
|
||||||
<a href="https://github.com/qkqpttgf/herokuOnedrive">Github</a><br>';
|
<a href="https://github.com/qkqpttgf/OneManager-php">Github</a><br>';
|
||||||
/*if ($needUpdate) {
|
/*if ($needUpdate) {
|
||||||
$html .= '<pre>' . $_SERVER['github_version'] . '</pre>
|
$html .= '<pre>' . $_SERVER['github_version'] . '</pre>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
|
@ -272,6 +276,21 @@ function_name:' . $_SERVER['function_name'] . '<br>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
} elseif ($key=='theme') {
|
||||||
|
$theme_arr = scandir('theme');
|
||||||
|
$html .= '
|
||||||
|
<tr>
|
||||||
|
<td><label>' . $key . '</label></td>
|
||||||
|
<td width=100%>
|
||||||
|
<select name="' . $key .'">';
|
||||||
|
foreach ($theme_arr as $v1) {
|
||||||
|
$html .= '
|
||||||
|
<option value="'.$v1.'" '.($v1==getConfig($key)?'selected="selected"':'').'>'.$v1.'</option>';
|
||||||
|
}
|
||||||
|
$html .= '
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
} else $html .= '
|
} else $html .= '
|
||||||
<tr>
|
<tr>
|
||||||
<td><label>' . $key . '</label></td>
|
<td><label>' . $key . '</label></td>
|
||||||
|
|
Loading…
Reference in New Issue