mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-05-20 06:26:40 +02:00
Compare commits
9 commits
7f20f61d71
...
c021119a77
Author | SHA1 | Date | |
---|---|---|---|
c021119a77 | |||
a1ae0fa729 | |||
ca4b1b1743 | |||
b1ca169ef7 | |||
1d5dc40543 | |||
36ad7f601b | |||
5ebea63410 | |||
348de71354 | |||
f3c941a1ac |
|
@ -142,9 +142,30 @@ $ip_blacklist = array(
|
|||
'::' // non-routable meta ipv6
|
||||
);
|
||||
|
||||
|
||||
if (getenv('TFM_USE_AUTH') !== false) {
|
||||
$use_auth = filter_var(getenv('TFM_USE_AUTH'), FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
if (getenv('TFM_AUTH_USERS') !== false) {
|
||||
$auth_users = array();
|
||||
foreach(explode(',', getenv('TFM_AUTH_USERS')) as $u) {
|
||||
$u = explode('=', $u);
|
||||
$auth_users[$u[0]] = $u[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv('TFM_READONLY_USERS') !== false) {
|
||||
$readonly_users = explode(',', getenv('TFM_READONLY_USERS'));
|
||||
}
|
||||
|
||||
if (getenv('TFM_ROOT_PATH') !== false) {
|
||||
$root_path = getenv('TFM_ROOT_PATH');
|
||||
}
|
||||
|
||||
// if User has the external config file, try to use it to override the default config above [config.php]
|
||||
// sample config - https://tinyfilemanager.github.io/config-sample.txt
|
||||
$config_file = __DIR__.'/config.php';
|
||||
$config_file = getenv('TFM_CONFIG_FILE') !== false ? getenv('TFM_CONFIG_FILE') : __DIR__.'/config.php';
|
||||
if (is_readable($config_file)) {
|
||||
@include($config_file);
|
||||
}
|
||||
|
@ -958,7 +979,7 @@ if (!empty($_FILES) && !FM_READONLY) {
|
|||
|
||||
$targetPath = $path . $ds;
|
||||
if ( is_writable($targetPath) ) {
|
||||
$fullPath = $path . '/' . basename($fullPathInput);
|
||||
$fullPath = $path . '/' . $fullPathInput;
|
||||
$folder = substr($fullPath, 0, strrpos($fullPath, "/"));
|
||||
|
||||
if (!is_dir($folder)) {
|
||||
|
@ -1647,7 +1668,7 @@ if (isset($_GET['view'])) {
|
|||
$file = $_GET['view'];
|
||||
$file = fm_clean_path($file, false);
|
||||
$file = str_replace('/', '', $file);
|
||||
if ($file == '' || !is_file($path . '/' . $file) || in_array($file, $GLOBALS['exclude_items'])) {
|
||||
if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) {
|
||||
fm_set_msg(lng('File not found'), 'error');
|
||||
$FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
|
||||
}
|
||||
|
@ -1846,7 +1867,7 @@ if (isset($_GET['edit']) && !FM_READONLY) {
|
|||
$file = $_GET['edit'];
|
||||
$file = fm_clean_path($file, false);
|
||||
$file = str_replace('/', '', $file);
|
||||
if ($file == '' || !is_file($path . '/' . $file) || in_array($file, $GLOBALS['exclude_items'])) {
|
||||
if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) {
|
||||
fm_set_msg(lng('File not found'), 'error');
|
||||
$FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue