mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-05-14 03:26:39 +02:00
IP whitelisting and/or blacklisting #171
Add Microsoft Office online view option #169
This commit is contained in:
parent
ffc34859cc
commit
1696ebf0fc
|
@ -1,13 +0,0 @@
|
||||||
# Editor configuration, see https://editorconfig.org
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
max_line_length = off
|
|
||||||
trim_trailing_whitespace = false
|
|
|
@ -23,8 +23,7 @@
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- PHP 5.5.0 or higher.
|
- PHP 5.5.0 or higher.
|
||||||
- [Zip extension](http://php.net/manual/en/book.zip.php) for zip and unzip actions.
|
- Fileinfo, iconv, zip, tar and mbstring extensions are strongly recommended.
|
||||||
- Fileinfo, iconv and mbstring extensions are strongly recommended.
|
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
|
@ -62,8 +61,8 @@ To enable/disable authentication set `$use_auth` to true or false.
|
||||||
- :sunglasses: Support user permissions - based on session and each user root folder mapping
|
- :sunglasses: Support user permissions - based on session and each user root folder mapping
|
||||||
- :floppy_disk: Copy direct file URL
|
- :floppy_disk: Copy direct file URL
|
||||||
- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style
|
- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style
|
||||||
- :page_facing_up: Google Drive viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer
|
- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer
|
||||||
- :zap: Backup files
|
- :zap: Backup files and IP white and blacklisting
|
||||||
- :mag_right: Search - Search and Sorting using `datatable js`
|
- :mag_right: Search - Search and Sorting using `datatable js`
|
||||||
- :file_folder: Exclude folders from listing
|
- :file_folder: Exclude folders from listing
|
||||||
- :globe_with_meridians: Multi-language support (English, Spanish, French, Italian, German, Russian, Thailand, Chinese and more..) for translations `translation.json` is file required
|
- :globe_with_meridians: Multi-language support (English, Spanish, French, Italian, German, Russian, Thailand, Chinese and more..) for translations `translation.json` is file required
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false}';
|
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H3K | Tiny File Manager V2.3.5
|
* H3K | Tiny File Manager V2.3.6
|
||||||
* CCP Programmers | ccpprogrammers@gmail.com
|
* CCP Programmers | ccpprogrammers@gmail.com
|
||||||
* https://tinyfilemanager.github.io
|
* https://tinyfilemanager.github.io
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//TFM version
|
//TFM version
|
||||||
define('VERSION', '2.3.5');
|
define('VERSION', '2.3.6');
|
||||||
|
|
||||||
//Application Title
|
//Application Title
|
||||||
define('APP_TITLE', 'Tiny File Manager');
|
define('APP_TITLE', 'Tiny File Manager');
|
||||||
|
@ -85,29 +85,41 @@ $iconv_input_encoding = 'UTF-8';
|
||||||
$datetime_format = 'd.m.y H:i';
|
$datetime_format = 'd.m.y H:i';
|
||||||
|
|
||||||
// allowed file extensions for upload and rename
|
// allowed file extensions for upload and rename
|
||||||
$allowed_extensions = ''; // 'gif,png,jpg'
|
// 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.
|
// 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';
|
$favicon_path = '?img=favicon';
|
||||||
|
|
||||||
// Array of files and folders excluded from listing
|
// Array of files and folders excluded from listing
|
||||||
|
// e.r array('myfile.html', 'personal-folder')
|
||||||
$GLOBALS['exclude_items'] = array();
|
$GLOBALS['exclude_items'] = array();
|
||||||
|
|
||||||
// Google Docs Viewer
|
// Online office Docs Viewer
|
||||||
$GLOBALS['online_viewer'] = true;
|
// 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
|
// Sticky Nav bar
|
||||||
|
// true => enable sticky header
|
||||||
|
// false => disable sticky header
|
||||||
$sticky_navbar = true;
|
$sticky_navbar = true;
|
||||||
|
|
||||||
//max upload file size
|
// max upload file size
|
||||||
define('MAX_UPLOAD_SIZE', '2048');
|
define('MAX_UPLOAD_SIZE', '2048');
|
||||||
|
|
||||||
|
//--- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL
|
||||||
|
|
||||||
// private key and session name to store to the session
|
// private key and session name to store to the session
|
||||||
if ( !defined( 'FM_SESSION_ID')) {
|
if ( !defined( 'FM_SESSION_ID')) {
|
||||||
define('FM_SESSION_ID', 'filemanager');
|
define('FM_SESSION_ID', 'filemanager');
|
||||||
}
|
}
|
||||||
|
|
||||||
//Configuration
|
// Configuration
|
||||||
$cfg = new FM_Config();
|
$cfg = new FM_Config();
|
||||||
|
|
||||||
// Default language
|
// Default language
|
||||||
|
@ -124,8 +136,6 @@ $lang_list = array(
|
||||||
'en' => 'English'
|
'en' => 'English'
|
||||||
);
|
);
|
||||||
|
|
||||||
//--- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL
|
|
||||||
|
|
||||||
if ($report_errors == true) {
|
if ($report_errors == true) {
|
||||||
@ini_set('error_reporting', E_ALL);
|
@ini_set('error_reporting', E_ALL);
|
||||||
@ini_set('display_errors', 1);
|
@ini_set('display_errors', 1);
|
||||||
|
@ -1291,8 +1301,9 @@ if (isset($_GET['view'])) {
|
||||||
$view_title = 'File';
|
$view_title = 'File';
|
||||||
$filenames = false; // for zip
|
$filenames = false; // for zip
|
||||||
$content = ''; // for text
|
$content = ''; // for text
|
||||||
|
$online_viewer = strtolower($GLOBALS['online_viewer']);
|
||||||
|
|
||||||
if($GLOBALS['online_viewer'] && in_array($ext, fm_get_onlineViewer_exts())){
|
if(online_viewer && online_viewer !== 'false' && in_array($ext, fm_get_onlineViewer_exts())){
|
||||||
$is_onlineViewer = true;
|
$is_onlineViewer = true;
|
||||||
}
|
}
|
||||||
elseif ($ext == 'zip' || $ext == 'tar') {
|
elseif ($ext == 'zip' || $ext == 'tar') {
|
||||||
|
@ -1388,8 +1399,11 @@ if (isset($_GET['view'])) {
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if($is_onlineViewer) {
|
if($is_onlineViewer) {
|
||||||
// Google docs viewer
|
if($online_viewer == 'google') {
|
||||||
echo '<iframe src="https://docs.google.com/viewer?embedded=true&hl=en&url=' . fm_enc($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
|
echo '<iframe src="https://docs.google.com/viewer?embedded=true&hl=en&url=' . fm_enc($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
|
||||||
|
} else if($online_viewer == 'microsoft') {
|
||||||
|
echo '<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=' . fm_enc($file_url) . '" frameborder="no" style="width:100%;min-height:460px"></iframe>';
|
||||||
|
}
|
||||||
} elseif ($is_zip) {
|
} elseif ($is_zip) {
|
||||||
// ZIP content
|
// ZIP content
|
||||||
if ($filenames !== false) {
|
if ($filenames !== false) {
|
||||||
|
|
Loading…
Reference in a new issue