1
0
mirror of https://github.com/prasathmani/tinyfilemanager.git synced 2025-08-06 16:57:11 +02:00

IP whitelisting and/or blacklisting #171

Add Microsoft Office online view option #169
This commit is contained in:
Prasath Mani
2019-05-19 12:31:49 +05:30
parent ffc34859cc
commit 1696ebf0fc
3 changed files with 30 additions and 30 deletions

View File

@@ -3,13 +3,13 @@
$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
* https://tinyfilemanager.github.io
*/
//TFM version
define('VERSION', '2.3.5');
define('VERSION', '2.3.6');
//Application Title
define('APP_TITLE', 'Tiny File Manager');
@@ -85,29 +85,41 @@ $iconv_input_encoding = 'UTF-8';
$datetime_format = 'd.m.y H:i';
// 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.
// 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();
// Google Docs Viewer
$GLOBALS['online_viewer'] = true;
// 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
// Sticky Nav bar
// true => enable sticky header
// false => disable sticky header
$sticky_navbar = true;
//max upload file size
// max upload file size
define('MAX_UPLOAD_SIZE', '2048');
//--- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL
// private key and session name to store to the session
if ( !defined( 'FM_SESSION_ID')) {
define('FM_SESSION_ID', 'filemanager');
}
//Configuration
// Configuration
$cfg = new FM_Config();
// Default language
@@ -124,8 +136,6 @@ $lang_list = array(
'en' => 'English'
);
//--- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL
if ($report_errors == true) {
@ini_set('error_reporting', E_ALL);
@ini_set('display_errors', 1);
@@ -1291,8 +1301,9 @@ if (isset($_GET['view'])) {
$view_title = 'File';
$filenames = false; // for zip
$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;
}
elseif ($ext == 'zip' || $ext == 'tar') {
@@ -1388,8 +1399,11 @@ if (isset($_GET['view'])) {
<?php
}
if($is_onlineViewer) {
// Google docs viewer
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>';
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>';
} 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) {
// ZIP content
if ($filenames !== false) {