1
0
mirror of https://github.com/prasathmani/tinyfilemanager.git synced 2025-08-06 16:57:11 +02:00

35 Commits

Author SHA1 Message Date
Prasath Mani
4777022e13 Update SECURITY.md 2024-09-16 11:17:33 +05:30
Randy Garrison
0f58c2ca65 Add powershell file extension to text format for opening in editor. (#1228) 2024-09-10 03:39:29 +05:30
Caleb Mazalevskis
b602dcd172 Fix typos. (#1214) 2024-08-04 12:08:43 +05:30
Daniel Dias Rodrigues
1bcc240119 Added missing translatable string. Update pt-br translation. (#1204) 2024-07-05 04:43:26 +05:30
Awais
8b330b75a4 Update default font size to in jQuery initialization (#1200) 2024-06-24 08:13:07 +05:30
Prasath Mani
f120daa607 Update README.md 2024-06-06 09:23:44 +05:30
Prasath Mani
e27e1abeb4 remove email address 2024-06-06 09:20:20 +05:30
Fannie MC
a4d96e0eaf Add JSON Parse Error Handling in Upload Script (#1196)
* Add JSON Parse Error Handling in Upload Script

* Update tinyfilemanager.php

* Update tinyfilemanager.php
2024-05-31 09:45:09 +05:30
Prasath Mani
843e240757 Update tinyfilemanager.php 2024-05-28 06:50:00 +05:30
Prasath Mani
ecec756b71 Update tinyfilemanager.php 2024-05-28 04:51:37 +05:30
Daniel Dias Rodrigues
8366e1bc29 Expanded the list of files recognized as compressed (#1193) 2024-05-27 09:29:54 +05:30
Ijor Tengab
d8fceac7dd Fix #963 (#969) 2024-05-27 09:27:33 +05:30
Mahyar Damavand
a306f4f1f7 Add --no-cache to 'apk add' command in order to reduce docker image size (#1191) 2024-05-26 10:39:06 +05:30
BANKA2017
a1ae0fa729 fix: #52 Does not respect directory tree while uploading a folder containing sub-folders (#1056) 2024-05-01 10:01:27 +05:30
Torusrxxx
ca4b1b1743 Disable excluded extension name from viewing (#1151) 2024-03-25 11:09:24 +05:30
Michele Locati
8e87afae5b Fix wrong phpdoc of print_external() (#1091) 2023-09-14 15:05:36 +05:30
Tony Ganesh Prajapati
43063e4746 Update tinyfilemanager.php (#1086)
changing String "Filter" to "Search"
2023-08-28 12:29:45 +05:30
AJ.Bassa
47359d3f4e Update translation.json (#1083)
Updated Dutch translation
2023-08-11 01:14:37 +05:30
paponius
eb8f3d80bc random_bytes() only for >PHP7 (#1066) 2023-06-29 07:31:24 +05:30
ner0
f380478197 Typo & make text bold (#1042)
* Fix typo

* Make text bold for consistency

Also dropping the plural 's'
2023-05-16 08:17:43 +05:30
divinity76
f7a2f77008 reduce feof() calls (#1041)
micro-optimization: when doing large file copies, this will reduce the number of feof() calls. for example, if copying 100MB, this will save approximately 25,599 feof() calls (255 feof() calls for every MB) - also feofs() may do an actual syscall, and syscalls are relatively expensive/time-consuming.
2023-05-15 09:53:25 +05:30
Bryan
dabc4ea36e Fix highlightjs_style in config.php being ignored (#1039)
highlightjs_style variable is being used before config.php gets parsed, so preview style is always vs. This PR fixes that by moving config.php parsing to be before external resource calls.
2023-05-11 09:55:15 +05:30
ner0
7ec19c1659 Resize preview image and implement zoom in/out (#1036)
* Resize preview image and implement zoom in/out

* Remove redundant class name
2023-05-03 14:11:59 +05:30
DannyDaemonic
8486c7a240 Add configurable path display modes for better privacy and clarity (#1034) 2023-04-26 20:46:52 +05:30
xololunatic
8194249b66 login (Redirecting to Main domain of website instead of tfm.php) fix (#1031)
When logged in it takes to the website's main URL. For example, if I have tfm in www.example.com/tfm/index.php (index.php is tfm) then after logging in it redirects to www.example.com and then have to press back on the browser then it takes to www.example.com/tfm/index.php
2023-04-24 07:00:47 +05:30
Caleb Mazalevskis
da77df785a Fix typo. (#1028) 2023-04-23 19:59:23 +05:30
Micha Ober
00541fc469 Fix upload of existing files (#1026) 2023-04-21 19:21:31 +05:30
Joy Biswas
7ca87c9163 added bengali translation (#1018) 2023-04-21 10:06:09 +05:30
divinity76
f6a93653be use stream_copy_to_stream (#1014)
* use stream_copy_to_stream

it's simpler, and should be faster.
For example, stream_copy_to_stream can use sendfile ( https://man7.org/linux/man-pages/man2/sendfile.2.html ) on operating systems supporting it, which is faster and use less RAM than fread()+fwrite() (because it avoids copying data to/from userland, doing the copy entirely in-kernel~)

* fix loop early return, and workaround bug

* use feof

ref https://github.com/prasathmani/tinyfilemanager/issues/1016#issuecomment-1502081506
2023-04-21 10:05:45 +05:30
Micha Ober
85f35bc28f Check if posix_getpwuid/posix_getgrgid calls were successful (#1023) 2023-04-21 10:03:20 +05:30
divinity76
3a90a5916a tell git to always commit .php in unix-newlines (#1017)
so hopefully we don't get a repeat of https://github.com/prasathmani/tinyfilemanager/pull/994#issuecomment-1502035505
2023-04-11 07:51:47 +05:30
ner0
6a6eb8abec Prevent logout issue after page was cached (#1004)
Logout may not work otherwise, browser reloads cached page from disk instead of sending GET request ?logout=1 to server.
2023-03-31 04:16:23 +05:30
Prasath Mani
bf024c7c84 Update tinyfilemanager.php 2023-03-17 10:22:19 +05:30
Sergiu Bivol
d705da604c Update Romanian translations (#981) 2023-02-26 21:18:19 +05:30
ssams
94f1c92d80 publish additional docker tags (#975) 2023-02-22 13:06:26 +05:30
25 changed files with 314 additions and 4199 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
*.php text eol=lf
*.json text eol=lf

View File

@@ -13,7 +13,7 @@ jobs:
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/tinyfilemanager
@@ -21,6 +21,8 @@ jobs:
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
@@ -35,4 +37,5 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -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

View File

@@ -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/)

View File

@@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4,8 +4,7 @@ $CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":
/**
* H3K | Tiny File Manager V2.5.3
* @author Prasath Mani | CCP Programmers
* @email ccpprogrammers@gmail.com
* @author CCP Programmers
* @github https://github.com/prasathmani/tinyfilemanager
* @link https://tinyfilemanager.github.io
*/
@@ -77,6 +76,12 @@ $iconv_input_encoding = 'UTF-8';
// Doc - https://www.php.net/manual/en/function.date.php
$datetime_format = 'm/d/Y g:i A';
// Path display mode when viewing file information
// 'full' => show full path
// 'relative' => show path relative to root_path
// 'host' => show path on the host
$path_display_mode = 'full';
// Allowed file extensions for create and rename files
// e.g. 'txt,html,css,js'
$allowed_file_extensions = '';
@@ -95,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
@@ -136,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';
@@ -157,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
@@ -220,7 +227,7 @@ if (defined('FM_EMBED')) {
mb_regex_encoding('UTF-8');
}
session_cache_limiter('');
session_cache_limiter('nocache'); // Prevent logout issue after page was cached
session_name(FM_SESSION_ID );
function session_error_handling_function($code, $msg, $file, $line) {
// Permission denied for default session, try to create a new one
@@ -235,9 +242,13 @@ if (defined('FM_EMBED')) {
restore_error_handler();
}
//Genrating CSRF Token
//Generating CSRF Token
if (empty($_SESSION['token'])) {
$_SESSION['token'] = bin2hex(random_bytes(32));
if (function_exists('random_bytes')) {
$_SESSION['token'] = bin2hex(random_bytes(32));
} else {
$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));
}
}
if (empty($auth_users)) {
@@ -320,11 +331,11 @@ if ($use_auth) {
if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) && verifyToken($_POST['token'])) {
$_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr'];
fm_set_msg(lng('You are logged in'));
fm_redirect(FM_ROOT_URL);
fm_redirect(FM_SELF_URL);
} else {
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_set_msg(lng('Login failed. Invalid username or password'), 'error');
fm_redirect(FM_ROOT_URL);
fm_redirect(FM_SELF_URL);
}
} else {
fm_set_msg(lng('password_hash not supported, Upgrade PHP version'), 'error');;
@@ -596,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));
@@ -768,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');
}
@@ -912,7 +923,6 @@ if (!empty($_FILES) && !FM_READONLY) {
echo json_encode($response); exit();
}
$override_file_name = false;
$chunkIndex = $_POST['dzchunkindex'];
$chunkTotal = $_POST['dztotalchunkcount'];
$fullPathInput = fm_clean_path($_REQUEST['fullpath']);
@@ -947,14 +957,9 @@ 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(file_exists ($fullPath) && !$override_file_name && !$chunks) {
$ext_1 = $ext ? '.'.$ext : '';
$fullPath = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1;
}
if (!is_dir($folder)) {
$old = umask(0);
mkdir($folder, 0777, true);
@@ -967,7 +972,20 @@ if (!empty($_FILES) && !FM_READONLY) {
if ($out) {
$in = @fopen($tmp_name, "rb");
if ($in) {
while ($buff = fread($in, 4096)) { fwrite($out, $buff); }
if (PHP_VERSION_ID < 80009) {
// workaround https://bugs.php.net/bug.php?id=81145
do {
for (;;) {
$buff = fread($in, 4096);
if ($buff === false || $buff === '') {
break;
}
fwrite($out, $buff);
}
} while (!feof($in));
} else {
stream_copy_to_stream($in, $out);
}
$response = array (
'status' => 'success',
'info' => "file upload successful"
@@ -995,7 +1013,13 @@ if (!empty($_FILES) && !FM_READONLY) {
}
if ($chunkIndex == $chunkTotal - 1) {
rename("{$fullPath}.part", $fullPath);
if (file_exists ($fullPath)) {
$ext_1 = $ext ? '.'.$ext : '';
$fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1;
} else {
$fullPathTarget = $fullPath;
}
rename("{$fullPath}.part", $fullPathTarget);
}
} else if (move_uploaded_file($tmp_name, $fullPath)) {
@@ -1373,10 +1397,14 @@ if (isset($_GET['upload']) && !FM_READONLY) {
toast('Error: Server Timeout');
});
}).on("success", function (res) {
let _response = JSON.parse(res.xhr.response);
try {
let _response = JSON.parse(res.xhr.response);
if(_response.status == "error") {
toast(_response.info);
if(_response.status == "error") {
toast(_response.info);
}
} catch (e) {
toast("Error: Invalid JSON response");
}
}).on("error", function(file, response) {
toast(response);
@@ -1622,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));
}
@@ -1677,7 +1705,8 @@ if (isset($_GET['view'])) {
<div class="col-12">
<p class="break-word"><b><?php echo lng($view_title) ?> "<?php echo fm_enc(fm_convert_win($file)) ?>"</b></p>
<p class="break-word">
<strong>Full path:</strong> <?php echo fm_enc(fm_convert_win($file_path)) ?><br>
<?php $display_path = fm_get_display_path($file_path); ?>
<strong><?php echo $display_path['label']; ?>:</strong> <?php echo $display_path['path']; ?><br>
<strong>File size:</strong> <?php echo ($filesize_raw <= 1000) ? "$filesize_raw bytes" : $filesize; ?><br>
<strong>MIME-type:</strong> <?php echo $mime_type ?><br>
<?php
@@ -1703,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) {
@@ -1776,7 +1805,7 @@ if (isset($_GET['view'])) {
} elseif ($is_image) {
// Image content
if (in_array($ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))) {
echo '<p><img src="' . fm_enc($file_url) . '" alt="image" class="preview-img-container" class="preview-img"></p>';
echo '<p><input type="checkbox" id="preview-img-zoomCheck"><label for="preview-img-zoomCheck"><img src="' . fm_enc($file_url) . '" alt="image" class="preview-img"></label></p>';
}
} elseif ($is_audio) {
// Audio content
@@ -1820,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));
}
@@ -1936,7 +1965,8 @@ if (isset($_GET['chmod']) && !FM_READONLY && !FM_IS_WIN) {
</h6>
<div class="card-body">
<p class="card-text">
Full path: <?php echo $file_path ?><br>
<?php $display_path = fm_get_display_path($file_path); ?>
<?php echo $display_path['label']; ?>: <?php echo $display_path['path']; ?><br>
</p>
<form action="" method="post">
<input type="hidden" name="p" value="<?php echo fm_enc(FM_PATH) ?>">
@@ -2049,6 +2079,12 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
if (function_exists('posix_getpwuid') && function_exists('posix_getgrgid')) {
$owner = posix_getpwuid(fileowner($path . '/' . $f));
$group = posix_getgrgid(filegroup($path . '/' . $f));
if ($owner === false) {
$owner = array('name' => '?');
}
if ($group === false) {
$group = array('name' => '?');
}
} else {
$owner = array('name' => '?');
$group = array('name' => '?');
@@ -2102,6 +2138,12 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
if (function_exists('posix_getpwuid') && function_exists('posix_getgrgid')) {
$owner = posix_getpwuid(fileowner($path . '/' . $f));
$group = posix_getgrgid(filegroup($path . '/' . $f));
if ($owner === false) {
$owner = array('name' => '?');
}
if ($group === false) {
$group = array('name' => '?');
}
} else {
$owner = array('name' => '?');
$group = array('name' => '?');
@@ -2210,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;
@@ -2225,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
*/
@@ -2495,6 +2536,30 @@ function fm_get_parent_path($path)
return false;
}
function fm_get_display_path($file_path)
{
global $path_display_mode, $root_path, $root_url;
switch ($path_display_mode) {
case 'relative':
return array(
'label' => 'Path',
'path' => fm_enc(fm_convert_win(str_replace($root_path, '', $file_path)))
);
case 'host':
$relative_path = str_replace($root_path, '', $file_path);
return array(
'label' => 'Host Path',
'path' => fm_enc(fm_convert_win('/' . $root_url . '/' . ltrim(str_replace('\\', '/', $relative_path), '/')))
);
case 'full':
default:
return array(
'label' => 'Full Path',
'path' => fm_enc(fm_convert_win($file_path))
);
}
}
/**
* Check file is in exclude list
* @param string $file
@@ -2789,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':
@@ -2815,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':
@@ -2975,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'
);
}
@@ -3505,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>
@@ -3703,7 +3775,9 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
.message.ok { border-color:green;color:green }
.message.error { border-color:red;color:red }
.message.alert { border-color:orange;color:orange }
.preview-img { max-width:100%;max-height:80vh;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKklEQVR42mL5//8/Azbw+PFjrOJMDCSCUQ3EABZc4S0rKzsaSvTTABBgAMyfCMsY4B9iAAAAAElFTkSuQmCC) }
.preview-img { max-width:100%;max-height:80vh;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKklEQVR42mL5//8/Azbw+PFjrOJMDCSCUQ3EABZc4S0rKzsaSvTTABBgAMyfCMsY4B9iAAAAAElFTkSuQmCC);cursor:zoom-in }
input#preview-img-zoomCheck[type=checkbox] { display:none }
input#preview-img-zoomCheck[type=checkbox]:checked ~ label > img { max-width:none;max-height:none;cursor:zoom-out }
.inline-actions > a > i { font-size:1em;margin-left:5px;background:#3785c1;color:#fff;padding:3px 4px;border-radius:3px; }
.preview-video { position:relative;max-width:100%;height:0;padding-bottom:62.5%;margin-bottom:10px }
.preview-video video { position:absolute;width:100%;height:100%;left:0;top:0;background:#000 }
@@ -4116,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(){
@@ -4223,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;

View File

@@ -8,79 +8,79 @@
"translation": {
"AppName": "Tiny File Manager",
"AppTitle": "Titlu aplicație",
"Login": "Logare",
"Login": "Autentificare",
"Username": "Nume utilizator",
"Password": "Parola",
"Logout": "Delogare",
"Password": "Parolă",
"Logout": "Ieșire",
"Move": "Mută",
"Copy": "Copiază",
"Save": "Salvează",
"SelectAll": "Selectează Tot",
"UnSelectAll": "Deselectează Tot",
"SelectAll": "Selectează tot",
"UnSelectAll": "Deselectează tot",
"File": "Fișier",
"Back": "Înapoi",
"Size": "Mărime",
"Size": "Dimensiune",
"Perms": "Permisiuni",
"Modified": "Modificat",
"Owner": "Titular",
"Owner": "Proprietar",
"Search": "Caută",
"NewItem": "Nou",
"Folder": "Dosar",
"Delete": "Șterge",
"Rename": "Redenumește",
"CopyTo": "Copiază În",
"DirectLink": "Link Direct",
"UploadingFiles": "Încarcă Fișiere",
"ChangePermissions": "Schimbă Permisiuni",
"Copying": "Copiază",
"CreateNewItem": "Creează Obiect Nou",
"Name": "Nume",
"AdvancedEditor": "Editor Avansat",
"RememberMe": "Ține-mă Minte",
"CopyTo": "Copiază în",
"DirectLink": "Legătură directă",
"UploadingFiles": "Se încarcă fișiere",
"ChangePermissions": "Schimbă permisiunile",
"Copying": "Se copiază",
"CreateNewItem": "Creează element nou",
"Name": "Denumire",
"AdvancedEditor": "Redactor avansat",
"RememberMe": "Ține-mă minte",
"Actions": "Acțiuni",
"Upload": "Încarcă",
"Cancel": "Anulează",
"InvertSelection": "Selectare Inversă",
"DestinationFolder": "Dosar Destinație",
"ItemType": "Tip Obiect",
"ItemName": "Nume obiect",
"CreateNow": "Creează Acum",
"InvertSelection": "Inversează selecția",
"DestinationFolder": "Dosar destinație",
"ItemType": "Tip element",
"ItemName": "Denumire element",
"CreateNow": "Creează acum",
"Download": "Descarcă",
"Open": "Deschide",
"UnZip": "Decomprimă",
"UnZipToFolder": "Decomprimă în Dosar",
"Edit": "Editează",
"NormalEditor": "Editor Standard",
"BackUp": "Copie de Siguranță",
"SourceFolder": "Dosar Sursă",
"UnZipToFolder": "Decomprimă în dosar",
"Edit": "Modifică",
"NormalEditor": "Redactor standard",
"BackUp": "Copie de rezervă",
"SourceFolder": "Dosar sursă",
"Files": "Fișiere",
"Change": "Schimbă",
"Settings": "Setari",
"Settings": "Configurări",
"Language": "Limba",
"MemoryUsed": "Memorie Utilizată",
"PartitionSize": "Dimensiune Partiție",
"ErrorReporting": "Raportare de Erori",
"ShowHiddenFiles": "Arată Fișiere Ascunse",
"Full size": "Dimensiune Totală",
"MemoryUsed": "Memorie utilizată",
"PartitionSize": "Dimensiune partiție",
"ErrorReporting": "Raportare erori",
"ShowHiddenFiles": "Arată fișiere ascunse",
"Full size": "Dimensiune totală",
"Help": "Ajutor",
"Free of": "Liber din",
"Preview": "Previzualizează",
"Help Documents": "Documentație",
"Report Issue": "Raportează o Problemă",
"Report Issue": "Raportează defect",
"Generate": "Generează",
"FullSize": "Mărime Maximă",
"FullSize": "Dimensiune completă",
"FreeOf": "Liber din",
"CalculateFolderSize": "Calculează spațiul acupat de dosar",
"ProcessID": "Id instanță",
"CalculateFolderSize": "Calculează dimensiunea dosarului",
"ProcessID": "Id. proces",
"Created": "Creat",
"HideColumns": "Ascunde Coloanele",
"HideColumns": "Ascunde coloanele",
"Folder is empty": "Dosarul este gol",
"Check Latest Version": "Verifică ultima versiune",
"Generate new password hash": "Generează hash nou parolă",
"You are logged in": "Sunteti logat/ă",
"Login failed. Invalid username or password": "Autentificare eșuată. Credențialele nu sunt valide (utilizator/parolă)",
"password_hash not supported, Upgrade PHP version": "Generare hash parolă nesuportată, actualizați interpretorul PHP de pe server",
"Theme": "Tema",
"You are logged in": "Sunteți autentificat",
"Login failed. Invalid username or password": "Autentificare eșuată. Utilizator sau parolă incorecte",
"password_hash not supported, Upgrade PHP version": "Generare hash parolă nesuportată, actualizați versiunea de PHP",
"Theme": "Tematică",
"dark": "Întunecată",
"light": "Luminoasă"
}
@@ -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"
}
},
{
@@ -2532,14 +2534,14 @@
"Operations with archives are not available": "Bewerkingen met archieven zijn niet beschikbaar",
"File or folder with this path already exists": "Bestand of map met dit pad bestaat al",
"Moved from": "Verplaatst van",
"a files": "bestanden",
"a files": "bestanden",
"Okay": "OK",
"Enter here...": "Voer hier in...",
"Enter new file name": "Voer nieuwe bestandsnaam in:",
"Enter new file name": "Voer nieuwe bestandsnaam in:",
"Full path": "Volledig path",
"File size": "Bestandsgrootte",
"Image sizes": "Afbeeldingsgrootte",
"Charset": "Karakterset",
"Charset": "Karakterset",
"Image": "Afbeelding",
"Audio": "Audio",
"Video": "Video",
@@ -2547,16 +2549,18 @@
"Files in archive": "Bestanden in archief",
"Total size": "Totale grootte",
"Compression": "Compressie",
"Size in archive": "Grootte in archief",
"Size in archive": "Grootte in archief",
"Invalid Token.": "Ongeldig token",
"Fullscreen": "Volledig scherm",
"Fullscreen": "Volledig scherm",
"Undo": "Ongedaan maken",
"Redo": "Opnieuw doen",
"Theme": "Thema",
"Theme": "Thema",
"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"
"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",
"dark": "donker",
"light": "licht"
}
},
{
@@ -2682,6 +2686,130 @@
"password_hash not supported, Upgrade PHP version": "password_hash er ikke understøttet, opgrader PHP-versionen",
"to": "til"
}
},
{
"name": "Bengali",
"code": "bn",
"translation": {
"Access denied. IP restriction applicable": "অ্যাক্সেস অস্বীকার করা হয়েছে৷ আইপি সীমাবদ্ধতা প্রযোজ্য",
"Actions": "একশন্স",
"Advanced Search": "উন্নত অনুসন্ধান",
"AdvancedEditor": "উন্নত এডিটর",
"AppTitle": "ফাইল ম্যানেজার",
"Archive not created": "আর্কাইভ তৈরি করা হয়নি",
"Archive not unpacked": "আর্কাইভ প্যাক করা হয়নি",
"Archive unpacked": "আর্কাইভ আনপ্যাক",
"Archive": "আর্কাইভ",
"Back": "পেছনে",
"BackUp": "ব্যাকআপ",
"CalculateFolderSize": "ফোল্ডার সাইজ গণনা করুন",
"Cancel": "বাতিল করুন",
"Change": "পরিবর্তন",
"ChangePermissions": "অনুমতি পরিবর্তন করুন",
"Check Latest Version": "সর্বশেষ সংস্করণ পরীক্ষা করুন",
"Copied from": "থেকে কপি করা হয়েছে",
"Copy": "কপি",
"CopyTo": "কপি করুন",
"Copying": "কপি করা হচ্ছে",
"Create archive?": "নতুন আর্কাইভ তৈরি করুন",
"CreateNewItem": "নতুন আইটেম তৈরি করুন",
"CreateNow": "এখন তৈরি করুন",
"Created": "তৈরি করা হয়েছে",
"Delete selected files and folders?": "নির্বাচিত ফাইল এবং ফোল্ডার মুছবেন?",
"Delete": "মুছে ফেলা",
"Deleted": "মুছে ফেলা হয়েছে",
"DestinationFolder": "গন্তব্য ফোল্ডার",
"DirectLink": "সরাসরি লিঙ্ক",
"Download": "ডাউনলোড",
"Edit": "এডিট",
"Error while copying from": "থেকে কপি করার সময় ত্রুটি",
"Error while deleting items": "থেকে মুছে ফেলার সময় ত্রুটি",
"Error while fetching archive info": "আর্কাইভ তথ্য আনার সময় ত্রুটি",
"Error while moving from": "থেকে সরানোর সময় ত্রুটি",
"Error while renaming from": "থেকে নাম পরিবর্তন করার সময় ত্রুটি",
"ErrorReporting": "এরর রিপোর্টিং",
"Execute": "এক্সিকিউট",
"FILE EXTENSION HAS NOT SUPPORTED": "ফাইল এক্সটেনশন সমর্থিত নয়",
"File Saved Successfully": "ফাইল সফলভাবে সংরক্ষিত হয়েছে৷",
"File extension is not allowed": "ফাইল এক্সটেনশন অনুমোদিত নয়",
"File not found": "ফাইল পাওয়া যায়নি",
"File or folder with this path already exists": "এই পথ সহ ফাইল বা ফোল্ডার ইতিমধ্যেই বিদ্যমান",
"File": "ফাইল",
"Files": "ফাইলস",
"Folder is empty": "ফোল্ডার খালি",
"Folder": "ফোল্ডার",
"FreeOf": "মুক্ত",
"FullSize": "ফুল সাইজ",
"Generate new password hash": "নতুন পাসওয়ার্ড হ্যাশ তৈরি করুন",
"Generate": "উৎপন্ন",
"Group": "গ্রুপ",
"Help Documents": "হেল্প ডকুমেন্টস",
"Help": "সাহায্য",
"HideColumns": "কলাম লুকান",
"Invalid characters in file name": "ফাইলের নামে অবৈধ অক্ষর",
"Invalid characters in file or folder name": "ফাইল বা ফোল্ডার নামের অবৈধ অক্ষর",
"Invalid file or folder name": "অবৈধ ফাইল বা ফোল্ডারের নাম",
"InvertSelection": "উল্টে নির্বাচন করুন",
"ItemName": "আইটেম নাম",
"ItemType": "আইটেম ধরন",
"Language": "ভাষা",
"Login failed. Invalid username or password": "লগইন ব্যর্থ. অবৈধ ব্যবহারকারীর নাম বা পাসওয়ার্ড",
"Login": "লগইন",
"Logout": "লগআউট",
"Modified": "পরিবর্তিত",
"Move": "সরান",
"Moved from": "থেকে সরানো",
"Name": "নাম",
"NewItem": "নতুন আইটেম",
"NormalEditor": "সাধারণ এডিটর",
"Nothing selected": "কিছুই নির্বাচিত নয়",
"Open": "খোলা",
"Operations with archives are not available": "আর্কাইভ সহ অপারেশন পাওয়া যায়নি",
"Other": "অন্যান্য",
"Owner": "মালিক",
"PartitionSize": "পার্টিশনের মাপ",
"Password": "পাসওয়ার্ড",
"Paths must be not equal": "পথ সমান হতে হবে না",
"Permissions changed": "অনুমতি পরিবর্তন",
"Permissions not changed": "অনুমতি পরিবর্তন করা হয়নি",
"Perms": "পারমস",
"Preview": "পূর্বরূপ",
"Read": "পড়ুন",
"Rename": "নাম পরিবর্তন করা হয়েছে",
"Renamed from": "থেকে নাম পরিবর্তন করা হয়েছে",
"Report Issue": "ইস্যুস রিপোর্ট করুন",
"Root path": "রুট পথ",
"Save": "সংরক্ষণ",
"Search file in folder and subfolders...": "ফোল্ডার এবং সাবফোল্ডারে ফাইল অনুসন্ধান করুন...",
"Search": "অনুসন্ধান করুন",
"Select folder": "ফোল্ডার নির্বাচন করুন",
"SelectAll": "সব নির্বাচন করুন",
"Selected files and folder deleted": "নির্বাচিত ফাইল এবং ফোল্ডার মুছে ফেলা হয়েছে",
"Settings": "সেটিংস",
"ShowHiddenFiles": "গোপন ফাইলগুলো দেখুন",
"Size": "সাইজ",
"Source path not defined": "সোর্স পথ সংজ্ঞায়িত করা হয়নি",
"SourceFolder": "সোর্স ফোল্ডার",
"Tar": "টার",
"Theme": "থিম",
"UnSelectAll": "সরিয়ে ফেলুন সব",
"UnZip": "আনজিপ করুন",
"UnZipToFolder": "ফোল্ডারে আনজিপ",
"Upload": "আপলোড",
"UploadingFiles": "ফাইল আপলোড করা হচ্ছে",
"Username": "ব্যবহারকারীর নাম",
"Write": "লিখুন",
"You are logged in": "আপনি লগ ইন করছেন",
"Zip": "জিপ",
"already exists": "আগে থেকেই আছে",
"dark": "ডার্ক",
"light": "লাইট",
"not created": "তৈরি করা হয়নি",
"not deleted": "মুছে ফেলা হয়নি",
"not found!": "পাওয়া যায় নি!",
"password_hash not supported, Upgrade PHP version": "পাসওয়ার্ড_হ্যাশ সমর্থিত নয়, পিএইচপি ভার্সন আপগ্রেড করুন",
"to": "to"
}
}
]
}