diff --git a/README.md b/README.md index dca8858..1fa71d6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Live demo](https://img.shields.io/badge/Live-Demo-brightgreen.svg?style=flat-square)](https://tinyfilemanager.github.io/demo/) [![Live demo](https://img.shields.io/badge/Help-Docs-lightgrey.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/wiki) [![GitHub Release](https://img.shields.io/github/release/qubyte/rubidium.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/releases) - [![GitHub License](https://img.shields.io/github/license/prasathmani/tinyfilemanager.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE) + [![GitHub License](https://img.shields.io/github/license/prasathmani/tinyfilemanager.svg?style=flat-square)](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE) [![Paypal](https://img.shields.io/badge/Donate-Paypal-lightgrey.svg?style=flat-square)](https://www.paypal.me/prasathmani) > TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, 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. @@ -39,12 +39,12 @@ Default username/password: **admin/admin@123** and **user/12345**. To enable/disable authentication set `$use_auth` to true or false. -### :loudspeaker: Features +### :loudspeaker: Features - :cd: Open Source, light and extremely simple - :iphone: Mobile friendly view for touch devices -- :information_source: Basic features likes Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files -- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter +- :information_source: Basic features likes Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files +- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter - :file_folder: Ability to create folders and files - :gift: Ability to compress, extract files (`zip`, `tar`) - :sunglasses: Support user permissions - based on session and each user root folder mapping @@ -58,7 +58,7 @@ To enable/disable authentication set `$use_auth` to true or false. - :bangbang: lots more... -### License, Credit +### License, Credit - Available under the [GNU license](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE) - Original concept and development by github.com/alexantr/filemanager diff --git a/config.php b/config.php index 980dced..ef6951f 100644 --- a/config.php +++ b/config.php @@ -24,16 +24,16 @@ $auth_users = array( 'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345 ); -//set application theme -//options - 'light' and 'dark' -$theme = 'light'; - // Readonly users // e.g. array('users', 'guest', ...) $readonly_users = array( 'user' ); +//set application theme +//options - 'light' and 'dark' +$theme = 'light'; + // Enable highlight.js (https://highlightjs.org/) on view's page $use_highlightjs = true; @@ -67,8 +67,8 @@ $directories_users = array(); $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'; +// Doc - https://www.php.net/manual/en/datetime.format.php +$datetime_format = 'd.m.y H:i:s'; // Allowed file extensions for create and rename files // e.g. 'txt,html,css,js' diff --git a/tinyfilemanager.php b/tinyfilemanager.php index e648d4b..df68f96 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -16,7 +16,7 @@ define('APP_TITLE', 'Tiny File Manager'); // --- EDIT BELOW CONFIGURATION CAREFULLY --- -// Auth with login/password +// Auth with login/password // set true/false to enable/disable it // Is independent from IP white- and blacklisting $use_auth = true; @@ -33,7 +33,7 @@ $auth_users = array( //options - 'light' and 'dark' $theme = 'light'; -// Readonly users +// Readonly users // e.g. array('users', 'guest', ...) $readonly_users = array( 'user' @@ -131,7 +131,7 @@ $ip_blacklist = array( ); // if User has the customized config file, try to use it to override the default config above -$config_file = './config.php'; +$config_file = __DIR__.'/config.php'; if (is_readable($config_file)) { @include($config_file); } @@ -429,14 +429,14 @@ if (isset($_POST['ajax']) && !FM_READONLY) { fm_set_msg('File not found', 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } - header('X-XSS-Protection:0'); + header('X-XSS-Protection:0'); $file_path = $path . '/' . $file; - + $writedata = $_POST['content']; $fd = fopen($file_path, "w"); $write_results = @fwrite($fd, $writedata); fclose($fd); - if ($write_results === false){ + if ($write_results === false){ header("HTTP/1.1 500 Internal Server Error"); die("Could Not Write File! - Check Permissions / Ownership"); } @@ -450,7 +450,7 @@ if (isset($_POST['ajax']) && !FM_READONLY) { echo json_encode($response); exit(); } - + // backup files if (isset($_POST['type']) && $_POST['type'] == "backup" && !empty($_POST['file'])) { $fileName = $_POST['file']; @@ -540,7 +540,7 @@ if (isset($_POST['ajax']) && !FM_READONLY) { $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false; $ext = strtolower(pathinfo($fileinfo->name, PATHINFO_EXTENSION)); $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true; - + function event_callback ($message) { global $callback; echo json_encode($message); @@ -1944,7 +1944,7 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white "> - + @@ -1990,7 +1990,7 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white -
+
@@ -2419,7 +2419,7 @@ function fm_get_size($file) static $isdarwin; if (!isset($iswin)) { $iswin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'); - } + } if (!isset($isdarwin)) { $isdarwin = (strtoupper(substr(PHP_OS, 0)) == "DARWIN"); } @@ -3416,10 +3416,10 @@ global $lang, $root_url, $favicon_path; .fm-login-page .form-group label{ width:100%} .fm-login-page .btn.btn-block{ padding:12px 10px} .fm-login-page .footer{ margin:40px 0;color:#888;text-align:center} - @media screen and (max-width:425px){ + @media screen and (max-width:425px){ .fm-login-page .card-wrapper{ width:90%;margin:0 auto;margin-top:10%;} } - @media screen and (max-width:320px){ + @media screen and (max-width:320px){ .fm-login-page .card.fat{ padding:0} .fm-login-page .card.fat .card-body{ padding:15px} } @@ -3527,7 +3527,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; .break-word + .float-right { padding-right:30px;position:relative } .break-word + .float-right > a { color:#7d7d7d;font-size:1.2em;margin-right:4px } #editor { position:absolute;right:15px;top:100px;bottom:15px;left:15px } - @media (max-width:481px) { + @media (max-width:481px) { #editor { top:150px; } } #normal-editor { border-radius:3px;border-width:2px;padding:10px;outline:none; } @@ -3759,7 +3759,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; if (n) { if(true){ var data = {ajax: true, content: n, type: 'save'}; - + $.ajax({ type: "POST", url: window.location, @@ -3771,7 +3771,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; failure: function(mes) {toast("Error: try again");}, error: function(mes) {toast(`

${mes.responseText}

`);} }); - + } else{ var a = document.createElement("form"); @@ -3891,7 +3891,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; }); }); - @@ -3943,7 +3943,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal'; } else if(selectedValue && selectionType == "theme") { editor.setTheme(selectedValue); }else if(selectedValue && selectionType == "fontSize") { - editor.setFontSize(parseInt(selectedValue)); + editor.setFontSize(parseInt(selectedValue)); } }); }); @@ -4042,7 +4042,7 @@ function lng($txt) { $tr['en']['Check Latest Version'] = 'Check Latest Version';$tr['en']['Generate new password hash'] = 'Generate new password hash'; $tr['en']['You are logged in'] = 'You are logged in'; $tr['en']['Login failed. Invalid username or password'] = 'Login failed. Invalid username or password'; $tr['en']['password_hash not supported, Upgrade PHP version'] = 'password_hash not supported, Upgrade PHP version'; - + $i18n = fm_get_translations($tr); $tr = $i18n ? $i18n : $tr;