2012-09-10 Miguel de Dios <miguel.dedios@artica.es>

* general/header.php: fixed the link to logout when the Pandora
	run across inverse proxy.
	
	* include/functions.php: update the function "check_refererer" for
	situations when the Pandora runs across the inverse proxy.
	
	* include/functions_html.php: function "html_print_image" fixed when
	use the metaconsole across the inverse proxy.
	
	* include/functions_reporting.php,
	operation/reporting/reporting_viewer.php: fixed some links for the
	Pandora runs across inverse proxy.
	
	* include/functions_ui.php: fixed the function "ui_get_full_url"
	when pass a empty url in a Pandora into a inverse proxy.
	
	* extensions/dbmanager.php, operation/agentes/ver_agente.php:
	cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6950 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-09-10 16:30:42 +00:00
parent 358e9049e5
commit fc9477a47d
9 changed files with 67 additions and 43 deletions

View File

@ -1,3 +1,24 @@
2012-09-10 Miguel de Dios <miguel.dedios@artica.es>
* general/header.php: fixed the link to logout when the Pandora
run across inverse proxy.
* include/functions.php: update the function "check_refererer" for
situations when the Pandora runs across the inverse proxy.
* include/functions_html.php: function "html_print_image" fixed when
use the metaconsole across the inverse proxy.
* include/functions_reporting.php,
operation/reporting/reporting_viewer.php: fixed some links for the
Pandora runs across inverse proxy.
* include/functions_ui.php: fixed the function "ui_get_full_url"
when pass a empty url in a Pandora into a inverse proxy.
* extensions/dbmanager.php, operation/agentes/ver_agente.php:
cleaned source code style.
2012-09-10 Vanessa Gil <vanessa.gil@artica.es>
* pandoradb.sql
@ -17,7 +38,7 @@
operation/events/events_list.php: Added several fields to modules
and events.
2012-09-07 Miguel de Dios <miguel.dedios@artica.es>
2012-09-10 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js, include/functions_ui.php,
include/functions_html.php: cleaned source code style.

View File

@ -159,5 +159,4 @@ extensions_add_godmode_menu_option (__('DB interface'), 'PM','gdbman',"dbmanager
/* This sets the function to be called when the extension is selected in the operation menu */
extensions_add_godmode_function ('dbmgr_extension_main');
?>

View File

@ -86,7 +86,7 @@ config_check();
echo "&nbsp;";
}
echo '<a class="white_bold" href="index.php?bye=bye">';
echo '<a class="white_bold" href="' . ui_get_full_url('index.php?bye=bye') . '">';
html_print_image("images/log-out.png", false, array("alt" => __('Logout'), "class" => 'bot', "title" => __('Logout')));
echo '</a>';

View File

@ -48,7 +48,8 @@ function check_refererer() {
$url = $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $config["homeurl"];
}
else {
$url = $_SERVER['SERVER_NAME'] . $config["homeurl"];
$url = ui_get_full_url();
$url = preg_replace('/http(s?):\/\//','',$url);
}
// Remove protocol from referer

View File

