From 8e6b3f288c1dc60fa0d124beb7638877d82055f9 Mon Sep 17 00:00:00 2001 From: Prasath Mani Date: Mon, 5 Nov 2018 18:56:35 +0530 Subject: [PATCH] CDN version updated and code optimized --- tinyfilemanager.php | 237 +++++++++++++------------------------------- 1 file changed, 67 insertions(+), 170 deletions(-) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 272dddb..d1407b7 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -3,7 +3,7 @@ * H3K | Tiny File Manager * CCP Programmers | ccpprogrammers@gmail.com * http://fb.com/ccpprogrammers - * https://github.com/prasathmani/tinyfilemanager + * https://tinyfilemanager.github.io */ // Default language @@ -13,18 +13,19 @@ $lang = 'en'; $use_auth = true; // Users: array('Username' => 'Password', 'Username2' => 'Password2', ...) +// Generate secure password hash - https://tinyfilemanager.github.io/docs/pwd.html $auth_users = array( 'admin' => '$2y$10$1wXHgLfTggq4SUTkm5YGUuO771X106e.B0WgHXXkH72C0/LuY6ZSW', //admin 'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345 ); -// Readonly users (usernames array) +// Readonly users (username array) $readonly_users = array( 'user' ); -//user specific directories -//array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) +// user specific directories +// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) $directories_users = array(); // Show or hide files and folders that starts with a dot @@ -61,10 +62,10 @@ $datetime_format = 'd.m.y H:i'; // allowed upload file extensions $upload_extensions = ''; // 'gif,png,jpg' -//Array of files and folders excluded from listing +// Array of files and folders excluded from listing $GLOBALS['exclude_items'] = array(); -//Google Docs Viewer +// Google Docs Viewer $GLOBALS['online_viewer'] = true; // include user config php file @@ -152,10 +153,10 @@ if ($use_auth) {
- +

© CCP Programmers

@@ -165,7 +166,7 @@ if ($use_auth) { } } -//update root path +// update root path if ($use_auth && isset($_SESSION['logged'])) { $root_path = isset($directories_users[$_SESSION['logged']]) ? $directories_users[$_SESSION['logged']] : $root_path; } @@ -209,17 +210,17 @@ unset($p, $use_auth, $iconv_input_encoding, $use_highlightjs, $highlightjs_style /*************************** ACTIONS ***************************/ -//AJAX Request +// AJAX Request if (isset($_POST['ajax']) && !FM_READONLY) { - //search : get list of files from the current folder + // search : get list of files from the current folder if (isset($_POST['type']) && $_POST['type'] == "search") { $dir = $_POST['path']; $response = scan($dir); echo json_encode($response); } - //backup files + // backup files if (isset($_POST['type']) && $_POST['type'] == "backup") { $file = $_POST['file']; $path = $_POST['path']; @@ -703,8 +704,8 @@ if (isset($_GET['upload']) && !FM_READONLY) { fm_show_nav_path(FM_PATH); // current path ?> - - + +

Uploading files

Destination folder:

-
Files: , ', $copy_files) ?>

Source folder:
- / + /

@@ -793,10 +794,8 @@ if (isset($_GET['copy']) && !isset($_GET['finish']) && !FM_READONLY) { Destination folder:

- Copy   - Move   + Copy   + Move   Cancel

Select folder

@@ -804,15 +803,13 @@ if (isset($_GET['copy']) && !isset($_GET['finish']) && !FM_READONLY) { -
  • ..
  • +
  • ..
  • -
  • + @@ -922,8 +919,7 @@ if (isset($_GET['view'])) { ?>

    - Download   + Download   Open   - UnZip   - + UnZip   + UnZip to folder   - Edit   - Advanced Edit   + Edit   + Advanced Edit   Back

    @@ -1023,7 +1015,7 @@ if (isset($_GET['edit'])) { $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file); $file_path = $path . '/' . $file; - //normal editer + // normal editer $isNormalEditor = true; if (isset($_GET['env'])) { if ($_GET['env'] == "ace") { @@ -1031,7 +1023,7 @@ if (isset($_GET['edit'])) { } } - //Save File + // Save File if (isset($_POST['savedata'])) { $writedata = $_POST['savedata']; $fd = fopen($file_path, "w"); @@ -1055,25 +1047,19 @@ if (isset($_GET['edit'])) {
    Back + href="?p=&view="> Back Backup + href="javascript:backup('','')"> Backup Advanced Editor - Plain Editor - @@ -1130,30 +1116,21 @@ if (isset($_GET['chmod']) && !FM_READONLY && !FM_IS_WIN) { Read - - - + + + Write - - - + + + Execute - - - + + + @@ -1244,31 +1221,22 @@ $all_files_size = 0;
    -
    +
    ' . readlink($path . '/' . $f) . '' : '') ?>
    Folder - + - - - + + + - + -
    +
    ' . readlink($path . '/' . $f) . '' : '') ?>
    - + - - + + + href="?p=&copy="> - - + + - Full size: , + Full size: , files: , folders: @@ -1985,7 +1943,7 @@ function fm_get_text_names() } /** - * Get audio files extensions + * Get online docs viewer supported files extensions * @return array */ function fm_get_onlineViewer_exts() @@ -2112,8 +2070,7 @@ function fm_show_nav_path($path) ?>