2009-12-29 Sancho Lerena <slerena@artica.es>
* include/Image/image_functions.php: PHP 5.2 and higher does not support (deprecated) get_mimetype. Avoiding headers lets the browser to decide contents of stream and now this works on modern PHP, before not :( * extensions/hello: Removed sample. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2257 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b728ffc520
commit
98ea14ac3b
|
@ -1,5 +1,12 @@
|
|||
2009-12-29 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* include/Image/image_functions.php: PHP 5.2 and higher does
|
||||
not support (deprecated) get_mimetype. Avoiding headers lets
|
||||
the browser to decide contents of stream and now this works
|
||||
on modern PHP, before not :(
|
||||
|
||||
* extensions/hello: Removed sample.
|
||||
|
||||
* include/functions_servers.php: Fixed notice (division by 0).
|
||||
|
||||
* include/functions_visual_map.php: Fixed problem in graphs
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
//Pandora FMS- http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
/* You can safely delete this file */
|
||||
|
||||
function hello_extension_main () {
|
||||
/* Here you can do almost all you want! */
|
||||
echo "<h2>".__('Extensions'). " » Hello world!</h2>";
|
||||
echo "This is a sample of minimal extension in the operation view";
|
||||
}
|
||||
|
||||
function test() {
|
||||
echo "<h2>".__('Extensions'). " » Hello administration world</h2>";
|
||||
echo "This is a sample of minimal extension in the godmode view";
|
||||
}
|
||||
|
||||
/* This adds a option in the operation menu */
|
||||
//add_operation_menu_option ('Hello plugin!');
|
||||
add_godmode_menu_option (__('Hello plugin'), 'PM','gagente',"hello/icon.png");
|
||||
/**
|
||||
* 'estado' is a option of menu you can see in 'operation/menu.php'
|
||||
*/
|
||||
add_operation_menu_option(__('Hello plugin'), 'estado',"hello/icon.png");
|
||||
|
||||
|
||||
/* This sets the function to be called when the extension is selected in the operation menu */
|
||||
add_extension_main_function ('hello_extension_main');
|
||||
|
||||
add_extension_godmode_function('test');
|
||||
?>
|
Binary file not shown.
Before Width: | Height: | Size: 808 B |
|
@ -58,12 +58,19 @@ if (isset($_GET['getFile'])) {
|
|||
* @param string fileLocation The real location the file in server.
|
||||
*/
|
||||
function getFile ($destFileName,$fileLocation) {
|
||||
error_reporting(E_ALL);
|
||||
|
||||
//header('Content-type: aplication/octet-stream;');
|
||||
header('Content-type: ' . mime_content_type($fileLocation) . ';');
|
||||
header( "Content-Length: " . filesize($fileLocation));
|
||||
header('Content-Disposition: attachment; filename="' . $destFileName . '"');
|
||||
error_reporting(0);
|
||||
|
||||
|
||||
// NOTICE: mime_conent_type() IS NOT SUPPORTED IN PHP >= 5.2.11 anymore
|
||||
// THIS DOESNT WORK ON SUSE 11.x !
|
||||
|
||||
|
||||
// header('Content-type: aplication/octet-stream;');
|
||||
// header('Content-type: ' . mime_content_type($fileLocation) . ';');
|
||||
// header( "Content-Length: " . filesize($fileLocation));
|
||||
// header('Content-Disposition: attachment; filename="' . $destFileName . '"');
|
||||
|
||||
// Do not send any header, rely on browser
|
||||
readfile($fileLocation);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue