Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
443348f822 | ||
|
|
bb943b8551 | ||
|
|
2a1b9af033 | ||
|
|
caa73378e1 | ||
|
|
0b6cb4ba66 | ||
|
|
09270d47cd | ||
|
|
52afcecb0d | ||
|
|
e9743c648f | ||
|
|
064da3da9c | ||
|
|
a1abd4d5ca | ||
|
|
0377867200 | ||
|
|
acb0ac3913 | ||
|
|
cf5aa37633 | ||
|
|
97735aec43 | ||
|
|
a244fb7ffb | ||
|
|
5051a05adf | ||
|
|
89daee97cf | ||
|
|
f1a6d2821e | ||
|
|
00023986b3 | ||
|
|
23ee2630ef | ||
|
|
8ca9a9d628 | ||
|
|
286046b82a | ||
|
|
a868d5df44 | ||
|
|
0a78999463 | ||
|
|
a6211d3382 | ||
|
|
2dc44a92d3 | ||
|
|
925ff9fe90 | ||
|
|
989de97dde | ||
|
|
0d9996c6c8 | ||
|
|
cd56380d39 | ||
|
|
6bd47b2a13 | ||
|
|
bd91e82552 |
+454
-299
File diff suppressed because it is too large
Load Diff
@@ -633,6 +633,10 @@ $constStr = [
|
||||
'ko-kr' => '중국 Onedrive',
|
||||
'fa' => 'Onedrive در چین',
|
||||
],
|
||||
'UseShareLink' => [
|
||||
'en-us' => 'Share a folder in Onedrive (enable EDIT for everyone), input the link url below.',
|
||||
'zh-cn' => '对一个Onedrive文件夹共享,允许所有人编辑,然后将共享链接填在下方',
|
||||
],
|
||||
'CustomIdSecret' => [
|
||||
'en-us' => 'Use custom client id & secret',
|
||||
'zh-cn' => '自己申请应用ID与机密',
|
||||
@@ -726,4 +730,12 @@ $constStr = [
|
||||
'ko-kr' => '캐시 플러시',
|
||||
'fa' => 'رفرش cache',
|
||||
],
|
||||
'VPSnotupdate' => [
|
||||
'en-us' => 'In VPS can not update by a click! run update.sh',
|
||||
'zh-cn' => '在VPS中不能一键更新,可以运行update.sh',
|
||||
],
|
||||
'QueryBranchs' => [
|
||||
'en-us' => 'Query Branchs',
|
||||
'zh-cn' => '查询分支',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
include 'vendor/autoload.php';
|
||||
include 'conststr.php';
|
||||
include 'function/common.php';
|
||||
include 'common.php';
|
||||
|
||||
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
||||
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||
include 'function/scf.php';
|
||||
include 'platform/scf.php';
|
||||
} elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') {
|
||||
include 'function/heroku.php';
|
||||
include 'platform/heroku.php';
|
||||
$path = getpath();
|
||||
//echo 'path:'. $path;
|
||||
$_GET = getGET();
|
||||
@@ -20,7 +20,7 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||
http_response_code($re['statusCode']);
|
||||
echo $re['body'];
|
||||
} else {
|
||||
include 'function/normal.php';
|
||||
include 'platform/normal.php';
|
||||
$path = getpath();
|
||||
//echo 'path:'. $path;
|
||||
$_GET = getGET();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function getpath()
|
||||
{
|
||||
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
|
||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
|
||||
$p = strpos($_SERVER['REQUEST_URI'],'?');
|
||||
@@ -106,6 +107,7 @@ function install()
|
||||
if ($_POST['admin']!='') {
|
||||
$tmp['admin'] = $_POST['admin'];
|
||||
$tmp['language'] = $_POST['language'];
|
||||
$tmp['timezone'] = $_COOKIE['timezone'];
|
||||
$APIKey = getConfig('APIKey');
|
||||
if ($APIKey=='') {
|
||||
$APIKey = $_POST['APIKey'];
|
||||
@@ -146,6 +148,12 @@ language:<br>';
|
||||
<input type="submit" value="'.getconstStr('Submit').'">
|
||||
</form>
|
||||
<script>
|
||||
var nowtime= new Date();
|
||||
var timezone = 0-nowtime.getTimezoneOffset()/60;
|
||||
var expd = new Date();
|
||||
expd.setTime(expd.getTime()+(2*60*60*1000));
|
||||
var expires = "expires="+expd.toGMTString();
|
||||
document.cookie="timezone="+timezone+"; path=/; "+expires;
|
||||
function changelanguage(str)
|
||||
{
|
||||
document.cookie=\'language=\'+str+\'; path=/\';
|
||||
@@ -219,9 +227,9 @@ function setHerokuConfig($env, $function_name, $apikey)
|
||||
return HerokuAPI('PATCH', 'https://api.heroku.com/apps/' . $function_name . '/config-vars', $data, $apikey);
|
||||
}
|
||||
|
||||
function updateHerokuapp($function_name, $apikey)
|
||||
function updateHerokuapp($function_name, $apikey, $source)
|
||||
{
|
||||
$tmp['source_blob']['url'] = 'https://github.com/qkqpttgf/OneManager-php/tarball/master/';
|
||||
$tmp['source_blob']['url'] = $source;
|
||||
$data = json_encode($tmp);
|
||||
return HerokuAPI('POST', 'https://api.heroku.com/apps/' . $function_name . '/builds', $data, $apikey);
|
||||
}
|
||||
@@ -239,9 +247,11 @@ function_name:' . $_SERVER['function_name'] . '<br>
|
||||
<button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>';
|
||||
}
|
||||
|
||||
function OnekeyUpate()
|
||||
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
|
||||
{
|
||||
return json_decode(updateHerokuapp(getConfig('function_name'), getConfig('APIKey'))['body'], true);
|
||||
//'https://github.com/qkqpttgf/OneManager-php/tarball/master/';
|
||||
$source = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . $branch . '/';
|
||||
return json_decode(updateHerokuapp(getConfig('function_name'), getConfig('APIKey'), $source)['body'], true);
|
||||
}
|
||||
|
||||
function setConfigResponse($response)
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function getpath()
|
||||
{
|
||||
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
|
||||
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
|
||||
$p = strpos($_SERVER['REQUEST_URI'],'?');
|
||||
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
|
||||
@@ -119,6 +120,7 @@ function install()
|
||||
if ($_POST['admin']!='') {
|
||||
$tmp['admin'] = $_POST['admin'];
|
||||
$tmp['language'] = $_COOKIE['language'];
|
||||
$tmp['timezone'] = $_COOKIE['timezone'];
|
||||
$response = setConfig($tmp);
|
||||
if (api_error($response)) {
|
||||
$html = api_error_msg($response);
|
||||
@@ -148,6 +150,12 @@ function install()
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
var nowtime= new Date();
|
||||
var timezone = 0-nowtime.getTimezoneOffset()/60;
|
||||
var expd = new Date();
|
||||
expd.setTime(expd.getTime()+(2*60*60*1000));
|
||||
var expires = "expires="+expd.toGMTString();
|
||||
document.cookie="timezone="+timezone+"; path=/; "+expires;
|
||||
function notnull(t)
|
||||
{
|
||||
if (t.admin.value==\'\') {
|
||||
@@ -28,6 +28,7 @@ function GetGlobalVariable($event)
|
||||
|
||||
function GetPathSetting($event, $context)
|
||||
{
|
||||
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($event['headers']['accept-language'],';')[0],',')[0]);
|
||||
$_SERVER['function_name'] = $context['function_name'];
|
||||
$_SERVER['namespace'] = $context['namespace'];
|
||||
$host_name = $event['headers']['host'];
|
||||
@@ -131,7 +132,7 @@ function install()
|
||||
$tmp['admin'] = $_POST['admin'];
|
||||
setConfig($tmp);
|
||||
if (needUpdate()) {
|
||||
updateProgram($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], $SecretId, $SecretKey);
|
||||
OnekeyUpate();
|
||||
return message('update to github version, reinstall.<script>document.cookie=\'language=; path=/\';</script><meta http-equiv="refresh" content="3;URL=' . $url . '">', 'Program updating', 201);
|
||||
}
|
||||
return output('Jump<script>document.cookie=\'language=; path=/\';</script><meta http-equiv="refresh" content="3;URL=' . path_format($_SERVER['base_path'] . '/') . '">', 302);
|
||||
@@ -140,6 +141,7 @@ function install()
|
||||
//if ($_POST['admin']!='') {
|
||||
$tmp['language'] = $_POST['language'];
|
||||
$tmp['Region'] = $_POST['Region'];
|
||||
$tmp['timezone'] = $_COOKIE['timezone'];
|
||||
$SecretId = getConfig('SecretId');
|
||||
if ($SecretId=='') {
|
||||
$SecretId = $_POST['SecretId'];
|
||||
@@ -207,6 +209,12 @@ language:<br>';
|
||||
<input type="submit" value="'.getconstStr('Submit').'">
|
||||
</form>
|
||||
<script>
|
||||
var nowtime= new Date();
|
||||
var timezone = 0-nowtime.getTimezoneOffset()/60;
|
||||
var expd = new Date();
|
||||
expd.setTime(expd.getTime()+(2*60*60*1000));
|
||||
var expires = "expires="+expd.toGMTString();
|
||||
document.cookie="timezone="+timezone+"; path=/; "+expires;
|
||||
function changelanguage(str)
|
||||
{
|
||||
document.cookie=\'language=\'+str+\'; path=/\';
|
||||
@@ -369,13 +377,14 @@ function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $S
|
||||
return post2url('https://'.$host, $data.'&Signature='.urlencode($signStr));
|
||||
}
|
||||
|
||||
function updateProgram($function_name, $Region, $Namespace, $SecretId, $SecretKey)
|
||||
function updateProgram($function_name, $Region, $Namespace, $SecretId, $SecretKey, $source)
|
||||
{
|
||||
WaitSCFStat();
|
||||
$meth = 'POST';
|
||||
$host = 'scf.tencentcloudapi.com';
|
||||
$tmpdata['Action'] = 'UpdateFunctionCode';
|
||||
$tmpdata['Code.GitUrl'] = 'https://github.com/qkqpttgf/OneManager-php';
|
||||
$tmpdata['Code.GitUrl'] = $source['url'];
|
||||
$tmpdata['Code.GitBranch'] = $source['branch'];
|
||||
$tmpdata['CodeSource'] = 'Git';
|
||||
$tmpdata['FunctionName'] = $function_name;
|
||||
$tmpdata['Handler'] = 'index.main_handler';
|
||||
@@ -407,9 +416,11 @@ namespace:' . $_SERVER['namespace'] . '<br>
|
||||
<button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>';
|
||||
}
|
||||
|
||||
function OnekeyUpate()
|
||||
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
|
||||
{
|
||||
return json_decode(updateProgram($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey')), true)['Response'];
|
||||
$source['url'] = 'https://github.com/' . $auth . '/' . $project;
|
||||
$source['branch'] = $branch;
|
||||
return json_decode(updateProgram($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey'), $source), true)['Response'];
|
||||
}
|
||||
|
||||
function setConfigResponse($response)
|
||||
@@ -49,5 +49,5 @@ If there is 'index.html' file, program will only show the content of 'index.html
|
||||
Click 'EditTime' or 'Size', the list will sort by time or size, Click 'File' can resume sort.
|
||||
点击“时间”、“大小”,可以排序显示,点“文件”恢复原样。
|
||||
|
||||
QQ Group: 943919989
|
||||
QQ Group: 943919989 (请看完上面的中英双语再加群,谢谢!)
|
||||
Telegram Group: https://t.me/joinchat/I_RVc0bqxuxlT-d0cO7ozw
|
||||
|
||||
+14
-13
@@ -6,7 +6,8 @@
|
||||
<meta charset=utf-8>
|
||||
<meta http-equiv=X-UA-Compatible content="IE=edge">
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
<meta name="keywords" content="<?php echo $n_path;?>,<?php if ($p_path!='') echo $p_path.','; echo $_SERVER['sitename'];?>,OneManager,auth_by_逸笙">
|
||||
<meta name="keywords" content="<?php echo $n_path;?>,<?php if ($p_path!='') echo $p_path.','; echo $_SERVER['sitename'];?>">
|
||||
<meta name="description" content="<?php if ($_GET['preview']) echo 'Preview of '.$n_path; else echo 'List of '.$n_path; ?>. OneManager(An index & manager of Onedrive auth by ysun).">
|
||||
<link rel="icon" href="<?php echo $_SERVER['base_disk_path'];?>favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="<?php echo $_SERVER['base_disk_path'];?>favicon.ico" type="image/x-icon" />
|
||||
<style type="text/css">
|
||||
@@ -166,33 +167,33 @@
|
||||
<div style="margin: 12px 4px 4px; text-align: center">
|
||||
<div style="margin: 24px">
|
||||
<textarea id="url" title="url" rows="1" style="width: 100%; margin-top: 2px;" readonly><?php echo str_replace('%2523', '%23', str_replace('%26amp%3B','&',spurlencode(path_format($_SERVER['base_disk_path'] . '/' . $path), '/'))); ?></textarea>
|
||||
<a href="<?php echo path_format($_SERVER['base_disk_path'] . '/' . $path);//$files['@microsoft.graph.downloadUrl'] ?>"><ion-icon name="download" style="line-height: 16px;vertical-align: middle;"></ion-icon> <?php echo getconstStr('Download'); ?></a>
|
||||
<a href="<?php echo path_format($_SERVER['base_disk_path'] . '/' . $path);//$files[$_SERVER['DownurlStrName']] ?>"><ion-icon name="download" style="line-height: 16px;vertical-align: middle;"></ion-icon> <?php echo getconstStr('Download'); ?></a>
|
||||
</div>
|
||||
<div style="margin: 24px">
|
||||
<?php $ext = strtolower(substr($path, strrpos($path, '.') + 1));
|
||||
if (in_array($ext, $exts['img'])) {
|
||||
echo ' <img src="' . $files['@microsoft.graph.downloadUrl'] . '" alt="' . substr($path, strrpos($path, '/')) . '" onload="if(this.offsetWidth>document.getElementById(\'url\').offsetWidth) this.style.width=\'100%\';" />
|
||||
echo ' <img src="' . $files[$_SERVER['DownurlStrName']] . '" alt="' . substr($path, strrpos($path, '/')) . '" onload="if(this.offsetWidth>document.getElementById(\'url\').offsetWidth) this.style.width=\'100%\';" />
|
||||
';
|
||||
} elseif (in_array($ext, $exts['video'])) {
|
||||
//echo '<video src="' . $files['@microsoft.graph.downloadUrl'] . '" controls="controls" style="width: 100%"></video>';
|
||||
$DPvideo=$files['@microsoft.graph.downloadUrl'];
|
||||
//echo '<video src="' . $files[$_SERVER['DownurlStrName']] . '" controls="controls" style="width: 100%"></video>';
|
||||
$DPvideo=$files[$_SERVER['DownurlStrName']];
|
||||
echo ' <div id="video-a0"></div>
|
||||
';
|
||||
} elseif (in_array($ext, $exts['music'])) {
|
||||
echo ' <audio src="' . $files['@microsoft.graph.downloadUrl'] . '" controls="controls" style="width: 100%"></audio>
|
||||
echo ' <audio src="' . $files[$_SERVER['DownurlStrName']] . '" controls="controls" style="width: 100%"></audio>
|
||||
';
|
||||
} elseif (in_array($ext, ['pdf'])) {
|
||||
/*echo '
|
||||
<embed src="' . $files['@microsoft.graph.downloadUrl'] . '" type="application/pdf" width="100%" height=800px">
|
||||
<embed src="' . $files[$_SERVER['DownurlStrName']] . '" type="application/pdf" width="100%" height=800px">
|
||||
';*/
|
||||
$pdfurl = $files['@microsoft.graph.downloadUrl'];
|
||||
$pdfurl = $files[$_SERVER['DownurlStrName']];
|
||||
echo ' <div id="pdf-d"></div>
|
||||
';
|
||||
} elseif (in_array($ext, $exts['office'])) {
|
||||
echo ' <iframe id="office-a" src="https://view.officeapps.live.com/op/view.aspx?src=' . urlencode($files['@microsoft.graph.downloadUrl']) . '" style="width: 100%;height: 800px" frameborder="0"></iframe>
|
||||
echo ' <iframe id="office-a" src="https://view.officeapps.live.com/op/view.aspx?src=' . urlencode($files[$_SERVER['DownurlStrName']]) . '" style="width: 100%;height: 800px" frameborder="0"></iframe>
|
||||
';
|
||||
} elseif (in_array($ext, $exts['txt'])) {
|
||||
$txtstr = htmlspecialchars(curl_request($files['@microsoft.graph.downloadUrl'])['body']);
|
||||
$txtstr = htmlspecialchars(curl_request($files[$_SERVER['DownurlStrName']])['body']);
|
||||
?>
|
||||
<div id="txt">
|
||||
<?php if ($_SERVER['admin']) { ?>
|
||||
@@ -206,7 +207,7 @@
|
||||
</div>
|
||||
<?php } /*elseif (in_array($ext, ['md'])) {
|
||||
echo ' <div class="markdown-body" id="readme">
|
||||
<textarea id="readme-md" style="display:none;">' . curl_request($files['@microsoft.graph.downloadUrl'])['body'] . '</textarea>
|
||||
<textarea id="readme-md" style="display:none;">' . curl_request($files[$_SERVER['DownurlStrName']])['body'] . '</textarea>
|
||||
</div>
|
||||
';
|
||||
}*/ else {
|
||||
@@ -705,7 +706,7 @@
|
||||
tmptextarea.select();
|
||||
tmptextarea.setSelectionRange(0, tmptextarea.value.length);
|
||||
document.execCommand("copy");
|
||||
alert(tmptextarea.innerHTML+'<?php echo getconstStr('Success'); ?>');
|
||||
alert(tmptextarea.innerHTML+"<?php echo getconstStr('Success');?>");
|
||||
}
|
||||
var sort=0;
|
||||
function sortby(string) {
|
||||
@@ -801,7 +802,7 @@
|
||||
expd.setTime(expd.getTime()+(2*60*60*1000));
|
||||
var expires = "expires="+expd.toGMTString();
|
||||
document.cookie="timezone="+timezone+"; path=/; "+expires;
|
||||
if (timezone!='8') {
|
||||
if (timezone!=<?php echo $_SERVER['timezone']; ?>) {
|
||||
alert('Your timezone is '+timezone+', reload local timezone.');
|
||||
location.href=location.protocol + "//" + location.host + "<?php echo path_format($_SERVER['base_path'] . '/' . $path );?>" ;
|
||||
}
|
||||
|
||||
+13
-13
File diff suppressed because one or more lines are too long
+1263
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,68 @@
|
||||
#!bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "
|
||||
"$0" -i|u [-b branch]
|
||||
i a new install with empty config.
|
||||
u update use exist config.
|
||||
b install the branch after parameter b, default master
|
||||
|
||||
example:
|
||||
"$0" -i
|
||||
"$0" -u
|
||||
"$0" -b master
|
||||
"$0" -r -b master
|
||||
"$0" -ib test
|
||||
"
|
||||
# exit
|
||||
echo "###############
|
||||
0, new install
|
||||
1, update"
|
||||
read -p "Input:" c
|
||||
[ g"$c" == g"0" ] && install=1
|
||||
[ g"$c" == g"1" ] && update=1
|
||||
fi
|
||||
|
||||
i=0
|
||||
para[$i]=$0
|
||||
for av in "$@"
|
||||
do
|
||||
#echo $av
|
||||
((i++))
|
||||
para[$i]=$av
|
||||
if [ g"${av:0:1}" == g"-" ]; then
|
||||
while [ g"$av" != g"" ]
|
||||
do
|
||||
ag=${av:0:1}
|
||||
av=${av:1}
|
||||
[ g"$ag" == g"b" ] && isbranch=1
|
||||
[ g"$ag" == g"i" ] && install=1
|
||||
[ g"$ag" == g"u" ] && update=1
|
||||
done
|
||||
else
|
||||
if [ g"$isbranch" == g"1" ]; then
|
||||
branch="-b $av"
|
||||
isbranch=0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ g"$install" == g"1" -a g"$update" == g"1" ]; then
|
||||
echo "Both install & update, exit"
|
||||
exit
|
||||
fi
|
||||
if [ g"$install" != g"1" -a g"$update" != g"1" ]; then
|
||||
echo "Not install & Not update, exit"
|
||||
exit
|
||||
fi
|
||||
|
||||
gitsource='https://github.com/qkqpttgf/OneManager-php'
|
||||
|
||||
OneManagerPath=`cd $(dirname $0);pwd -P`
|
||||
cd ${OneManagerPath}
|
||||
|
||||
git clone ${gitsource}
|
||||
\mv -b config.php OneManager-php/
|
||||
git clone ${branch} ${gitsource}
|
||||
[ g"$install" == g"1" ] || \mv -b config.php OneManager-php/
|
||||
\mv -b OneManager-php/* ./
|
||||
\mv -b OneManager-php/.[^.]* ./
|
||||
rm -rf *~
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
20200402-1830.17
|
||||
Oneclick update can select which branch to update. Now use the accept language instead of the language config.
|
||||
一键更新可以选择哪个分支了。现在开始使用浏览器语言,抛弃language设置。
|
||||
|
||||
20200326-0001.16
|
||||
You can add sharepoint site drive as a disk, <font color=red>you must reinstall after update</font>.
|
||||
可以将sharepoint网站添加成一个盘,<font color=red>由于结构改变,升级后只能重装</font>。
|
||||
|
||||
20200321-1830.15
|
||||
本次更新后,'index.html'功能在其它主题会导致bug。
|
||||
文本类文件将缓存;添加hideFunctionalityFile开关;在添加网盘时会显示已经在用的标签。
|
||||
|
||||
Reference in New Issue
Block a user