4 Commits

Author SHA1 Message Date
ner0
15fc685f96 Bring offline branch up to speed with master (#1037)
* publish additional docker tags (#975)

* Update Romanian translations (#981)

* Update tinyfilemanager.php

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

* 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

* Check if posix_getpwuid/posix_getgrgid calls were successful (#1023)

* 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

* added bengali translation (#1018)

* Fix upload of existing files (#1026)

* Fix typo. (#1028)

* 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

* Add configurable path display modes for better privacy and clarity (#1034)

* Resize preview image and implement zoom in/out (#1036)

* Resize preview image and implement zoom in/out

* Remove redundant class name

---------

Co-authored-by: ssams <6338356+ssams@users.noreply.github.com>
Co-authored-by: Sergiu Bivol <sergiu@cip.md>
Co-authored-by: Prasath Mani <prasathmani@users.noreply.github.com>
Co-authored-by: divinity76 <divinity76@gmail.com>
Co-authored-by: Micha Ober <github@ober-mail.de>
Co-authored-by: Joy Biswas <74253956+joybiswas007@users.noreply.github.com>
Co-authored-by: Micha Ober <git@ober-mail.de>
Co-authored-by: Caleb Mazalevskis <maikuolan@gmail.com>
Co-authored-by: xololunatic <97784387+xololunatic@users.noreply.github.com>
Co-authored-by: DannyDaemonic <DannyDaemonic@gmail.com>
2023-05-07 11:54:33 +05:30
Micha Ober
e179367cbc Fix filename for DataTables (#1024) 2023-04-21 10:04:14 +05:30
Prasath Mani
5738e8c164 Merge branch 'master' of https://github.com/prasathmani/tinyfilemanager into offline 2023-02-22 07:21:08 +05:30
Prasath Mani
6ae693b1fb Add 0FFL1NE support 2023-02-22 07:18:44 +05:30
20 changed files with 4117 additions and 36 deletions

File diff suppressed because one or more lines are too long

7
assets/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
assets/css/dropzone.min.css vendored Normal file

File diff suppressed because one or more lines are too long

4
assets/css/font-awesome.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
assets/css/vs.min.css vendored Normal file
View File

@@ -0,0 +1 @@
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

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

17
assets/js/ace.js Normal file

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 Normal file

File diff suppressed because one or more lines are too long

22
assets/js/datatables.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
assets/js/dropzone.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1361
assets/js/highlight.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
assets/js/jquery-3.6.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -142,6 +142,20 @@ $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';
@@ -149,22 +163,6 @@ 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
@@ -245,11 +243,7 @@ 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)) {
@@ -780,7 +774,7 @@ if (isset($_GET['copy'], $_GET['finish']) && !FM_READONLY) {
$loop_count++;
}
if (fm_rcopy($from, $fn_duplicate, False)) {
fm_set_msg(sprintf('Copied from <b>%s</b> to <b>%s</b>', fm_enc($copy), fm_enc($fn_duplicate)));
fm_set_msg(sprintf('Copyied 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');
}
@@ -975,15 +969,7 @@ if (!empty($_FILES) && !FM_READONLY) {
if ($in) {
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));
while (!feof($in)) { fwrite($out, fread($in, 4096)); }
} else {
stream_copy_to_stream($in, $out);
}
@@ -1729,7 +1715,7 @@ if (isset($_GET['view'])) {
// Image info
if ($is_image) {
$image_size = getimagesize($file_path);
echo '<strong>'.lng('Image size').':</strong> ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '<br>';
echo lng('Image sizes').': ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '<br>';
}
// Text info
if ($is_text) {
@@ -2249,6 +2235,7 @@ 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;
@@ -3567,7 +3554,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('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
<input type="text" class="form-control" placeholder="<?php echo lng('Filter') ?>" 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>

View File

@@ -2556,9 +2556,7 @@
"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",
"dark": "donker",
"light": "licht"
"Are you sure want to": "Verder gaan met"
}
},
{