Update index.php
parent
f429da776e
commit
d20a74ebcf
46
index.php
46
index.php
|
@ -3,19 +3,37 @@ include 'vendor/autoload.php';
|
||||||
include 'conststr.php';
|
include 'conststr.php';
|
||||||
include 'functions.php';
|
include 'functions.php';
|
||||||
|
|
||||||
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
if ($_SERVER['USER']!='qcloud') {
|
||||||
$path = getpath();
|
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
||||||
//echo 'path:'. $path;
|
$path = getpath();
|
||||||
$_GET = getGET();
|
//echo 'path:'. $path;
|
||||||
//echo '<pre>'. json_encode($_GET, JSON_PRETTY_PRINT).'</pre>';
|
$_GET = getGET();
|
||||||
|
//echo '<pre>'. json_encode($_GET, JSON_PRETTY_PRINT).'</pre>';
|
||||||
|
|
||||||
$re = main($path);
|
$re = main($path);
|
||||||
$sendHeaders = array();
|
$sendHeaders = array();
|
||||||
foreach ($re['headers'] as $headerName => $headerVal) {
|
foreach ($re['headers'] as $headerName => $headerVal) {
|
||||||
header($headerName . ': ' . $headerVal, true);
|
header($headerName . ': ' . $headerVal, true);
|
||||||
|
}
|
||||||
|
http_response_code($re['statusCode']);
|
||||||
|
echo $re['body'];
|
||||||
|
}
|
||||||
|
|
||||||
|
function main_handler($event, $context)
|
||||||
|
{
|
||||||
|
global $constStr;
|
||||||
|
$event = json_decode(json_encode($event), true);
|
||||||
|
$context = json_decode(json_encode($context), true);
|
||||||
|
//printInput($event, $context);
|
||||||
|
unset($_POST);
|
||||||
|
unset($_GET);
|
||||||
|
unset($_COOKIE);
|
||||||
|
unset($_SERVER);
|
||||||
|
GetGlobalVariable($event);
|
||||||
|
config_oauth();
|
||||||
|
$path = GetPathSetting($event, $context);
|
||||||
|
return main($path);
|
||||||
}
|
}
|
||||||
http_response_code($re['statusCode']);
|
|
||||||
echo $re['body'];
|
|
||||||
|
|
||||||
function main($path)
|
function main($path)
|
||||||
{
|
{
|
||||||
|
@ -429,7 +447,7 @@ function adminoperate($path)
|
||||||
}
|
}
|
||||||
if ($_GET['RefreshCache']) {
|
if ($_GET['RefreshCache']) {
|
||||||
//savecache('path_' . $path1, json_decode('{}',true), 1);
|
//savecache('path_' . $path1, json_decode('{}',true), 1);
|
||||||
return output('<meta http-equiv="refresh" content="2;URL=./">', 302);
|
return output('<meta http-equiv="refresh" content="2;URL=./">'.$constStr['RefreshCache'][$constStr['language']], 302);
|
||||||
}
|
}
|
||||||
return $tmparr;
|
return $tmparr;
|
||||||
}
|
}
|
||||||
|
@ -670,11 +688,11 @@ function render_list($path, $files)
|
||||||
$p_path=str_replace('&','&',$p_path);
|
$p_path=str_replace('&','&',$p_path);
|
||||||
$pretitle = str_replace('%23','#',$pretitle);
|
$pretitle = str_replace('%23','#',$pretitle);
|
||||||
$statusCode=200;
|
$statusCode=200;
|
||||||
$theme = getConfig('theme');
|
|
||||||
if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.php';
|
|
||||||
date_default_timezone_set(get_timezone($_COOKIE['timezone']));
|
date_default_timezone_set(get_timezone($_COOKIE['timezone']));
|
||||||
@ob_start();
|
@ob_start();
|
||||||
|
|
||||||
|
$theme = getConfig('theme');
|
||||||
|
if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.php';
|
||||||
include 'theme/'.$theme;
|
include 'theme/'.$theme;
|
||||||
|
|
||||||
$html = '<!--
|
$html = '<!--
|
||||||
|
|
Loading…
Reference in New Issue