Update common.php
parent
40edce9bcd
commit
c4fad48b71
|
@ -616,7 +616,7 @@ function main($path)
|
||||||
$files = list_files($path);
|
$files = list_files($path);
|
||||||
if (isset($files['file']) && !$_GET['preview']) {
|
if (isset($files['file']) && !$_GET['preview']) {
|
||||||
// is file && not preview mode
|
// is file && not preview mode
|
||||||
if ( $_SERVER['ishidden']<4 || (getConfig('downloadencrypt')&&$files['name']!=getConfig('passfile')) ) return output('', 302, [ 'Location' => $files['@microsoft.graph.downloadUrl'] ]);
|
if ( $_SERVER['ishidden']<4 || (!!getConfig('downloadencrypt')&&$files['name']!=getConfig('passfile')) ) return output('', 302, [ 'Location' => $files['@microsoft.graph.downloadUrl'] ]);
|
||||||
}
|
}
|
||||||
if ( isset($files['folder']) || isset($files['file']) ) {
|
if ( isset($files['folder']) || isset($files['file']) ) {
|
||||||
return render_list($path, $files);
|
return render_list($path, $files);
|
||||||
|
@ -633,6 +633,7 @@ function list_files($path)
|
||||||
$files = json_decode('{"folder":{}}', true);
|
$files = json_decode('{"folder":{}}', true);
|
||||||
} elseif (!getConfig('downloadencrypt')) {
|
} elseif (!getConfig('downloadencrypt')) {
|
||||||
if ($_SERVER['ishidden']==4) $files = json_decode('{"folder":{}}', true);
|
if ($_SERVER['ishidden']==4) $files = json_decode('{"folder":{}}', true);
|
||||||
|
else $files = fetch_files($path);
|
||||||
} else {
|
} else {
|
||||||
$files = fetch_files($path);
|
$files = fetch_files($path);
|
||||||
}
|
}
|
||||||
|
@ -1082,7 +1083,7 @@ function render_list($path = '', $files = '')
|
||||||
$htmlpage = include 'theme/'.$theme;
|
$htmlpage = include 'theme/'.$theme;
|
||||||
|
|
||||||
$html = '<!--
|
$html = '<!--
|
||||||
Github : https://github.com/qkqpttgf/OneManager-php
|
Github : https://github.com/ldxw/OneManager-php
|
||||||
-->' . ob_get_clean();
|
-->' . ob_get_clean();
|
||||||
if (isset($htmlpage['statusCode'])) return $htmlpage;
|
if (isset($htmlpage['statusCode'])) return $htmlpage;
|
||||||
if ($_SERVER['Set-Cookie']!='') return output($html, $statusCode, [ 'Set-Cookie' => $_SERVER['Set-Cookie'], 'Content-Type' => 'text/html' ]);
|
if ($_SERVER['Set-Cookie']!='') return output($html, $statusCode, [ 'Set-Cookie' => $_SERVER['Set-Cookie'], 'Content-Type' => 'text/html' ]);
|
||||||
|
|
Loading…
Reference in New Issue