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 | ||
|
|
01ff467b07 | ||
|
|
da012e8009 | ||
|
|
37462b5e9a | ||
|
|
0cfccddc4d | ||
|
|
3b2251fe82 | ||
|
|
69f74da711 | ||
|
|
5c42aef340 | ||
|
|
0fb6614332 | ||
|
|
858fa2811a | ||
|
|
d4d5895455 | ||
|
|
09553fff82 | ||
|
|
0452f7f278 | ||
|
|
9383978499 | ||
|
|
aa15da3ffb |
+534
-305
File diff suppressed because it is too large
Load Diff
+37
-20
@@ -70,7 +70,7 @@ $constStr = [
|
|||||||
'diskname' => 'The disk name you want show.',
|
'diskname' => 'The disk name you want show.',
|
||||||
'disktag' => 'A tag used in store config and url.',
|
'disktag' => 'A tag used in store config and url.',
|
||||||
'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password',
|
'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password',
|
||||||
'background' => 'Set an url as background photo, or put a \'background.jpg\' at showed path.',
|
'background' => 'Set an url as background photo.',
|
||||||
'guestup_path' => 'Set guest upload dir, before set this, the files in this dir will show as normal.',
|
'guestup_path' => 'Set guest upload dir, before set this, the files in this dir will show as normal.',
|
||||||
'hideFunctionalityFile' => '0 or 1. if 1, some file will not show in list to guest, like readme.md',
|
'hideFunctionalityFile' => '0 or 1. if 1, some file will not show in list to guest, like readme.md',
|
||||||
'passfile' => 'The password of dir will save in this file.',
|
'passfile' => 'The password of dir will save in this file.',
|
||||||
@@ -85,7 +85,7 @@ $constStr = [
|
|||||||
'diskname' => '这个盘你想显示什么名称。',
|
'diskname' => '这个盘你想显示什么名称。',
|
||||||
'disktag' => '一个标签,用于保存配置,多盘时会显示在url中。',
|
'disktag' => '一个标签,用于保存配置,多盘时会显示在url中。',
|
||||||
'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。',
|
'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。',
|
||||||
'background' => '设置一个url作为背景,或者在你显示的目录放一个background.jpg文件。',
|
'background' => '设置一个url作为背景。',
|
||||||
'guestup_path' => '设置游客上传路径(图床路径),不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
|
'guestup_path' => '设置游客上传路径(图床路径),不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
|
||||||
'hideFunctionalityFile' => '0 或 1。如果 1, 某些文件不列表给游客看,但它的功能正常,比如readme.md',
|
'hideFunctionalityFile' => '0 或 1。如果 1, 某些文件不列表给游客看,但它的功能正常,比如readme.md',
|
||||||
'passfile' => '自定义密码文件的名字,可以是\'pppppp\',也可以是\'aaaa.txt\'等等;列目录时不会显示,只有知道密码才能查看或下载此文件。密码是这个文件的内容,可以空格、可以中文;',
|
'passfile' => '自定义密码文件的名字,可以是\'pppppp\',也可以是\'aaaa.txt\'等等;列目录时不会显示,只有知道密码才能查看或下载此文件。密码是这个文件的内容,可以空格、可以中文;',
|
||||||
@@ -114,7 +114,7 @@ $constStr = [
|
|||||||
'diskname' => '이 디스크에 어떤 이름을 표시 하시겠습니까?',
|
'diskname' => '이 디스크에 어떤 이름을 표시 하시겠습니까?',
|
||||||
'disktag' => '레이블은 구성을 저장하는 데 사용되며 디스크가 여러 개인 경우 URL에 표시됩니다.',
|
'disktag' => '레이블은 구성을 저장하는 데 사용되며 디스크가 여러 개인 경우 URL에 표시됩니다.',
|
||||||
'downloadencrypt' => '',
|
'downloadencrypt' => '',
|
||||||
'background' => 'URL을 배경으로 설정하거나 표시하는 디렉토리에 background.jpg 파일을 넣으십시오.',
|
'background' => 'URL을 배경으로 설정하거나 표시하는.',
|
||||||
'guestup_path' => '방문자의 업로드 경로 (맵 베드 경로)를 설정합니다.이 값을 설정하지 않으면 디렉토리의 내용이 파일로 표시되고 설정 후에는 업로드 인터페이스 만 표시되고 파일은 표시되지 않습니다 (로그인 후 표시).',
|
'guestup_path' => '방문자의 업로드 경로 (맵 베드 경로)를 설정합니다.이 값을 설정하지 않으면 디렉토리의 내용이 파일로 표시되고 설정 후에는 업로드 인터페이스 만 표시되고 파일은 표시되지 않습니다 (로그인 후 표시).',
|
||||||
'passfile' => '사용자 정의 비밀번호 파일의 이름은 \'pppppp\' \'aaaa.txt \'등이 될 수 있으며 디렉토리가 나열되어 있으면 표시되지 않으며 비밀번호를 알고있는 경우에만이 파일을 보거나 다운로드 할 수 있습니다. 암호는이 파일의 내용이며 공백이거나 한국어 일 수 있습니다.',
|
'passfile' => '사용자 정의 비밀번호 파일의 이름은 \'pppppp\' \'aaaa.txt \'등이 될 수 있으며 디렉토리가 나열되어 있으면 표시되지 않으며 비밀번호를 알고있는 경우에만이 파일을 보거나 다운로드 할 수 있습니다. 암호는이 파일의 내용이며 공백이거나 한국어 일 수 있습니다.',
|
||||||
'public_path' => 'API 긴 링크 액세스를 사용하는 경우 네트워크 디스크 파일의 경로가 표시됩니다. 설정되지 않은 경우 기본적으로 루트 디렉토리로 설정됩니다.',
|
'public_path' => 'API 긴 링크 액세스를 사용하는 경우 네트워크 디스크 파일의 경로가 표시됩니다. 설정되지 않은 경우 기본적으로 루트 디렉토리로 설정됩니다.',
|
||||||
@@ -572,10 +572,6 @@ $constStr = [
|
|||||||
],
|
],
|
||||||
'defaultSitename' => [
|
'defaultSitename' => [
|
||||||
'en-us' => 'OneManager',
|
'en-us' => 'OneManager',
|
||||||
'zh-cn' => 'OneManager',
|
|
||||||
'ja' => 'OneManager',
|
|
||||||
'ko-kr' => 'OneManager',
|
|
||||||
'fa' => 'OneManager',
|
|
||||||
],
|
],
|
||||||
'SavingToken' => [
|
'SavingToken' => [
|
||||||
'en-us' => 'Saving refresh_token!',
|
'en-us' => 'Saving refresh_token!',
|
||||||
@@ -626,33 +622,46 @@ $constStr = [
|
|||||||
'ko-kr' => 'Onedrive 표시 이름',
|
'ko-kr' => 'Onedrive 표시 이름',
|
||||||
'fa' => 'نام نشان داده شده Onedrive',
|
'fa' => 'نام نشان داده شده Onedrive',
|
||||||
],
|
],
|
||||||
'OndriveVerMS' => [
|
'DriveVerMS' => [
|
||||||
'en-us' => 'default(Onedrive, Onedrive for business)',
|
'en-us' => 'Onedrive, Onedrive for business',
|
||||||
'zh-cn' => '默认(支持商业版与个人版)',
|
'zh-cn' => '国际版(商业版与个人版)',
|
||||||
'ja' => 'デフォルト(商用版および個人版をサポート)',
|
|
||||||
'ko-kr' => '기본 (상업용 및 개인용 버전 지원)',
|
|
||||||
'fa' => 'پیش فرض(Onedrive, Onedrive for business)',
|
|
||||||
],
|
],
|
||||||
'OndriveVerCN' => [
|
'DriveVerCN' => [
|
||||||
'en-us' => 'Onedrive in China',
|
'en-us' => 'Onedrive in China',
|
||||||
'zh-cn' => '世纪互联版',
|
'zh-cn' => '世纪互联版',
|
||||||
'ja' => '中国のOnedrive',
|
'ja' => '中国のOnedrive',
|
||||||
'ko-kr' => '중국 Onedrive',
|
'ko-kr' => '중국 Onedrive',
|
||||||
'fa' => 'Onedrive در چین',
|
'fa' => 'Onedrive در چین',
|
||||||
],
|
],
|
||||||
'OndriveVerMSC' =>[
|
'UseShareLink' => [
|
||||||
'en-us' => 'default but use customer app id & secret',
|
'en-us' => 'Share a folder in Onedrive (enable EDIT for everyone), input the link url below.',
|
||||||
'zh-cn' => '国际版,自己申请应用ID与机密',
|
'zh-cn' => '对一个Onedrive文件夹共享,允许所有人编辑,然后将共享链接填在下方',
|
||||||
'ja' => '国際版、アプリケーションIDとシークレットを自分で申請する',
|
],
|
||||||
'ko-kr' => '국제 버전, 응용 프로그램 ID 및 비밀 신청',
|
'CustomIdSecret' => [
|
||||||
|
'en-us' => 'Use custom client id & secret',
|
||||||
|
'zh-cn' => '自己申请应用ID与机密',
|
||||||
|
'ja' => 'アプリケーションIDとシークレットを自分で申請する',
|
||||||
|
'ko-kr' => '응용 프로그램 ID 및 비밀 신청',
|
||||||
'fa' => 'به طور پیش فرض اما از شناسه برنامه و سکرت استفاده کنید',
|
'fa' => 'به طور پیش فرض اما از شناسه برنامه و سکرت استفاده کنید',
|
||||||
],
|
],
|
||||||
'GetSecretIDandKEY' => [
|
'GetSecretIDandKEY' => [
|
||||||
'en-us' => 'Get customer app id & secret',
|
'en-us' => 'Get custom client id & secret',
|
||||||
'zh-cn' => '申请应用ID与机密',
|
'zh-cn' => '申请应用ID与机密',
|
||||||
'ja' => 'アプリケーションIDとシークレット',
|
'ja' => 'アプリケーションIDとシークレット',
|
||||||
'fa' => 'دریافت شناسه برنامه و سکرت',
|
'fa' => 'دریافت شناسه برنامه و سکرت',
|
||||||
],
|
],
|
||||||
|
'UseSharepointInstead' => [
|
||||||
|
'en-us' => 'Use space in Sharepoint website instead of Onedrive',
|
||||||
|
'zh-cn' => '使用Sharepoint网站的空间,不使用Onedrive',
|
||||||
|
],
|
||||||
|
'GetSharepointName' => [
|
||||||
|
'en-us' => 'Login office.com and click the SharePoint, create a website or find an exist website, input the name below',
|
||||||
|
'zh-cn' => '登录office.com,点击Sharepoint,创建一个网站或使用原有网站,然后将它的名字填在下方',
|
||||||
|
],
|
||||||
|
'InputSharepointName' => [
|
||||||
|
'en-us' => 'Input the name of Sharepoint website',
|
||||||
|
'zh-cn' => '输入Sharepoint网站的名称',
|
||||||
|
],
|
||||||
'TagFormatAlert' => [
|
'TagFormatAlert' => [
|
||||||
'en-us' => 'Tag must start with a letter, end with a letter or digit and can only contain lowercase letters, digits, and dashes, at least 2 letters!',
|
'en-us' => 'Tag must start with a letter, end with a letter or digit and can only contain lowercase letters, digits, and dashes, at least 2 letters!',
|
||||||
'zh-cn' => '标签只能以字母开头,以字母或数字结尾,至少2位',
|
'zh-cn' => '标签只能以字母开头,以字母或数字结尾,至少2位',
|
||||||
@@ -721,4 +730,12 @@ $constStr = [
|
|||||||
'ko-kr' => '캐시 플러시',
|
'ko-kr' => '캐시 플러시',
|
||||||
'fa' => 'رفرش cache',
|
'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
|
<?php
|
||||||
include 'vendor/autoload.php';
|
include 'vendor/autoload.php';
|
||||||
include 'conststr.php';
|
include 'conststr.php';
|
||||||
include 'function/common.php';
|
include 'common.php';
|
||||||
|
|
||||||
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
||||||
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
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') {
|
} elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') {
|
||||||
include 'function/heroku.php';
|
include 'platform/heroku.php';
|
||||||
$path = getpath();
|
$path = getpath();
|
||||||
//echo 'path:'. $path;
|
//echo 'path:'. $path;
|
||||||
$_GET = getGET();
|
$_GET = getGET();
|
||||||
@@ -20,7 +20,7 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
|||||||
http_response_code($re['statusCode']);
|
http_response_code($re['statusCode']);
|
||||||
echo $re['body'];
|
echo $re['body'];
|
||||||
} else {
|
} else {
|
||||||
include 'function/normal.php';
|
include 'platform/normal.php';
|
||||||
$path = getpath();
|
$path = getpath();
|
||||||
//echo 'path:'. $path;
|
//echo 'path:'. $path;
|
||||||
$_GET = getGET();
|
$_GET = getGET();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
function getpath()
|
function getpath()
|
||||||
{
|
{
|
||||||
|
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
|
||||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
|
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
|
||||||
$p = strpos($_SERVER['REQUEST_URI'],'?');
|
$p = strpos($_SERVER['REQUEST_URI'],'?');
|
||||||
@@ -106,6 +107,7 @@ function install()
|
|||||||
if ($_POST['admin']!='') {
|
if ($_POST['admin']!='') {
|
||||||
$tmp['admin'] = $_POST['admin'];
|
$tmp['admin'] = $_POST['admin'];
|
||||||
$tmp['language'] = $_POST['language'];
|
$tmp['language'] = $_POST['language'];
|
||||||
|
$tmp['timezone'] = $_COOKIE['timezone'];
|
||||||
$APIKey = getConfig('APIKey');
|
$APIKey = getConfig('APIKey');
|
||||||
if ($APIKey=='') {
|
if ($APIKey=='') {
|
||||||
$APIKey = $_POST['APIKey'];
|
$APIKey = $_POST['APIKey'];
|
||||||
@@ -146,6 +148,12 @@ language:<br>';
|
|||||||
<input type="submit" value="'.getconstStr('Submit').'">
|
<input type="submit" value="'.getconstStr('Submit').'">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<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)
|
function changelanguage(str)
|
||||||
{
|
{
|
||||||
document.cookie=\'language=\'+str+\'; path=/\';
|
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);
|
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);
|
$data = json_encode($tmp);
|
||||||
return HerokuAPI('POST', 'https://api.heroku.com/apps/' . $function_name . '/builds', $data, $apikey);
|
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>';
|
<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)
|
function setConfigResponse($response)
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
function getpath()
|
function getpath()
|
||||||
{
|
{
|
||||||
|
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
|
||||||
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
|
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
|
||||||
$p = strpos($_SERVER['REQUEST_URI'],'?');
|
$p = strpos($_SERVER['REQUEST_URI'],'?');
|
||||||
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
|
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
|
||||||
@@ -118,7 +119,8 @@ function install()
|
|||||||
if ($_GET['install2']) {
|
if ($_GET['install2']) {
|
||||||
if ($_POST['admin']!='') {
|
if ($_POST['admin']!='') {
|
||||||
$tmp['admin'] = $_POST['admin'];
|
$tmp['admin'] = $_POST['admin'];
|
||||||
$tmp['language'] = $_POST['language'];
|
$tmp['language'] = $_COOKIE['language'];
|
||||||
|
$tmp['timezone'] = $_COOKIE['timezone'];
|
||||||
$response = setConfig($tmp);
|
$response = setConfig($tmp);
|
||||||
if (api_error($response)) {
|
if (api_error($response)) {
|
||||||
$html = api_error_msg($response);
|
$html = api_error_msg($response);
|
||||||
@@ -148,6 +150,12 @@ function install()
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<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)
|
function notnull(t)
|
||||||
{
|
{
|
||||||
if (t.admin.value==\'\') {
|
if (t.admin.value==\'\') {
|
||||||
@@ -28,6 +28,7 @@ function GetGlobalVariable($event)
|
|||||||
|
|
||||||
function GetPathSetting($event, $context)
|
function GetPathSetting($event, $context)
|
||||||
{
|
{
|
||||||
|
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($event['headers']['accept-language'],';')[0],',')[0]);
|
||||||
$_SERVER['function_name'] = $context['function_name'];
|
$_SERVER['function_name'] = $context['function_name'];
|
||||||
$_SERVER['namespace'] = $context['namespace'];
|
$_SERVER['namespace'] = $context['namespace'];
|
||||||
$host_name = $event['headers']['host'];
|
$host_name = $event['headers']['host'];
|
||||||
@@ -131,7 +132,7 @@ function install()
|
|||||||
$tmp['admin'] = $_POST['admin'];
|
$tmp['admin'] = $_POST['admin'];
|
||||||
setConfig($tmp);
|
setConfig($tmp);
|
||||||
if (needUpdate()) {
|
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 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);
|
return output('Jump<script>document.cookie=\'language=; path=/\';</script><meta http-equiv="refresh" content="3;URL=' . path_format($_SERVER['base_path'] . '/') . '">', 302);
|
||||||
@@ -139,6 +140,8 @@ function install()
|
|||||||
if ($_GET['install1']) {
|
if ($_GET['install1']) {
|
||||||
//if ($_POST['admin']!='') {
|
//if ($_POST['admin']!='') {
|
||||||
$tmp['language'] = $_POST['language'];
|
$tmp['language'] = $_POST['language'];
|
||||||
|
$tmp['Region'] = $_POST['Region'];
|
||||||
|
$tmp['timezone'] = $_COOKIE['timezone'];
|
||||||
$SecretId = getConfig('SecretId');
|
$SecretId = getConfig('SecretId');
|
||||||
if ($SecretId=='') {
|
if ($SecretId=='') {
|
||||||
$SecretId = $_POST['SecretId'];
|
$SecretId = $_POST['SecretId'];
|
||||||
@@ -149,11 +152,9 @@ function install()
|
|||||||
$SecretKey = $_POST['SecretKey'];
|
$SecretKey = $_POST['SecretKey'];
|
||||||
$tmp['SecretKey'] = $SecretKey;
|
$tmp['SecretKey'] = $SecretKey;
|
||||||
}
|
}
|
||||||
$response = json_decode(SetbaseConfig($tmp, $_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], $SecretId, $SecretKey), true)['Response'];
|
$response = json_decode(SetbaseConfig($tmp, $_SERVER['function_name'], $_POST['Region'], $_SERVER['namespace'], $SecretId, $SecretKey), true)['Response'];
|
||||||
if (api_error($response)) {
|
if (api_error($response)) {
|
||||||
$html = api_error_msg($response);
|
$html = api_error_msg($response);
|
||||||
$html .= '<br>
|
|
||||||
<button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>';
|
|
||||||
$title = 'Error';
|
$title = 'Error';
|
||||||
return message($html, $title, 201);
|
return message($html, $title, 201);
|
||||||
} else {
|
} else {
|
||||||
@@ -190,9 +191,30 @@ language:<br>';
|
|||||||
<label>SecretId:<input name="SecretId" type="text" placeholder="" size=""></label><br>
|
<label>SecretId:<input name="SecretId" type="text" placeholder="" size=""></label><br>
|
||||||
<label>SecretKey:<input name="SecretKey" type="text" placeholder="" size=""></label><br>';
|
<label>SecretKey:<input name="SecretKey" type="text" placeholder="" size=""></label><br>';
|
||||||
$html .= '
|
$html .= '
|
||||||
|
<select class="changelanguage" name="Region">
|
||||||
|
<option value="">选择区域</option>
|
||||||
|
<option value="ap-beijing">华北地区(北京)</option>
|
||||||
|
<option value="ap-chengdu">西南地区(成都)</option>
|
||||||
|
<option value="ap-guangzhou">华南地区(广州)</option>
|
||||||
|
<option value="ap-guangzhou-open">华南地区(广州Open)</option>
|
||||||
|
<option value="ap-hongkong">港澳台地区(中国香港)</option>
|
||||||
|
<option value="ap-mumbai">亚太南部(孟买)</option>
|
||||||
|
<option value="ap-shanghai">华东地区(上海)</option>
|
||||||
|
<option value="ap-shanghai-fsi">华东地区(上海金融)</option>
|
||||||
|
<option value="ap-singapore">亚太东南(新加坡)</option>
|
||||||
|
<option value="ap-tokyo">亚太东北(东京)</option>
|
||||||
|
<option value="na-siliconvalley">美国西部(硅谷)</option>
|
||||||
|
<option value="na-toronto">北美地区(多伦多)</option>
|
||||||
|
</select>(腾讯几个月了还不做出来,只能先弄选择了)<br>
|
||||||
<input type="submit" value="'.getconstStr('Submit').'">
|
<input type="submit" value="'.getconstStr('Submit').'">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<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)
|
function changelanguage(str)
|
||||||
{
|
{
|
||||||
document.cookie=\'language=\'+str+\'; path=/\';
|
document.cookie=\'language=\'+str+\'; path=/\';
|
||||||
@@ -355,13 +377,14 @@ function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $S
|
|||||||
return post2url('https://'.$host, $data.'&Signature='.urlencode($signStr));
|
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();
|
WaitSCFStat();
|
||||||
$meth = 'POST';
|
$meth = 'POST';
|
||||||
$host = 'scf.tencentcloudapi.com';
|
$host = 'scf.tencentcloudapi.com';
|
||||||
$tmpdata['Action'] = 'UpdateFunctionCode';
|
$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['CodeSource'] = 'Git';
|
||||||
$tmpdata['FunctionName'] = $function_name;
|
$tmpdata['FunctionName'] = $function_name;
|
||||||
$tmpdata['Handler'] = 'index.main_handler';
|
$tmpdata['Handler'] = 'index.main_handler';
|
||||||
@@ -393,9 +416,11 @@ namespace:' . $_SERVER['namespace'] . '<br>
|
|||||||
<button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>';
|
<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)
|
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.
|
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
|
Telegram Group: https://t.me/joinchat/I_RVc0bqxuxlT-d0cO7ozw
|
||||||
|
|||||||
+15
-15
@@ -2,11 +2,12 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo $constStr['language']; ?>">
|
<html lang="<?php echo $constStr['language']; ?>">
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) echo ' - ' . getConfig('diskname');?> - <?php echo $_SERVER['sitename'];?></title>
|
<title><?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) { if (getConfig('diskname')!='') $diskname = getConfig('diskname'); else $diskname = $_SERVER['disktag']; echo ' - ' . $diskname; } ?> - <?php echo $_SERVER['sitename'];?></title>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<meta http-equiv=X-UA-Compatible content="IE=edge">
|
<meta http-equiv=X-UA-Compatible content="IE=edge">
|
||||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
<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="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" />
|
<link rel="shortcut icon" href="<?php echo $_SERVER['base_disk_path'];?>favicon.ico" type="image/x-icon" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@@ -166,33 +167,33 @@
|
|||||||
<div style="margin: 12px 4px 4px; text-align: center">
|
<div style="margin: 12px 4px 4px; text-align: center">
|
||||||
<div style="margin: 24px">
|
<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>
|
<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>
|
||||||
<div style="margin: 24px">
|
<div style="margin: 24px">
|
||||||
<?php $ext = strtolower(substr($path, strrpos($path, '.') + 1));
|
<?php $ext = strtolower(substr($path, strrpos($path, '.') + 1));
|
||||||
if (in_array($ext, $exts['img'])) {
|
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'])) {
|
} elseif (in_array($ext, $exts['video'])) {
|
||||||
//echo '<video src="' . $files['@microsoft.graph.downloadUrl'] . '" controls="controls" style="width: 100%"></video>';
|
//echo '<video src="' . $files[$_SERVER['DownurlStrName']] . '" controls="controls" style="width: 100%"></video>';
|
||||||
$DPvideo=$files['@microsoft.graph.downloadUrl'];
|
$DPvideo=$files[$_SERVER['DownurlStrName']];
|
||||||
echo ' <div id="video-a0"></div>
|
echo ' <div id="video-a0"></div>
|
||||||
';
|
';
|
||||||
} elseif (in_array($ext, $exts['music'])) {
|
} 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'])) {
|
} elseif (in_array($ext, ['pdf'])) {
|
||||||
/*echo '
|
/*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>
|
echo ' <div id="pdf-d"></div>
|
||||||
';
|
';
|
||||||
} elseif (in_array($ext, $exts['office'])) {
|
} 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'])) {
|
} 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">
|
<div id="txt">
|
||||||
<?php if ($_SERVER['admin']) { ?>
|
<?php if ($_SERVER['admin']) { ?>
|
||||||
@@ -206,7 +207,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php } /*elseif (in_array($ext, ['md'])) {
|
<?php } /*elseif (in_array($ext, ['md'])) {
|
||||||
echo ' <div class="markdown-body" id="readme">
|
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>
|
</div>
|
||||||
';
|
';
|
||||||
}*/ else {
|
}*/ else {
|
||||||
@@ -705,8 +706,7 @@
|
|||||||
tmptextarea.select();
|
tmptextarea.select();
|
||||||
tmptextarea.setSelectionRange(0, tmptextarea.value.length);
|
tmptextarea.setSelectionRange(0, tmptextarea.value.length);
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
//alert(tmptextarea.innerHTML);
|
alert(tmptextarea.innerHTML+"<?php echo getconstStr('Success');?>");
|
||||||
alert('Success');
|
|
||||||
}
|
}
|
||||||
var sort=0;
|
var sort=0;
|
||||||
function sortby(string) {
|
function sortby(string) {
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
expd.setTime(expd.getTime()+(2*60*60*1000));
|
expd.setTime(expd.getTime()+(2*60*60*1000));
|
||||||
var expires = "expires="+expd.toGMTString();
|
var expires = "expires="+expd.toGMTString();
|
||||||
document.cookie="timezone="+timezone+"; path=/; "+expires;
|
document.cookie="timezone="+timezone+"; path=/; "+expires;
|
||||||
if (timezone!='8') {
|
if (timezone!=<?php echo $_SERVER['timezone']; ?>) {
|
||||||
alert('Your timezone is '+timezone+', reload local timezone.');
|
alert('Your timezone is '+timezone+', reload local timezone.');
|
||||||
location.href=location.protocol + "//" + location.host + "<?php echo path_format($_SERVER['base_path'] . '/' . $path );?>" ;
|
location.href=location.protocol + "//" + location.host + "<?php echo path_format($_SERVER['base_path'] . '/' . $path );?>" ;
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-57
@@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo $constStr['language']; ?>">
|
<html lang="<?php echo $constStr['language']; ?>">
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) echo ' - ' . getConfig('diskname');?> - <?php echo $_SERVER['sitename'];?></title>
|
<title><?php echo $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) { if (getConfig('diskname')!='') $diskname = getConfig('diskname'); else $diskname = $_SERVER['disktag']; echo ' - ' . $diskname; } ?> - <?php echo $_SERVER['sitename'];?></title>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<meta http-equiv=X-UA-Compatible content="IE=edge">
|
<meta http-equiv=X-UA-Compatible content="IE=edge">
|
||||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||||
@@ -59,6 +59,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div style="padding:1px">
|
<div style="padding:1px">
|
||||||
<?php
|
<?php
|
||||||
@@ -67,7 +68,6 @@
|
|||||||
<a class="login" onclick="login();"><ion-icon name="log-in"></ion-icon><?php echo getconstStr('Login'); ?></a>
|
<a class="login" onclick="login();"><ion-icon name="log-in"></ion-icon><?php echo getconstStr('Login'); ?></a>
|
||||||
<?php }
|
<?php }
|
||||||
} else { ?>
|
} else { ?>
|
||||||
|
|
||||||
<li class="operate"><ion-icon name="construct"></ion-icon><?php echo getconstStr('Operate'); ?><ul>
|
<li class="operate"><ion-icon name="construct"></ion-icon><?php echo getconstStr('Operate'); ?><ul>
|
||||||
<?php if (isset($files['folder'])) { ?>
|
<?php if (isset($files['folder'])) { ?>
|
||||||
<li><a onclick="showdiv(event,'create','');"><ion-icon name="add-circle"></ion-icon><?php echo getconstStr('Create'); ?></a></li>
|
<li><a onclick="showdiv(event,'create','');"><ion-icon name="add-circle"></ion-icon><?php echo getconstStr('Create'); ?></a></li>
|
||||||
@@ -79,6 +79,7 @@
|
|||||||
</ul></li>
|
</ul></li>
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
<select class="changelanguage" name="language" onchange="changelanguage(this.options[this.options.selectedIndex].value)">
|
<select class="changelanguage" name="language" onchange="changelanguage(this.options[this.options.selectedIndex].value)">
|
||||||
<option value="">Language</option>
|
<option value="">Language</option>
|
||||||
<?php
|
<?php
|
||||||
@@ -104,7 +105,7 @@
|
|||||||
<?php foreach ($disktags as $disk) {
|
<?php foreach ($disktags as $disk) {
|
||||||
$diskname = getConfig('diskname', $disk);
|
$diskname = getConfig('diskname', $disk);
|
||||||
if ($diskname=='') $diskname = $disk;
|
if ($diskname=='') $diskname = $disk;
|
||||||
echo ' <a href="'.path_format($_SERVER['base_path'].'/'.$disk).'"'.($_SERVER['disktag']==$disk?' now':'').'>'.$diskname.'</a>
|
echo ' <a href="'.path_format($_SERVER['base_path'].'/'.$disk.'/').'"'.($_SERVER['disktag']==$disk?' now':'').'>'.$diskname.'</a>
|
||||||
';
|
';
|
||||||
} ?>
|
} ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -112,7 +113,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php }
|
||||||
if ($files) { ?>
|
if ($files) {
|
||||||
|
if (isset($files['children']['head.md'])) { ?>
|
||||||
|
<div class="list-wrapper" id="head-div">
|
||||||
|
<div class="list-container">
|
||||||
|
<div class="list-header-container">
|
||||||
|
<div class="readme">
|
||||||
|
<div class="markdown-body" id="head">
|
||||||
|
<textarea id="head-md" style="display:none;"><?php echo fetch_files(spurlencode(path_format($path . '/head.md'),'/'))['content']['body']; ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
<div class="list-wrapper" id="list-div">
|
<div class="list-wrapper" id="list-div">
|
||||||
<div class="list-container">
|
<div class="list-container">
|
||||||
<div class="list-header-container">
|
<div class="list-header-container">
|
||||||
@@ -136,8 +150,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="list-body-container">
|
<div class="list-body-container">
|
||||||
<?php
|
<?php
|
||||||
$head = false;
|
|
||||||
$readme = false;
|
|
||||||
$pdfurl = false;
|
$pdfurl = false;
|
||||||
$DPvideo = false;
|
$DPvideo = false;
|
||||||
if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) { ?>
|
if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) { ?>
|
||||||
@@ -247,12 +259,6 @@
|
|||||||
foreach ($files['children'] as $file) {
|
foreach ($files['children'] as $file) {
|
||||||
// Files
|
// Files
|
||||||
if (isset($file['file'])) {
|
if (isset($file['file'])) {
|
||||||
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);
|
|
||||||
}
|
|
||||||
if ($_SERVER['admin'] or !isHideFile($file['name'])) {
|
if ($_SERVER['admin'] or !isHideFile($file['name'])) {
|
||||||
$filenum++; ?>
|
$filenum++; ?>
|
||||||
<tr data-to id="tr<?php echo $filenum;?>">
|
<tr data-to id="tr<?php echo $filenum;?>">
|
||||||
@@ -354,25 +360,7 @@
|
|||||||
echo 'Unknown path or file.';
|
echo 'Unknown path or file.';
|
||||||
echo json_encode($files, JSON_PRETTY_PRINT);
|
echo json_encode($files, JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
if ($head) {
|
if (isset($files['children']['readme.md'])) {
|
||||||
echo '
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="list-wrapper" id="head-div">
|
|
||||||
<div class="list-container">
|
|
||||||
<div class="list-header-container">
|
|
||||||
<div class="readme">
|
|
||||||
<!--<svg class="octicon octicon-book" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"></path></svg>
|
|
||||||
<span style="line-height: 16px;vertical-align: top;">'.$head['name'].'</span>-->
|
|
||||||
<div class="markdown-body" id="head">
|
|
||||||
<textarea id="head-md" style="display:none;">' . curl_request(fetch_files(spurlencode(path_format($path . '/' .$head['name']),'/'))['@microsoft.graph.downloadUrl'])['body'] . '
|
|
||||||
</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
}
|
|
||||||
if ($readme) {
|
|
||||||
echo '
|
echo '
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -381,11 +369,8 @@
|
|||||||
<div class="list-container">
|
<div class="list-container">
|
||||||
<div class="list-header-container">
|
<div class="list-header-container">
|
||||||
<div class="readme">
|
<div class="readme">
|
||||||
<!--<svg class="octicon octicon-book" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"></path></svg>
|
|
||||||
<span style="line-height: 16px;vertical-align: top;">'.$readme['name'].'</span>-->
|
|
||||||
<div class="markdown-body" id="readme">
|
<div class="markdown-body" id="readme">
|
||||||
<textarea id="readme-md" style="display:none;">' . curl_request(fetch_files(spurlencode(path_format($path . '/' .$readme['name']),'/'))['@microsoft.graph.downloadUrl'])['body'] . '
|
<textarea id="readme-md" style="display:none;">' . fetch_files(spurlencode(path_format($path . '/readme.md'),'/'))['content']['body'] . '</textarea>
|
||||||
</textarea>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
@@ -575,18 +560,24 @@ echo 'IPv4: ' ,$ip, "\n";
|
|||||||
<center>
|
<center>
|
||||||
<span id="clock"><span> <!--顶部span的id为clock-->
|
<span id="clock"><span> <!--顶部span的id为clock-->
|
||||||
<div class="footer_copyright">
|
<div class="footer_copyright">
|
||||||
Copyright © 2019-2020 - <span id="footyear"></span>OneManager,Power_by_逸笙 <em> 主题归彼岸云端版权所有</em>
|
Copyright © 2019-2020 - <span id="footyear"></span>OneManager Powered_by_逸笙 <em> 本主题(归彼岸云端)版权所有</em>
|
||||||
</div>
|
</div>
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<?php if ($files) { ?>
|
<?php if ($files) { ?>
|
||||||
<?php if ($head||$readme) { ?><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
|
<?php if (isset($files['children']['head.md'])||isset($files['children']['readme.md'])) { ?><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
|
||||||
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><?php } ?>
|
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><?php } ?>
|
||||||
<?php if (isset($files['folder']) && $_SERVER['is_guestup_path'] && !$_SERVER['admin']) { ?><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><?php } ?>
|
<?php if (isset($files['folder']) && $_SERVER['is_guestup_path'] && !$_SERVER['admin']) { ?><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><?php } ?>
|
||||||
<?php if ($pdfurl!='') { ?><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><?php } ?>
|
<?php if ($pdfurl!='') { ?><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
function changelanguage(str)
|
||||||
|
{
|
||||||
|
if (str=='Language') str = '';
|
||||||
|
document.cookie='language='+str+'; path=/';
|
||||||
|
location.href = location.href;
|
||||||
|
}
|
||||||
<?php if ($files) { ?>
|
<?php if ($files) { ?>
|
||||||
var root = '<?php echo $_SERVER["base_disk_path"]; ?>';
|
var root = '<?php echo $_SERVER["base_disk_path"]; ?>';
|
||||||
function path_format(path) {
|
function path_format(path) {
|
||||||
@@ -608,23 +599,6 @@ echo 'IPv4: ' ,$ip, "\n";
|
|||||||
e.innerHTML += paths[paths.length - 1];
|
e.innerHTML += paths[paths.length - 1];
|
||||||
e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
|
e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
|
||||||
});
|
});
|
||||||
|
|
||||||
function changelanguage(str)
|
|
||||||
{
|
|
||||||
if (str=='Language') str = '';
|
|
||||||
document.cookie='language='+str+'; path=/';
|
|
||||||
location.href = location.href;
|
|
||||||
}
|
|
||||||
var $head = document.getElementById('head');
|
|
||||||
if ($head) {
|
|
||||||
document.getElementById('head-div').parentNode.insertBefore(document.getElementById('head-div'),document.getElementById('list-div'));
|
|
||||||
$head.innerHTML = marked(document.getElementById('head-md').innerText);
|
|
||||||
|
|
||||||
}
|
|
||||||
var $readme = document.getElementById('readme');
|
|
||||||
if ($readme) {
|
|
||||||
$readme.innerHTML = marked(document.getElementById('readme-md').innerText);
|
|
||||||
}
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($_GET['preview'])) { //is preview mode. 在预览时处理 ?>
|
if (isset($_GET['preview'])) { //is preview mode. 在预览时处理 ?>
|
||||||
var $url = document.getElementById('url');
|
var $url = document.getElementById('url');
|
||||||
@@ -737,6 +711,16 @@ echo 'IPv4: ' ,$ip, "\n";
|
|||||||
}
|
}
|
||||||
<?php }
|
<?php }
|
||||||
} else { // view folder. 不预览,即浏览目录时?>
|
} else { // view folder. 不预览,即浏览目录时?>
|
||||||
|
var $head = document.getElementById('head');
|
||||||
|
if ($head) {
|
||||||
|
//document.getElementById('head-div').parentNode.insertBefore(document.getElementById('head-div'),document.getElementById('list-div'));
|
||||||
|
$head.innerHTML = marked(document.getElementById('head-md').innerText);
|
||||||
|
|
||||||
|
}
|
||||||
|
var $readme = document.getElementById('readme');
|
||||||
|
if ($readme) {
|
||||||
|
$readme.innerHTML = marked(document.getElementById('readme-md').innerText);
|
||||||
|
}
|
||||||
function showthumbnails(obj) {
|
function showthumbnails(obj) {
|
||||||
var files=document.getElementsByName('filelist');
|
var files=document.getElementsByName('filelist');
|
||||||
for ($i=0;$i<files.length;$i++) {
|
for ($i=0;$i<files.length;$i++) {
|
||||||
@@ -774,8 +758,7 @@ echo 'IPv4: ' ,$ip, "\n";
|
|||||||
tmptextarea.select();
|
tmptextarea.select();
|
||||||
tmptextarea.setSelectionRange(0, tmptextarea.value.length);
|
tmptextarea.setSelectionRange(0, tmptextarea.value.length);
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
alert(tmptextarea.innerHTML);
|
alert(tmptextarea.innerHTML+'<?php echo getconstStr('Success'); ?>');
|
||||||
//alert('Success');
|
|
||||||
}
|
}
|
||||||
var sort=0;
|
var sort=0;
|
||||||
function sortby(string) {
|
function sortby(string) {
|
||||||
@@ -1068,6 +1051,7 @@ echo 'IPv4: ' ,$ip, "\n";
|
|||||||
//window.open(lasturl);
|
//window.open(lasturl);
|
||||||
document.getElementById('upfile_a_'+tdnum).href = lasturl;
|
document.getElementById('upfile_a_'+tdnum).href = lasturl;
|
||||||
document.getElementById('upfile_a1_'+tdnum).href = filename;
|
document.getElementById('upfile_a1_'+tdnum).href = filename;
|
||||||
|
document.getElementById('upfile_cpbt_'+tdnum).style.display = "";
|
||||||
}
|
}
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
EndTime=new Date();
|
EndTime=new Date();
|
||||||
@@ -1077,7 +1061,7 @@ echo 'IPv4: ' ,$ip, "\n";
|
|||||||
} else {
|
} else {
|
||||||
MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>';
|
MiddleStr += '<?php echo getconstStr('ThisTime').getconstStr('AverageSpeed'); ?>:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>';
|
||||||
}
|
}
|
||||||
document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');"><?php echo getconstStr('CopyUrl'); ?></button></div>';
|
document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="<?php echo $_SERVER['base_disk_path']; ?>'+response.name+'" id="upfile_a1_'+tdnum+'"></a><?php echo getconstStr('UploadComplete'); ?><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <?php if (!$_SERVER['admin']) echo 'style="display:none"'; ?> ><?php echo getconstStr('CopyUrl'); ?></button></div>';
|
||||||
label.innerHTML=StartStr+MiddleStr;
|
label.innerHTML=StartStr+MiddleStr;
|
||||||
uploadbuttonshow();
|
uploadbuttonshow();
|
||||||
<?php if ($_SERVER['admin']) { ?>
|
<?php if ($_SERVER['admin']) { ?>
|
||||||
|
|||||||
+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
|
#!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'
|
gitsource='https://github.com/qkqpttgf/OneManager-php'
|
||||||
|
|
||||||
OneManagerPath=`cd $(dirname $0);pwd -P`
|
OneManagerPath=`cd $(dirname $0);pwd -P`
|
||||||
cd ${OneManagerPath}
|
cd ${OneManagerPath}
|
||||||
|
|
||||||
git clone ${gitsource}
|
git clone ${branch} ${gitsource}
|
||||||
\mv -b config.php OneManager-php/
|
[ g"$install" == g"1" ] || \mv -b config.php OneManager-php/
|
||||||
\mv -b OneManager-php/* ./
|
\mv -b OneManager-php/* ./
|
||||||
\mv -b OneManager-php/.[^.]* ./
|
\mv -b OneManager-php/.[^.]* ./
|
||||||
rm -rf *~
|
rm -rf *~
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
20200321-1830.15
|
20200402-1830.17
|
||||||
<font color=red>本次更新后,'index.html'功能在其它主题会导致bug。</font>
|
Oneclick update can select which branch to update. Now use the accept language instead of the language config.
|
||||||
文本类文件将缓存;添加hideFunctionalityFile开关;在添加网盘时会显示已经在用的标签。
|
一键更新可以选择哪个分支了。现在开始使用浏览器语言,抛弃language设置。
|
||||||
<font color=red>after this update, then 'index.html' function will bug in other theme.</font>
|
|
||||||
cache text file content;add hideFunctionalityFile;list exist disktags when AddDisk。
|
|
||||||
|
|
||||||
|
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开关;在添加网盘时会显示已经在用的标签。
|
||||||
|
after this update, then 'index.html' function will bug in other theme.
|
||||||
|
cache text file content;add hideFunctionalityFile;list exist disktags when AddDisk。
|
||||||
20200311-2150.14
|
20200311-2150.14
|
||||||
Add a switch, can download a known file or not, while the folder is encrypted.
|
Add a switch, can download a known file or not, while the folder is encrypted.
|
||||||
Hide time and size in mobile.
|
Hide time and size in mobile.
|
||||||
|
|||||||
Reference in New Issue
Block a user