mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2025-10-07 13:26:22 +02:00
Compare commits
35 Commits
offline
...
prasathman
Author | SHA1 | Date | |
---|---|---|---|
|
4777022e13 | ||
|
0f58c2ca65 | ||
|
b602dcd172 | ||
|
1bcc240119 | ||
|
8b330b75a4 | ||
|
f120daa607 | ||
|
e27e1abeb4 | ||
|
a4d96e0eaf | ||
|
843e240757 | ||
|
ecec756b71 | ||
|
8366e1bc29 | ||
|
d8fceac7dd | ||
|
a306f4f1f7 | ||
|
a1ae0fa729 | ||
|
ca4b1b1743 | ||
|
8e87afae5b | ||
|
43063e4746 | ||
|
47359d3f4e | ||
|
eb8f3d80bc | ||
|
f380478197 | ||
|
f7a2f77008 | ||
|
dabc4ea36e | ||
|
7ec19c1659 | ||
|
8486c7a240 | ||
|
8194249b66 | ||
|
da77df785a | ||
|
00541fc469 | ||
|
7ca87c9163 | ||
|
f6a93653be | ||
|
85f35bc28f | ||
|
3a90a5916a | ||
|
6a6eb8abec | ||
|
bf024c7c84 | ||
|
d705da604c | ||
|
94f1c92d80 |
@@ -12,7 +12,7 @@ FROM php:7.4-cli-alpine
|
||||
# if run in China
|
||||
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk add \
|
||||
RUN apk add --no-cache \
|
||||
libzip-dev \
|
||||
oniguruma-dev
|
||||
|
||||
|
@@ -9,6 +9,8 @@
|
||||
|
||||
> TinyFileManager is web based PHP file manager and it is a simple, fast and small size in single-file PHP file that can be dropped into any folder on your server, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.
|
||||
|
||||
**Caution!** _Avoid utilizing this script as a standard file manager in public spaces. It is imperative to remove this script from the server after completing any tasks._
|
||||
|
||||
## Demo
|
||||
|
||||
[Demo](https://tinyfilemanager.github.io/demo/)
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
The team takes security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
|
||||
|
||||
To report a security issue, email ccpprogrammers[at]gmail.com and include the word "SECURITY" in the subject line.
|
||||
To report a security issue, email ccpprogrammers[at]gmail[dot]com and include the word "SECURITY" in the subject line.
|
||||
|
||||
The team will send a response indicating the next steps in handling your report. After the initial reply to your report you will be kept informed of the progress towards a fix and full announcement.
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
7
assets/css/bootstrap.min.css
vendored
7
assets/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
1
assets/css/dropzone.min.css
vendored
1
assets/css/dropzone.min.css
vendored
File diff suppressed because one or more lines are too long
4
assets/css/font-awesome.min.css
vendored
4
assets/css/font-awesome.min.css
vendored
File diff suppressed because one or more lines are too long
1
assets/css/vs.min.css
vendored
1
assets/css/vs.min.css
vendored
@@ -1 +0,0 @@
|
||||
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote,.hljs-variable{color:green}.hljs-built_in,.hljs-keyword,.hljs-name,.hljs-selector-tag,.hljs-tag{color:#00f}.hljs-addition,.hljs-attribute,.hljs-literal,.hljs-section,.hljs-string,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type{color:#a31515}.hljs-deletion,.hljs-meta,.hljs-selector-attr,.hljs-selector-pseudo{color:#2b91af}.hljs-doctag{color:grey}.hljs-attr{color:red}.hljs-bullet,.hljs-link,.hljs-symbol{color:#00b0e8}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
assets/js/bootstrap.bundle.min.js
vendored
7
assets/js/bootstrap.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
22
assets/js/datatables.min.js
vendored
22
assets/js/datatables.min.js
vendored
File diff suppressed because one or more lines are too long
1
assets/js/dropzone.min.js
vendored
1
assets/js/dropzone.min.js
vendored
File diff suppressed because one or more lines are too long
1361
assets/js/highlight.min.js
vendored
1361
assets/js/highlight.min.js
vendored
File diff suppressed because one or more lines are too long
2
assets/js/jquery-3.6.1.min.js
vendored
2
assets/js/jquery-3.6.1.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -5,7 +5,6 @@ $CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":
|
||||
/**
|
||||
* H3K | Tiny File Manager V2.5.3
|
||||
* @author CCP Programmers
|
||||
* @email ccpprogrammers@gmail.com
|
||||
* @github https://github.com/prasathmani/tinyfilemanager
|
||||
* @link https://tinyfilemanager.github.io
|
||||
*/
|
||||
@@ -101,7 +100,7 @@ $favicon_path = '';
|
||||
$exclude_items = array();
|
||||
|
||||
// Online office Docs Viewer
|
||||
// Availabe rules are 'google', 'microsoft' or false
|
||||
// Available rules are 'google', 'microsoft' or false
|
||||
// Google => View documents using Google Docs Viewer
|
||||
// Microsoft => View documents using Microsoft Web Apps Viewer
|
||||
// false => disable online doc viewer
|
||||
@@ -142,20 +141,6 @@ $ip_blacklist = array(
|
||||
'::' // non-routable meta ipv6
|
||||
);
|
||||
|
||||
// External CDN resources that can be used in the HTML (replace for GDPR compliance)
|
||||
$external = array(
|
||||
'css-bootstrap' => '<link href="assets/css/bootstrap.min.css" rel="stylesheet">',
|
||||
'css-dropzone' => '<link href="assets/css/dropzone.min.css" rel="stylesheet">',
|
||||
'css-font-awesome' => '<link rel="stylesheet" href="assets/css/font-awesome.min.css" crossorigin="anonymous">',
|
||||
'css-highlightjs' => '<link rel="stylesheet" href="assets/css/' . $highlightjs_style . '.min.css">',
|
||||
'js-ace' => '<script src="assets/js/ace.js"></script>',
|
||||
'js-bootstrap' => '<script src="assets/js/bootstrap.bundle.min.js"></script>',
|
||||
'js-dropzone' => '<script src="assets/js/dropzone.min.js"></script>',
|
||||
'js-jquery' => '<script src="assets/js/jquery-3.6.1.min.js"></script>',
|
||||
'js-jquery-datatables' => '<script src="assets/js/datatables.min.js"></script>',
|
||||
'js-highlightjs' => '<script src="assets/js/highlight.min.js"></script>',
|
||||
);
|
||||
|
||||
// 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';
|
||||
@@ -163,6 +148,22 @@ if (is_readable($config_file)) {
|
||||
@include($config_file);
|
||||
}
|
||||
|
||||
// External CDN resources that can be used in the HTML (replace for GDPR compliance)
|
||||
$external = array(
|
||||
'css-bootstrap' => '<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">',
|
||||
'css-dropzone' => '<link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.css" rel="stylesheet">',
|
||||
'css-font-awesome' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">',
|
||||
'css-highlightjs' => '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/' . $highlightjs_style . '.min.css">',
|
||||
'js-ace' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.13.1/ace.js"></script>',
|
||||
'js-bootstrap' => '<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>',
|
||||
'js-dropzone' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.3/min/dropzone.min.js"></script>',
|
||||
'js-jquery' => '<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>',
|
||||
'js-jquery-datatables' => '<script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js" crossorigin="anonymous" defer></script>',
|
||||
'js-highlightjs' => '<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>',
|
||||
'pre-jsdelivr' => '<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"/>',
|
||||
'pre-cloudflare' => '<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin/><link rel="dns-prefetch" href="https://cdnjs.cloudflare.com"/>'
|
||||
);
|
||||
|
||||
// --- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL ---
|
||||
|
||||
// max upload file size
|
||||
@@ -243,7 +244,11 @@ if (defined('FM_EMBED')) {
|
||||
|
||||
//Generating CSRF Token
|
||||
if (empty($_SESSION['token'])) {
|
||||
if (function_exists('random_bytes')) {
|
||||
$_SESSION['token'] = bin2hex(random_bytes(32));
|
||||
} else {
|
||||
$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($auth_users)) {
|
||||
@@ -602,7 +607,7 @@ if ((isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_
|
||||
$use_curl = false;
|
||||
$temp_file = tempnam(sys_get_temp_dir(), "upload-");
|
||||
$fileinfo = new stdClass();
|
||||
$fileinfo->name = trim(basename($url), ".\x00..\x20");
|
||||
$fileinfo->name = trim(urldecode(basename($url)), ".\x00..\x20");
|
||||
|
||||
$allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false;
|
||||
$ext = strtolower(pathinfo($fileinfo->name, PATHINFO_EXTENSION));
|
||||
@@ -774,7 +779,7 @@ if (isset($_GET['copy'], $_GET['finish']) && !FM_READONLY) {
|
||||
$loop_count++;
|
||||
}
|
||||
if (fm_rcopy($from, $fn_duplicate, False)) {
|
||||
fm_set_msg(sprintf('Copyied from <b>%s</b> to <b>%s</b>', fm_enc($copy), fm_enc($fn_duplicate)));
|
||||
fm_set_msg(sprintf('Copied from <b>%s</b> to <b>%s</b>', fm_enc($copy), fm_enc($fn_duplicate)));
|
||||
} else {
|
||||
fm_set_msg(sprintf('Error while copying from <b>%s</b> to <b>%s</b>', fm_enc($copy), fm_enc($fn_duplicate)), 'error');
|
||||
}
|
||||
@@ -952,7 +957,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)) {
|
||||
@@ -969,7 +974,15 @@ if (!empty($_FILES) && !FM_READONLY) {
|
||||
if ($in) {
|
||||
if (PHP_VERSION_ID < 80009) {
|
||||
// workaround https://bugs.php.net/bug.php?id=81145
|
||||
while (!feof($in)) { fwrite($out, fread($in, 4096)); }
|
||||
do {
|
||||
for (;;) {
|
||||
$buff = fread($in, 4096);
|
||||
if ($buff === false || $buff === '') {
|
||||
break;
|
||||
}
|
||||
fwrite($out, $buff);
|
||||
}
|
||||
} while (!feof($in));
|
||||
} else {
|
||||
stream_copy_to_stream($in, $out);
|
||||
}
|
||||
@@ -1384,11 +1397,15 @@ if (isset($_GET['upload']) && !FM_READONLY) {
|
||||
toast('Error: Server Timeout');
|
||||
});
|
||||
}).on("success", function (res) {
|
||||
try {
|
||||
let _response = JSON.parse(res.xhr.response);
|
||||
|
||||
if(_response.status == "error") {
|
||||
toast(_response.info);
|
||||
}
|
||||
} catch (e) {
|
||||
toast("Error: Invalid JSON response");
|
||||
}
|
||||
}).on("error", function(file, response) {
|
||||
toast(response);
|
||||
});
|
||||
@@ -1633,7 +1650,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));
|
||||
}
|
||||
@@ -1715,7 +1732,7 @@ if (isset($_GET['view'])) {
|
||||
// Image info
|
||||
if ($is_image) {
|
||||
$image_size = getimagesize($file_path);
|
||||
echo lng('Image sizes').': ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '<br>';
|
||||
echo '<strong>'.lng('Image size').':</strong> ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '<br>';
|
||||
}
|
||||
// Text info
|
||||
if ($is_text) {
|
||||
@@ -1832,7 +1849,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));
|
||||
}
|
||||
@@ -2235,7 +2252,6 @@ fm_show_footer();
|
||||
/**
|
||||
* It prints the css/js files into html
|
||||
* @param key The key of the external file to print.
|
||||
* @return The value of the key in the array.
|
||||
*/
|
||||
function print_external($key) {
|
||||
global $external;
|
||||
@@ -2250,7 +2266,7 @@ function print_external($key) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify CSRF TOKEN and remove after cerify
|
||||
* Verify CSRF TOKEN and remove after certified
|
||||
* @param string $token
|
||||
* @return bool
|
||||
*/
|
||||
@@ -2838,6 +2854,7 @@ function fm_get_file_icon_class($path)
|
||||
case 'map':
|
||||
case 'lock':
|
||||
case 'dtd':
|
||||
case 'ps1':
|
||||
$img = 'fa fa-file-code-o';
|
||||
break;
|
||||
case 'txt':
|
||||
@@ -2864,12 +2881,18 @@ function fm_get_file_icon_class($path)
|
||||
$img = 'fa fa-css3';
|
||||
break;
|
||||
case 'bz2':
|
||||
case 'tbz2':
|
||||
case 'tbz':
|
||||
case 'zip':
|
||||
case 'rar':
|
||||
case 'gz':
|
||||
case 'tgz':
|
||||
case 'tar':
|
||||
case '7z':
|
||||
case 'xz':
|
||||
case 'txz':
|
||||
case 'zst':
|
||||
case 'tzst':
|
||||
$img = 'fa fa-file-archive-o';
|
||||
break;
|
||||
case 'php':
|
||||
@@ -3024,7 +3047,7 @@ function fm_get_text_exts()
|
||||
'eml', 'msg', 'csv', 'bat', 'twig', 'tpl', 'md', 'gitignore', 'less', 'sass', 'scss', 'c', 'cpp', 'cs', 'py', 'go', 'zsh', 'swift',
|
||||
'map', 'lock', 'dtd', 'svg', 'asp', 'aspx', 'asx', 'asmx', 'ashx', 'jsp', 'jspx', 'cgi', 'dockerfile', 'ruby', 'yml', 'yaml', 'toml',
|
||||
'vhost', 'scpt', 'applescript', 'csx', 'cshtml', 'c++', 'coffee', 'cfm', 'rb', 'graphql', 'mustache', 'jinja', 'http', 'handlebars',
|
||||
'java', 'es', 'es6', 'markdown', 'wiki', 'tmp', 'top', 'bot', 'dat', 'bak', 'htpasswd', 'pl'
|
||||
'java', 'es', 'es6', 'markdown', 'wiki', 'tmp', 'top', 'bot', 'dat', 'bak', 'htpasswd', 'pl', 'ps1'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3554,7 +3577,7 @@ function fm_show_nav_path($path)
|
||||
<ul class="navbar-nav justify-content-end <?php echo fm_get_theme(); ?>">
|
||||
<li class="nav-item mr-2">
|
||||
<div class="input-group input-group-sm mr-1" style="margin-top:4px;">
|
||||
<input type="text" class="form-control" placeholder="<?php echo lng('Filter') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
|
||||
<input type="text" class="form-control" placeholder="<?php echo lng('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text brl-0 brr-0" id="search-addon2"><i class="fa fa-search"></i></span>
|
||||
</div>
|
||||
@@ -4167,7 +4190,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
||||
if(_data && _data.fontSize) { $fontSizeEl.html(optionNode("", _data.fontSize)); }
|
||||
$modeEl.val( editor.getSession().$modeId );
|
||||
$themeEl.val( editor.getTheme() );
|
||||
$fontSizeEl.val(12).change(); //set default font size in drop down
|
||||
$(function() { $fontSizeEl.val(12).change(); }); //set default font size in drop down
|
||||
}
|
||||
|
||||
$(function(){
|
||||
@@ -4274,6 +4297,8 @@ function lng($txt) {
|
||||
$tr['en']['Invalid characters in file or folder name'] = 'Invalid characters in file or folder name';
|
||||
$tr['en']['Operations with archives are not available'] = 'Operations with archives are not available';
|
||||
$tr['en']['File or folder with this path already exists'] = 'File or folder with this path already exists';
|
||||
$tr['en']['Are you sure want to rename?'] = 'Are you sure want to rename?';
|
||||
$tr['en']['Are you sure want to'] = 'Are you sure want to';
|
||||
|
||||
$i18n = fm_get_translations($tr);
|
||||
$tr = $i18n ? $i18n : $tr;
|
||||
|
@@ -1512,7 +1512,9 @@
|
||||
"Moved from": "Movido de",
|
||||
"Created": "Criado",
|
||||
"You are logged in": "Você está logado",
|
||||
"Login failed. Invalid username or password": "Falha na autenticação. nome de usuário ou senha inválidos"
|
||||
"Login failed. Invalid username or password": "Falha na autenticação. nome de usuário ou senha inválidos",
|
||||
"Are you sure want to rename?": "Tem certeza de que deseja renomear?",
|
||||
"Are you sure want to": "Tem certeza de que deseja"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -2556,7 +2558,9 @@
|
||||
"Select Theme": "Kies thema",
|
||||
"Select Font Size": "Kies fontgrootte",
|
||||
"Are you sure want to rename?": "Weet u zeker dat u de naam wilt wijzigen?",
|
||||
"Are you sure want to": "Verder gaan met"
|
||||
"Are you sure want to": "Verder gaan met",
|
||||
"dark": "donker",
|
||||
"light": "licht"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user