diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 94246b8..2a75033 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -3,21 +3,26 @@ $CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false}'; /** - * H3K | Tiny File Manager V2.3.8 + * H3K | Tiny File Manager V2.4.0 * CCP Programmers | ccpprogrammers@gmail.com * https://tinyfilemanager.github.io */ //TFM version -define('VERSION', '2.3.9'); +define('VERSION', '2.4.0'); //Application Title define('APP_TITLE', 'Tiny File Manager'); -// Auth with login/password (set true/false to enable/disable it) +// --- EDIT BELOW CONFIGURATION CAREFULLY --- + + +// Auth with login/password +// set true/false to enable/disable it // Is independent from IP white- and blacklisting $use_auth = true; +// Login user name and password // Users: array('Username' => 'Password', 'Username2' => 'Password2', ...) // Generate secure password hash - https://tinyfilemanager.github.io/docs/pwd.html $auth_users = array( @@ -25,11 +30,81 @@ $auth_users = array( 'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345 ); -// Readonly users (username array) +// Readonly users +// e.g. array('users', 'guest', ...) $readonly_users = array( 'user' ); +// user specific directories +// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) +$directories_users = array(); + +// Enable highlight.js (https://highlightjs.org/) on view's page +$use_highlightjs = true; + +// highlight.js style +$highlightjs_style = 'vs'; + +// Enable ace.js (https://ace.c9.io/) on view's page +$edit_files = true; + +// Default timezone for date() and time() +// Doc - http://php.net/manual/en/timezones.php +$default_timezone = 'Etc/UTC'; // UTC + +// Root path for file manager +// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder' +$root_path = $_SERVER['DOCUMENT_ROOT']; + +// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder' +// Will not working if $root_path will be outside of server document root +$root_url = ''; + +// Server hostname. Can set manually if wrong +$http_host = $_SERVER['HTTP_HOST']; + +// input encoding for iconv +$iconv_input_encoding = 'UTF-8'; + +// date() format for file modification date +// Doc - https://www.php.net/manual/en/function.date.php +$datetime_format = 'd.m.y H:i'; + +// Allowed file extensions for create and rename files +// e.g. 'txt,html,css,js' +$allowed_file_extensions = ''; + +// Allowed file extensions for upload files +// e.g. 'gif,png,jpg,html,txt' +$allowed_upload_extensions = ''; + +// Favicon path. This can be either a full url to an .PNG image, or a path based on the document root. +// full path, e.g http://example.com/favicon.png +// local path, e.g images/icons/favicon.png +$favicon_path = '?img=favicon'; + +// Files and folders to excluded from listing +// e.g. array('myfile.html', 'personal-folder', '*.php', ...) +$exclude_items = array(); + +// Online office Docs Viewer +// Availabe rules are 'google', 'microsoft' or false +// google => View documents using Google Docs Viewer +// microsoft => View documents using Microsoft Web Apps Viewer +// false => disable online dov viewer +$online_viewer = 'google'; + +// Sticky Nav bar +// true => enable sticky header +// false => disable sticky header +$sticky_navbar = true; + +// Maximum file upload size +// Increase the following values in php.ini to work properly +// memory_limit, upload_max_filesize, post_max_size +define('MAX_UPLOAD_SIZE', '2048'); + // Possible rules are 'OFF', 'AND' or 'OR' // OFF => Don't check connection IP, defaults to OFF // AND => Connection must be on the whitelist, and not on the blacklist @@ -51,68 +126,7 @@ $ip_blacklist = array( '::' // non-routable meta ipv6 ); -// user specific directories -// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) -$directories_users = array(); - -// Enable highlight.js (https://highlightjs.org/) on view's page -$use_highlightjs = true; - -// highlight.js style -$highlightjs_style = 'vs'; - -// Enable ace.js (https://ace.c9.io/) on view's page -$edit_files = true; - -// Default timezone for date() and time() - http://php.net/manual/en/timezones.php -$default_timezone = 'Etc/UTC'; // UTC - -// Root path for file manager -// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder' -$root_path = $_SERVER['DOCUMENT_ROOT']; - -// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder' -// Will not working if $root_path will be outside of server document root -$root_url = ''; - -// Server hostname. Can set manually if wrong -$http_host = $_SERVER['HTTP_HOST']; - -// input encoding for iconv -$iconv_input_encoding = 'UTF-8'; - -// date() format for file modification date -$datetime_format = 'd.m.y H:i'; - -// allowed file extensions for upload and rename -// e.g. 'gif,png,jpg' -$allowed_extensions = ''; - -// Favicon path. This can be either a full url to an .PNG image, or a path based on the document root. -// full path, e.g http://example.com/favicon.png -// local path, e.g images/icons/favicon.png -$favicon_path = '?img=favicon'; - -// Array of files and folders excluded from listing -// e.r array('myfile.html', 'personal-folder') -$GLOBALS['exclude_items'] = array(); - -// Online office Docs Viewer -// Availabe rules are 'google', 'microsoft' or false -// google => View documents using Google Docs Viewer -// microsoft => View documents using Microsoft Web Apps Viewer -// false => disable online dov viewer -$GLOBALS['online_viewer'] = 'google'; - -// Sticky Nav bar -// true => enable sticky header -// false => disable sticky header -$sticky_navbar = true; - -// max upload file size -define('MAX_UPLOAD_SIZE', '2048'); - -//--- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL +// --- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL --- // private key and session name to store to the session if ( !defined( 'FM_SESSION_ID')) { @@ -259,26 +273,28 @@ if ($use_auth) { // Form unset($_SESSION[FM_SESSION_ID]['logged']); fm_show_header_login(); - fm_show_message(); ?>
-
- - - - - - -
-
-

-
-
+
' . readlink($path . '/' . $f) . '' : '') ?>
@@ -1849,8 +1884,8 @@ $all_files_size = 0; + - ') === FALSE) ? true : false; +} + /** * Save message in session * @param string $msg @@ -2931,6 +3000,8 @@ class FM_Zipper_Tar } } + + //--- templates functions /** @@ -2970,7 +3041,6 @@ function fm_show_nav_path($path)
+
@@ -3048,29 +3119,29 @@ global $lang, $root_url, $favicon_path; <?php echo fm_enc(APP_TITLE) ?> - + @@ -3086,8 +3157,8 @@ global $lang, $root_url, $favicon_path; { ?>
- - + + <?php echo fm_enc(APP_TITLE) ?> - + @@ -3501,9 +3378,9 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; { ?>
- - - + + + @@ -3540,7 +3417,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; var n = new XMLHttpRequest, a = "path=" + e + "&file=" + t + "&type=backup&ajax=true"; return n.open("POST", "", !0), n.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), n.onreadystatechange = function () { - 4 == n.readyState && 200 == n.status && alert(n.responseText) + 4 == n.readyState && 200 == n.status && toast(n.responseText) }, n.send(a), !1 } // Toast message