From 9717e3225411de00007b4e358d3ff2929ccd51d7 Mon Sep 17 00:00:00 2001
From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com>
Date: Sat, 13 Mar 2021 13:49:46 +0800
Subject: [PATCH] change layout in setup
---
common.php | 448 +++++++++++++++++++++++++++++------------------------
1 file changed, 242 insertions(+), 206 deletions(-)
diff --git a/common.php b/common.php
index 4e661a8..98fcc94 100644
--- a/common.php
+++ b/common.php
@@ -49,8 +49,7 @@ $EnvConfigs = [
'refresh_token' => 0b100,
'token_expires' => 0b100,
'activeLimit' => 0b100,
- 'default_drive_id' => 0b100,
- 'default_sbox_drive_id'=> 0b100,
+ 'driveId' => 0b100,
'diskname' => 0b111,
'diskDescription' => 0b111,
@@ -277,6 +276,7 @@ function main($path)
if (!$_SERVER['admin']) {
if (!$_SERVER['is_guestup_path']) return output('Not_Guest_Upload_Folder', 400);
if (strpos($_GET['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400);
+ if (strpos($_POST['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400);
}
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if (substr($path1, -1)=='/') $path1=substr($path1, 0, -1);
@@ -459,7 +459,7 @@ function compareadminsha1($adminsha1, $timestamp, $pass)
if (!is_numeric($timestamp)) return 'Timestamp not Number';
if (abs(time()-$timestamp) > 5*60) {
date_default_timezone_set('UTC');
- return 'The timestamp in server is ' . time() . ' (' . date("Y-m-d\TH:i:s\Z") . '),
and your posted timestamp is ' . $timestamp . ' (' . date("Y-m-d\TH:i:s\Z", $timestamp) . ')';
+ return 'The timestamp in server is ' . time() . ' (' . date("Y-m-d H:i:s") . ' UTC),
and your posted timestamp is ' . $timestamp . ' (' . date("Y-m-d H:i:s", $timestamp) . ' UTC)';
}
if ($adminsha1 == sha1($timestamp . $pass)) return '';
else return 'Error password';
@@ -1219,40 +1219,37 @@ function EnvOpt($needUpdate = 0)
$preurl = path_format($_SERVER['PHP_SELF'] . '/');
}
$html .= '
-'.getconstStr('Back').'
-Github
';
-
- $html .= '
+' . getconstStr('Back') . '
+';
+ if (isset($_GET['frame'])&&$_GET['frame']=='platform') {
+ $frame .= '
';
-
- if (count($disktags)>1) {
- $html .= '
+ } elseif (isset($_GET['frame'])&&in_array($_GET['frame'], $disktags)) {
+ $disktag = $_GET['frame'];
+ $disk_tmp = null;
+ $diskok = driveisfine($disktag, $disk_tmp);
+ $frame .= '
+
+
+
+ Driver |
+ ' . getConfig('Driver', $disktag);
+ if ($diskok) $frame .= ' ' . getconstStr('ChangeDrivetype') . '';
+ $frame .= ' |
+
+';
+ if ($diskok) {
+ foreach (extendShow_diskenv($disk_tmp) as $ext_env) {
+ $frame .= '' . $ext_env . ' | ' . getConfig($ext_env, $disktag) . ' |
+';
+ }
+ $frame .= '
+';
+ } else {
+ $frame .= '
+
+ ' . ($disk_tmp->error['body']?$disk_tmp->error['stat'] . ' ' . $disk_tmp->error['body']:'Add this disk again.') . ' |
+
';
+ }
+ $frame .= '
+
+
+';
+ } else {
+ $_GET['frame'] = 'home';
+ $Driver_arr = scandir(__DIR__ . $slash . 'disk');
+ $frame .= '
+
+' . getconstStr('AddDisk') . '
+
+
';
+ if (count($disktags)>1) {
+ $frame .= '