2015-07-24 16:43:54 +02:00
|
|
|
<?php
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
global $config;
|
|
|
|
|
2017-11-21 16:59:49 +01:00
|
|
|
enterprise_include_once ('include/functions_dashboard.php');
|
|
|
|
require_once('include/functions_visual_map.php');
|
|
|
|
enterprise_include_once('include/functions_visual_map.php');
|
|
|
|
|
|
|
|
$public_hash = get_parameter('hash', false);
|
|
|
|
$id_visual_console = get_parameter('id_visual_console', null);
|
|
|
|
|
|
|
|
// Try to authenticate by hash on public dashboards
|
|
|
|
if ($public_hash === false) {
|
|
|
|
// Login check
|
|
|
|
check_login();
|
|
|
|
} else {
|
|
|
|
$validate_hash = enterprise_hook(
|
|
|
|
'dasboard_validate_public_hash',
|
|
|
|
array($public_hash, $id_visual_console, 'visual_console')
|
|
|
|
);
|
|
|
|
if ($validate_hash === false || $validate_hash === ENTERPRISE_NOT_HOOK) {
|
|
|
|
db_pandora_audit("Invalid public hash", "Trying to access report builder");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
2017-10-31 19:48:56 +01:00
|
|
|
}
|
2015-07-24 16:43:54 +02:00
|
|
|
|
|
|
|
// Fix: IW was the old ACL to check for report editing, now is RW
|
2016-08-29 16:05:37 +02:00
|
|
|
if (! check_acl ($config['id_user'], 0, "VR")) {
|
2015-07-24 16:43:54 +02:00
|
|
|
db_pandora_audit("ACL Violation",
|
|
|
|
"Trying to access report builder");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Fix ajax to avoid include the file, 'functions_graph.php'.
|
|
|
|
$ajax = true;
|
|
|
|
|
|
|
|
$render_map = (bool)get_parameter('render_map', false);
|
2016-03-15 09:25:48 +01:00
|
|
|
$graph_javascript = (bool)get_parameter('graph_javascript', false);
|
2015-07-24 16:43:54 +02:00
|
|
|
|
|
|
|
if ($render_map) {
|
2017-04-04 13:48:11 +02:00
|
|
|
$width = (int)get_parameter('width', '400');
|
|
|
|
$height = (int)get_parameter('height', '400');
|
2016-05-25 13:33:37 +02:00
|
|
|
$keep_aspect_ratio = (bool) get_parameter('keep_aspect_ratio');
|
2015-07-24 16:43:54 +02:00
|
|
|
|
|
|
|
visual_map_print_visual_map($id_visual_console, true, true, $width,
|
2016-05-25 13:33:37 +02:00
|
|
|
$height, '', false, $graph_javascript, $keep_aspect_ratio);
|
2015-07-24 16:43:54 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|