visit root in multy disk

pull/128/head
qkqpttgf 2020-08-04 14:38:20 +08:00 committed by GitHub
parent e3e0f7f27d
commit 2e8e29a35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 7 deletions

View File

@ -1,8 +1,14 @@
<?php <?php
global $Base64Env;
global $CommonEnv;
global $ShowedCommonEnv;
global $InnerEnv;
global $ShowedInnerEnv;
global $Base64Env;
$Base64Env = [ $Base64Env = [
//'APIKey', // used in heroku. //'APIKey', // used in heroku.
//'Region', // used in SCF.
//'SecretId', // used in SCF. //'SecretId', // used in SCF.
//'SecretKey', // used in SCF. //'SecretKey', // used in SCF.
//'AccessKeyID', // used in FC. //'AccessKeyID', // used in FC.
@ -47,7 +53,6 @@ $Base64Env = [
$CommonEnv = [ $CommonEnv = [
'APIKey', // used in heroku. 'APIKey', // used in heroku.
'Region', // used in SCF.
'SecretId', // used in SCF. 'SecretId', // used in SCF.
'SecretKey', // used in SCF. 'SecretKey', // used in SCF.
'AccessKeyID', // used in FC. 'AccessKeyID', // used in FC.
@ -74,7 +79,6 @@ $CommonEnv = [
$ShowedCommonEnv = [ $ShowedCommonEnv = [
//'APIKey', // used in heroku. //'APIKey', // used in heroku.
//'Region', // used in SCF.
//'SecretId', // used in SCF. //'SecretId', // used in SCF.
//'SecretKey', // used in SCF. //'SecretKey', // used in SCF.
//'AccessKeyID', // used in FC. //'AccessKeyID', // used in FC.
@ -240,11 +244,25 @@ function main($path)
return output('<script>alert(\''.getconstStr('SetSecretsFirst').'\');</script>', 302, [ 'Location' => $url ]); return output('<script>alert(\''.getconstStr('SetSecretsFirst').'\');</script>', 302, [ 'Location' => $url ]);
} }
$_SERVER['sitename'] = getConfig('sitename');
if (empty($_SERVER['sitename'])) $_SERVER['sitename'] = getconstStr('defaultSitename');
$_SERVER['base_disk_path'] = $_SERVER['base_path']; $_SERVER['base_disk_path'] = $_SERVER['base_path'];
$disktags = explode("|",getConfig('disktag')); $disktags = explode("|",getConfig('disktag'));
// echo 'count$disk:'.count($disktags); // echo 'count$disk:'.count($disktags);
if (count($disktags)>1) { if (count($disktags)>1) {
if ($path=='/'||$path=='') return output('', 302, [ 'Location' => path_format($_SERVER['base_path'].'/'.$disktags[0].'/') ]); if ($path=='/'||$path=='') {
$files['folder']['childCount'] = count($disktags);
foreach ($disktags as $disktag) {
$files['children'][$disktag]['folder'] = 1;
$files['children'][$disktag]['name'] = $disktag;
}
if ($_GET['json']) {
// return a json
return files_json($files);
}
return render_list($path, $files);
//return output('', 302, [ 'Location' => path_format($_SERVER['base_path'].'/'.$disktags[0].'/') ]);
}
$_SERVER['disktag'] = splitfirst( substr(path_format($path), 1), '/' )[0]; $_SERVER['disktag'] = splitfirst( substr(path_format($path), 1), '/' )[0];
//$pos = strpos($path, '/'); //$pos = strpos($path, '/');
//if ($pos>1) $_SERVER['disktag'] = substr($path, 0, $pos); //if ($pos>1) $_SERVER['disktag'] = substr($path, 0, $pos);
@ -538,8 +556,6 @@ function getconstStr($str)
function config_oauth() function config_oauth()
{ {
$_SERVER['sitename'] = getConfig('sitename');
if (empty($_SERVER['sitename'])) $_SERVER['sitename'] = getconstStr('defaultSitename');
$_SERVER['redirect_uri'] = 'https://scfonedrive.github.io'; $_SERVER['redirect_uri'] = 'https://scfonedrive.github.io';
if (getConfig('Drive_ver')=='shareurl') { if (getConfig('Drive_ver')=='shareurl') {
$_SERVER['api_url'] = getConfig('shareapiurl'); $_SERVER['api_url'] = getConfig('shareapiurl');
@ -1617,7 +1633,7 @@ function EnvOpt($needUpdate = 0)
asort($ShowedInnerEnv); asort($ShowedInnerEnv);
$html = '<title>OneManager '.getconstStr('Setup').'</title>'; $html = '<title>OneManager '.getconstStr('Setup').'</title>';
if (isset($_POST['updateProgram'])&&$_POST['updateProgram']==getconstStr('updateProgram')) { if (isset($_POST['updateProgram'])&&$_POST['updateProgram']==getconstStr('updateProgram')) {
$response = OnekeyUpate($_POST['auth'], $_POST['project'], $_POST['branch']); $response = setConfigResponse(OnekeyUpate($_POST['auth'], $_POST['project'], $_POST['branch']));
if (api_error($response)) { if (api_error($response)) {
$html = api_error_msg($response); $html = api_error_msg($response);
$title = 'Error'; $title = 'Error';