diff --git a/common.php b/common.php
index 33fe6e4..c9d7944 100644
--- a/common.php
+++ b/common.php
@@ -153,6 +153,8 @@ function main($path)
global $exts;
global $constStr;
+ $_SERVER['php_starttime'] = microtime(true);
+ $path = path_format($path);
if (in_array($_SERVER['firstacceptlanguage'], array_keys($constStr['languages']))) {
$constStr['language'] = $_SERVER['firstacceptlanguage'];
} else {
@@ -216,10 +218,14 @@ function main($path)
// echo 'count$disk:'.count($disktags);
if (count($disktags)>1) {
if ($path=='/'||$path=='') return output('', 302, [ 'Location' => path_format($_SERVER['base_path'].'/'.$disktags[0].'/') ]);
- $_SERVER['disktag'] = $path;
- $pos = strpos($path, '/');
- if ($pos>1) $_SERVER['disktag'] = substr($path, 0, $pos);
- if (!in_array($_SERVER['disktag'], $disktags)) return message('Please visit from Home Page.', 'Error', 404);
+ $_SERVER['disktag'] = splitfirst( substr(path_format($path), 1), '/' )[0];
+ //$pos = strpos($path, '/');
+ //if ($pos>1) $_SERVER['disktag'] = substr($path, 0, $pos);
+ if (!in_array($_SERVER['disktag'], $disktags)) {
+ $tmp = path_format($_SERVER['base_path'].'/'.$disktags[0].'/'.$path);
+ return output('Please visit '.$tmp.'.', 302, [ 'Location' => $tmp ]);
+ //return message('Please visit from Home Page.', 'Error', 404);
+ }
$path = substr($path, strlen('/'.$_SERVER['disktag']));
if ($_SERVER['disktag']!='') $_SERVER['base_disk_path'] = path_format($_SERVER['base_disk_path']. '/' . $_SERVER['disktag'] . '/');
} else $_SERVER['disktag'] = $disktags[0];
@@ -1372,10 +1378,17 @@ function get_refresh_token()
$tmp['Drive_custom'] = $_POST['Drive_custom'];
$tmp['client_id'] = $_POST['client_id'];
$tmp['client_secret'] = $_POST['client_secret'];
+ } else {
+ $tmp['Drive_custom'] = '';
+ $tmp['client_id'] = '';
+ $tmp['client_secret'] = '';
}
if ($_POST['usesharepoint']=='on') {
$tmp['usesharepoint'] = $_POST['usesharepoint'];
$tmp['sharepointSiteAddress'] = $_POST['sharepointSiteAddress'];
+ } else {
+ $tmp['usesharepoint'] = '';
+ $tmp['sharepointSiteAddress'] = '';
}
}
$response = setConfigResponse( setConfig($tmp, $_COOKIE['disktag']) );
@@ -1732,7 +1745,7 @@ function render_list($path = '', $files = '')
date_default_timezone_set(get_timezone($_SERVER['timezone']));
$authinfo = '';
$theme = getConfig('theme');
@@ -1874,7 +1887,7 @@ function render_list($path = '', $files = '')
$html = str_replace('', '', $html);
}
}
- if ($_SERVER['is_guestup_path']||$_SERVER['admin']) {
+ if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) {
while (strpos($html, '')) {
$html = str_replace('', '', $html);
$html = str_replace('', '', $html);
@@ -1921,10 +1934,13 @@ function render_list($path = '', $files = '')
$html = str_replace('', '', $html);
$html = str_replace('', '', $html);
}
- /*while (strpos($html, '')) {
- $html = str_replace('', '', $html);
- $html = str_replace('', '', $html);
- }*/
+ $tmp[1] = 'a';
+ while ($tmp[1]!='') {
+ $tmp = splitfirst($html, '');
+ $html = $tmp[0];
+ $tmp = splitfirst($tmp[1], '');
+ $html .= $tmp[1];
+ }
}
if (isset($files['children'])) {
@@ -1997,8 +2013,10 @@ function render_list($path = '', $files = '')
if ($ext==$key1) {
$FolderListStr = str_replace('', $value1, $FolderListStr);
}
+ //error_log('file:'.$file['name'].':'.$key1);
+ if (!strpos($FolderListStr, '')) break;
}
- $FolderListStr = str_replace('', $IconValues['default'], $FolderListStr);
+ if (strpos($FolderListStr, '')) $FolderListStr = str_replace('', $IconValues['default'], $FolderListStr);
while (strpos($FolderListStr, '')) $FolderListStr = str_replace('', $filenum, $FolderListStr);
$html .= $FolderListStr;
}
@@ -2120,6 +2138,7 @@ function render_list($path = '', $files = '')
$html = str_replace('', '', $html);
}
while (strpos($html, '')) $html = str_replace('', $files[$_SERVER['DownurlStrName']], $html);
+ while (strpos($html, '')) $html = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path), $html);
while (strpos($html, '')) $html = str_replace('', $files['name'], $html);
$html = str_replace('', urlencode($files[$_SERVER['DownurlStrName']]), $html);
$html = str_replace('', getconstStr('ClicktoEdit'), $html);
@@ -2144,22 +2163,24 @@ function render_list($path = '', $files = '')
$html = str_replace('', $title, $html);
$keywords = $n_path;
- if ($p_path!='') $keywords .= ',' . $p_path;
- $keywords .= ',' . $_SERVER['sitename'] . ',OneManager';
+ if ($p_path!='') $keywords .= ', ' . $p_path;
+ if ($_SERVER['sitename']!='OneManager') $keywords .= ', ' . $_SERVER['sitename'] . ', OneManager';
+ else $keywords .= ', OneManager';
$html = str_replace('', $keywords, $html);
- if ($_GET['preview']) $description = 'Preview of '.$n_path.'. ';
- elseif (isset($files['folder'])) $description = 'List of '.$n_path.'. ';
- $description .= 'In '.$_SERVER['sitename'];
+ if ($_GET['preview']) {
+ $description = $n_path.', '.getconstStr('Preview');//'Preview of '.
+ } elseif (isset($files['folder'])) {
+ $description = $n_path.', '.getconstStr('List');//'List of '.$n_path.'. ';
+ }
+ //$description .= 'In '.$_SERVER['sitename'];
$html = str_replace('', $description, $html);
while (strpos($html, '')) $html = str_replace('', $_SERVER['base_disk_path'], $html);
while (strpos($html, '')) $html = str_replace('', $_SERVER['base_path'], $html);
while (strpos($html, '')) $html = str_replace('', str_replace('%23', '#', str_replace('&','&', $path)), $html);
while (strpos($html, '')) $html = str_replace('', getconstStr('Home'), $html);
-
- while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html);
-
+
$html = str_replace('', getConfig('customCss'), $html);
$html = str_replace('', getConfig('customScript'), $html);
@@ -2190,9 +2211,6 @@ function render_list($path = '', $files = '')
while (strpos($html, '')) $html = str_replace('', getconstStr('UploadFile'), $html);
while (strpos($html, '')) $html = str_replace('', getconstStr('UploadFolder'), $html);
while (strpos($html, '')) $html = str_replace('', (isset($_GET['preview'])?'?preview&':'?'), $html);
-
-
- $html = str_replace('', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'], $html);
$tmp = splitfirst($html, '');
$html = $tmp[0];
@@ -2245,7 +2263,7 @@ function render_list($path = '', $files = '')
$html = $tmp[0];
$tmp = splitfirst($tmp[1], '');
if (!(isset($_SERVER['USER'])&&$_SERVER['USER']=='qcloud')) {
- $html .= $tmp[0] . $tmp[1];
+ $html .= str_replace('', getconstStr('OriginalPic'), $tmp[0]) . $tmp[1];
} else $html .= $tmp[1];
}
$imgextstr = '';
@@ -2399,13 +2417,21 @@ function render_list($path = '', $files = '')
}
$html .= $tmp[1];
+ $tmp = splitfirst($html, '');
+ $html = $tmp[0];
+ $tmp = splitfirst($tmp[1], '');
+ if (!isset($_COOKIE['timezone'])) $html .= str_replace('', $_SERVER['timezone'], $tmp[0]);
+ $html .= $tmp[1];
+ while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html);
// 最后清除换行
while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html);
//while (strpos($html, PHP_EOL.PHP_EOL)) $html = str_replace(PHP_EOL.PHP_EOL, PHP_EOL, $html);
-
+
+ $exetime = round(microtime(true)-$_SERVER['php_starttime'],3);
+ $html = str_replace('', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html);
}
-
+
$html = $authinfo . $html;
if (isset($_SERVER['Set-Cookie'])) return output($html, $statusCode, [ 'Set-Cookie' => $_SERVER['Set-Cookie'], 'Content-Type' => 'text/html' ]);
return output($html,$statusCode);
diff --git a/conststr.php b/conststr.php
index 1dffcc5..135a4fa 100644
--- a/conststr.php
+++ b/conststr.php
@@ -4,7 +4,7 @@ $exts['img'] = ['ico', 'bmp', 'gif', 'jpg', 'jpeg', 'jpe', 'jfif', 'tif', 'tiff'
$exts['music'] = ['mp3', 'wma', 'flac', 'wav', 'ogg', 'm4a'];
$exts['office'] = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'];
$exts['txt'] = ['txt', 'bat', 'sh', 'php', 'asp', 'js', 'json', 'html', 'c', 'md', 'py', 'omf'];
-$exts['video'] = ['mp4', 'webm', 'mkv', 'mov', 'flv', 'blv', 'avi', 'wmv', 'm3u8'];
+$exts['video'] = ['mp4', 'webm', 'mkv', 'mov', 'flv', 'blv', 'avi', 'wmv', 'm3u8', 'rm', 'rmvb'];
$exts['zip'] = ['zip', 'rar', '7z', 'gz', 'tar'];
$constStr = [
@@ -259,6 +259,14 @@ $constStr = [
'ko-kr' => '홈',
'fa' => 'خانه',
],
+ 'Preview' => [
+ 'en-us' => 'Preview',
+ 'zh-cn' => '预览',
+ ],
+ 'List' => [
+ 'en-us' => 'List',
+ 'zh-cn' => '列表',
+ ],
'NeedUpdate' => [
'en-us' => 'Program can update
Click setup in Operate at top.',
'zh-cn' => '可以升级程序
在上方管理菜单中
进入设置页面升级',
@@ -329,6 +337,10 @@ $constStr = [
'ko-kr' => '사진 섬네일',
'fa' => 'تصویر بندانگشتی',
],
+ 'OriginalPic' => [
+ 'en-us' => 'OriginalPic',
+ 'zh-cn' => '原图',
+ ],
'CopyAllDownloadUrl' => [
'en-us' => 'CopyAllDownloadUrl',
'zh-cn' => '复制所有下载链接',
@@ -658,8 +670,8 @@ $constStr = [
'zh-cn' => '对一个Onedrive文件夹共享,允许所有人编辑,然后将共享链接填在下方',
],
'CustomIdSecret' => [
- 'en-us' => 'Use custom client id & secret',
- 'zh-cn' => '自己申请应用ID与机密',
+ 'en-us' => 'Use custom client id & secret instead of OneManager default',
+ 'zh-cn' => '自己申请应用ID与机密,不用OneManager默认的',
'ja' => 'アプリケーションIDとシークレットを自分で申請する',
'ko-kr' => '응용 프로그램 ID 및 비밀 신청',
'fa' => 'به طور پیش فرض اما از شناسه برنامه و سکرت استفاده کنید',
diff --git a/platform/normal.php b/platform/normal.php
index 432211d..c56577b 100644
--- a/platform/normal.php
+++ b/platform/normal.php
@@ -3,6 +3,7 @@
function getpath()
{
$_SERVER['firstacceptlanguage'] = strtolower(splitfirst(splitfirst($_SERVER['HTTP_ACCEPT_LANGUAGE'],';')[0],',')[0]);
+ if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
$_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);
diff --git a/theme/nexmoe.html b/theme/nexmoe.html
new file mode 100644
index 0000000..10e58aa
--- /dev/null
+++ b/theme/nexmoe.html
@@ -0,0 +1,326 @@
+
+{
+ "music":"audiotrack",
+ "video":"ondemand_video",
+ "img":"image",
+ "default":"insert_drive_file"
+}
+
+
+
+