@ -1227,8 +1227,8 @@ function html_print_image ($src, $return = false, $options = false, $return_src
if (!$relative) {
if (defined('METACONSOLE'))
$src = ENTERPRISE_DIR . '/meta/' . $src;
$src = ui_get_full_url(ENTERPRISE_DIR . '/meta/' . $src);
else
$src = ui_get_full_url($src);
}

View File

@ -1318,7 +1318,7 @@ function reporting_alert_reporting ($id_group, $period = 0, $date = 0, $return =
$data[__('Alerts not fired')] = $not_fired_percentage;
$output .= pie3d_graph(false, $data, 280, 150,
__("other"), $config['homeurl'] . '/', $config['homedir'] . "/images/logo_vertical_water.png",
__("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);
$output .= '<strong>'.__('Alerts fired').': '.sizeof ($alerts_fired).'</strong><br />';
@ -1394,7 +1394,7 @@ function reporting_monitor_health ($id_group, $period = 0, $date = 0, $return =
$data[__('Monitors BAD')] = $not_down_percentage;
$output .= pie3d_graph(false, $data, 280, 150,
__("other"), $config['homeurl'] . '/', $config['homedir'] . "/images/logo_vertical_water.png",
__("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);
if (!$return)
@ -2143,7 +2143,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
$report["datetime"], '', 0, 0, true, true, $config['homeurl'] . '/');
$report["datetime"], '', 0, 0, true, true);
array_push ($table->data, $data);
break;
@ -2189,7 +2189,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
0,
$report["datetime"],
true,
$config['homedir'] . '/',
'',
1,
// Important parameter, this tell to graphic_combined_module function that is a projection graph
$output_projection,
@ -2250,7 +2250,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
$report["datetime"], '', true, 0, true, true, $config['homedir'] . '/');
$report["datetime"], '', true, 0, true, true);
/*$data[0] = graphic_combined_module(
$modules,
@ -2316,8 +2316,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
0,
$graph["stacked"],
$report["datetime"],
true,
$config['homeurl'] . "/");
true);
array_push ($table->data, $data);
break;
@ -2537,7 +2536,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$dataslice[1] = graph_sla_slicebar ($sla['id_agent_module'], $content['period'],
$sla['sla_min'], $sla['sla_max'], $report['datetime'], $content, $content['time_from'],
$content['time_to'], 650, 25, $config['homeurl'] . '/');
$content['time_to'], 650, 25,'');
array_push ($tableslice->data, $dataslice);
}
@ -2560,7 +2559,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data_pie_graph = json_encode ($data_graph);
if ($show_graphs && !empty($slas)) {
$data[0] = pie3d_graph(false, $data_graph,
500, 150, __("other"), $config['homeurl'] . '/', $config['homedir'] . "/images/logo_vertical_water.png",
500, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);
@ -2878,7 +2877,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true, $config['homeurl'] . '/');
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true);
array_push($table->data, $data);
break;
@ -3866,7 +3865,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array();
if ($show_graph == 1 || $show_graph == 2) {
$data[0] = pie3d_graph(false, $data_pie_graph,
$sizgraph_w, $sizgraph_h, __("other"),$config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png",
$sizgraph_w, $sizgraph_h, __("other"),"", $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);
array_push ($table->data, $data);
@ -3875,7 +3874,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$table->style[0] .= 'text-align:center';
$height = count($data_pie_graph)*20+35;
$data = array();
$data[0] = hbar_graph(false, $data_hbar, $sizgraph_w, $height, array(), array(), "", "", true, $config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], true, 1, true);
$data[0] = hbar_graph(false, $data_hbar, $sizgraph_w, $height, array(), array(), "", "", true, "", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size'], true, 1, true);
array_push ($table->data, $data);
}
@ -4162,7 +4161,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array();
if ($show_graph == 1 || $show_graph == 2) {
$data[0] = pie3d_graph(false, $data_pie_graph,
600, 150, __("other"), $config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png",
600, 150, __("other"), "", $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);
array_push ($table->data, $data);
//Display bars graph
@ -4170,7 +4169,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$height = count($data_pie_graph)*20+35;
$data = array();
$data[0] = hbar_graph(false, $data_hbar, 600, $height, array(), array(), "", "", true, $config['homeurl'] . "/", $config['homedir'] . "/images/logo_vertical_water.png", '', '', true, 1, true);
$data[0] = hbar_graph(false, $data_hbar, 600, $height, array(), array(), "", "", true, "", $config['homedir'] . "/images/logo_vertical_water.png", '', '', true, 1, true);
array_push ($table->data, $data);
}

View File

@ -1833,7 +1833,6 @@ function ui_toggle($code, $name, $title = '', $hidde_default = true) {
echo "</div>";
// JQuery Toggle
echo '<script type="text/javascript">';
echo '/* <![CDATA[ */';
echo "$(document).ready (function () {";
@ -1988,8 +1987,13 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
}
if ($url === '') {
if ($proxy) {
$url = '';
}
else {
$url = $_SERVER['REQUEST_URI'];
}
}
elseif ($url === false) {
//Only add the home url
$url = $config['homeurl'] . '/';

View File

@ -38,8 +38,8 @@ if (! check_acl ($config['id_user'], $report['id_group'], "AR")) {
}
// Include with the functions to calculate each kind of report.
require_once ($config['homedir'] . '/include/functions_reporting.php');
require_once ($config['homedir'] . '/include/functions_groups.php');
require_once ('include/functions_reporting.php');
require_once ('include/functions_groups.php');
enterprise_include("include/functions_reporting.php");