2009-01-07 11:42:38 +01:00
|
|
|
<?php
|
|
|
|
|
2009-06-08 20:26:14 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2009-01-07 11:42:38 +01:00
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
2009-06-08 20:26:14 +02:00
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
2009-01-07 11:42:38 +01:00
|
|
|
// 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.
|
|
|
|
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/dev.php,
include/auth/ldap.php, include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/FusionCharts/FusionCharts_Gen.php,
include/FusionCharts/FusionCharts.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/help/en/help_plugin_parameters.php,
include/help/en/help_snmpcommunity.php, include/help/en/help_wmiquery.php,
include/help/en/help_postprocess.php,
include/help/en/help_prediction_source_module.php,
include/help/en/help_date_format.php, include/help/en/help_recontask.php,
include/help/en/help_alert-matches.php, include/help/en/help_tcp_send.php,
include/help/en/help_wmifield.php, include/help/en/help_duplicateconfig.php,
include/help/en/help_agent_status.php,
include/help/en/help_manage_alerts.php, include/help/en/help_wmikey.php,
include/help/en/help_alert_type.php,
include/help/en/help_network_component.php,
include/help/en/help_time_stamp-comparation.php,
include/help/en/help_eventview.php, include/help/en/help_timesource.php,
include/help/en/help_alert_validation.php,
include/help/en/help_map_builder.php,
include/help/en/help_alert_recovery.php,
include/help/en/help_module_type.php,
include/help/en/help_planned_downtime.php,
include/help/en/help_serverlag.php, include/help/en/help_alerts.php,
include/help/en/help_snmpwalk.php,
include/help/en/help_module_definition.php,
include/help/en/help_plugin_definition.php,
include/help/en/help_wminamespace.php, include/help/en/help_snmpoid.php
include/help/en/help_manageconfig.php,
include/help/es/help_alert_validation.php,
include/help/es/help_plugin_parameters.php,
include/help/es/help_snmpcommunity.php, include/help/es/help_wmiquery.php,
include/help/es/help_map_builder.php, include/help/es/help_postprocess.php,
include/help/es/help_date_format.php,
include/help/es/help_alert_recovery.php,
include/help/es/help_prediction_source_module.php,
include/help/es/help_module_type.php,
include/help/es/help_planned_downtime.php,
include/help/es/help_alert-matches.php, include/help/es/help_recontask.php,
include/help/es/help_alerts.php, include/help/es/help_serverlag.php,
include/help/es/help_snmpwalk.php,
include/help/es/help_module_definition.php,
include/help/es/help_tcp_send.php, include/help/es/help_duplicateconfig.php,
include/help/es/help_wmifield.php, include/help/es/help_manage_alerts.php,
include/help/es/help_wmikey.php, include/help/es/help_plugin_definition.php,
include/help/es/help_alert_type.php, include/help/es/help_snmpoid.php,
include/help/es/help_wminamespace.php,
include/help/es/help_network_component.php,
include/help/es/help_time_stamp-comparation.php,
include/help/es/help_manageconfig.php, include/help/es/help_timesource.php,
include/config_process.php, include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change comments blocks for delete the
warnings to construct phpDoc Files, give a struct and order in the
phpDoc files.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-25 19:39:28 +02:00
|
|
|
/**
|
|
|
|
* @package Include
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/ldap.php,
include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/config_process.php,
include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change or add the subpackage in phpdoc
comment blocks for to organize more the result phpdoc files. Start to
document undocument functions.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1882 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-26 17:37:47 +02:00
|
|
|
* @subpackage UI
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/dev.php,
include/auth/ldap.php, include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/FusionCharts/FusionCharts_Gen.php,
include/FusionCharts/FusionCharts.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/help/en/help_plugin_parameters.php,
include/help/en/help_snmpcommunity.php, include/help/en/help_wmiquery.php,
include/help/en/help_postprocess.php,
include/help/en/help_prediction_source_module.php,
include/help/en/help_date_format.php, include/help/en/help_recontask.php,
include/help/en/help_alert-matches.php, include/help/en/help_tcp_send.php,
include/help/en/help_wmifield.php, include/help/en/help_duplicateconfig.php,
include/help/en/help_agent_status.php,
include/help/en/help_manage_alerts.php, include/help/en/help_wmikey.php,
include/help/en/help_alert_type.php,
include/help/en/help_network_component.php,
include/help/en/help_time_stamp-comparation.php,
include/help/en/help_eventview.php, include/help/en/help_timesource.php,
include/help/en/help_alert_validation.php,
include/help/en/help_map_builder.php,
include/help/en/help_alert_recovery.php,
include/help/en/help_module_type.php,
include/help/en/help_planned_downtime.php,
include/help/en/help_serverlag.php, include/help/en/help_alerts.php,
include/help/en/help_snmpwalk.php,
include/help/en/help_module_definition.php,
include/help/en/help_plugin_definition.php,
include/help/en/help_wminamespace.php, include/help/en/help_snmpoid.php
include/help/en/help_manageconfig.php,
include/help/es/help_alert_validation.php,
include/help/es/help_plugin_parameters.php,
include/help/es/help_snmpcommunity.php, include/help/es/help_wmiquery.php,
include/help/es/help_map_builder.php, include/help/es/help_postprocess.php,
include/help/es/help_date_format.php,
include/help/es/help_alert_recovery.php,
include/help/es/help_prediction_source_module.php,
include/help/es/help_module_type.php,
include/help/es/help_planned_downtime.php,
include/help/es/help_alert-matches.php, include/help/es/help_recontask.php,
include/help/es/help_alerts.php, include/help/es/help_serverlag.php,
include/help/es/help_snmpwalk.php,
include/help/es/help_module_definition.php,
include/help/es/help_tcp_send.php, include/help/es/help_duplicateconfig.php,
include/help/es/help_wmifield.php, include/help/es/help_manage_alerts.php,
include/help/es/help_wmikey.php, include/help/es/help_plugin_definition.php,
include/help/es/help_alert_type.php, include/help/es/help_snmpoid.php,
include/help/es/help_wminamespace.php,
include/help/es/help_network_component.php,
include/help/es/help_time_stamp-comparation.php,
include/help/es/help_manageconfig.php, include/help/es/help_timesource.php,
include/config_process.php, include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change comments blocks for delete the
warnings to construct phpDoc Files, give a struct and order in the
phpDoc files.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-25 19:39:28 +02:00
|
|
|
*/
|
|
|
|
|
2010-04-29 17:39:19 +02:00
|
|
|
/**
|
|
|
|
* Truncate a text to num chars (pass as parameter) and if flag show tooltip is
|
|
|
|
* true the html artifal to show the tooltip with rest of text.
|
|
|
|
*
|
|
|
|
* @param string $text The text to truncate.
|
|
|
|
* @param integer $numChars Number chars (-1 for char "...") max the text.
|
|
|
|
* @param boolean $showTextInAToopTip Flag to show the tooltip.
|
|
|
|
* @param boolean $return Flag to return as string or not.
|
2010-04-30 13:07:26 +02:00
|
|
|
* @param boolean $showTextInTitle Flag to show the text on title.
|
2010-06-25 10:12:25 +02:00
|
|
|
* @param string $suffix String at the end of a strimmed string.
|
2010-04-29 17:39:19 +02:00
|
|
|
*/
|
2010-06-25 10:12:25 +02:00
|
|
|
function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '…') {
|
2010-10-14 14:27:09 +02:00
|
|
|
$text = safe_output($text);
|
2010-04-29 17:39:19 +02:00
|
|
|
if (strlen($text) > ($numChars - 1)) {
|
2010-06-25 10:12:25 +02:00
|
|
|
$truncateText = mb_strimwidth($text, 0, ($numChars - 1)) . $suffix;
|
2010-04-30 13:07:26 +02:00
|
|
|
|
|
|
|
if ($showTextInTitle) {
|
|
|
|
$truncateText = '<span title="'.$text.'">'.$truncateText.'</span>';
|
2010-04-29 17:39:19 +02:00
|
|
|
}
|
2010-04-30 13:07:26 +02:00
|
|
|
if ($showTextInAToopTip) {
|
|
|
|
$truncateText = $truncateText . '<a href="#" class="tip"> <span>' . $text . '</span></a>';
|
2010-04-29 17:39:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$truncateText = $text;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($return == true) {
|
|
|
|
return $truncateText;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo $truncateText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-30 11:27:04 +02:00
|
|
|
/**
|
|
|
|
* Prints a generic message between tags.
|
|
|
|
*
|
|
|
|
* @param string The message string to be displayed
|
|
|
|
* @param string the class to user
|
|
|
|
* @param string Any other attributes to be set for the tag.
|
|
|
|
* @param bool Whether to output the string or return it
|
|
|
|
* @param string What tag to use (you could specify something else than
|
|
|
|
* h3 like div or h2)
|
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_message ($message, $class = '', $attributes = '', $return = false, $tag = 'h3') {
|
|
|
|
$output = '<'.$tag.(empty ($class) ? '' : ' class="'.$class.'" ').$attributes.'>'.$message.'</'.$tag.'>';
|
|
|
|
|
|
|
|
if ($return)
|
|
|
|
return $output;
|
|
|
|
echo $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints an error message.
|
|
|
|
*
|
|
|
|
* @param string The error message to be displayed
|
|
|
|
* @param string Any other attributes to be set for the tag.
|
|
|
|
* @param bool Whether to output the string or return it
|
|
|
|
* @param string What tag to use (you could specify something else than
|
|
|
|
* h3 like div or h2)
|
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_error_message ($message, $attributes = '', $return = false, $tag = 'h3') {
|
|
|
|
return print_message ($message, 'error', $attributes, $return, $tag);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints an operation success message.
|
|
|
|
*
|
|
|
|
* @param string The message to be displayed
|
|
|
|
* @param string Any other attributes to be set for the tag.
|
|
|
|
* @param bool Whether to output the string or return it
|
|
|
|
* @param string What tag to use (you could specify something else than
|
|
|
|
* h3 like div or h2)
|
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_success_message ($message, $attributes = '', $return = false, $tag = 'h3') {
|
|
|
|
return print_message ($message, 'suc', $attributes, $return, $tag);
|
|
|
|
}
|
|
|
|
|
2009-01-07 11:42:38 +01:00
|
|
|
/**
|
2009-03-26 Esteban Sanchez <estebans@artica.es>
* godmode/users/configure_user.php: Complete rewritten to fix minor
errors and fit the Pandora style.
* include/auth/ldap.php: Removed process_user_isadmin(). Renamed
process_user_password() to update_user_password(). Renamed
process_user_info to update_user(). update_user_password() does not
require old password anymore.
* include/functions_db.php: Added empty checks on
create_user_profile().
* include/functions_ui.php: print_error_message() renamed to
print_result_message().
* godmode/agentes/configurar_agente.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/reporting_builder.php,
operation/agentes/alerts_status.php, operation/events/events.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/messages/message.php, operation/snmpconsole/snmp_view.php,
operation/users/user_edit.php: Renamed print_result_message(). Some
translatable strings reused to simplify i18n work.
* godmode/users/user_list.php: Renamed print_result_message(). Use
cross.png for deletion links. Style corrections.
* godmode/setup/news.php: Renamed print_result_message(). Use
process_sql_delete() instead of direct mysql_query.
* godmode/reporting/map_builder.php: Renamed print_result_message().
Style correction on process_sql_update().
* godmode/alerts/configure_alert_compound.php: Renamed
print_result_message(). Fixed steps_clean div.
* godmode/setup/setup.php: Return control to index instead of exit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1567 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-26 12:14:49 +01:00
|
|
|
* Evaluates a result using empty() and then prints an error or success message
|
2009-01-07 11:42:38 +01:00
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param mixed The results to evaluate. 0, NULL, false, '' or
|
2009-01-08 16:52:13 +01:00
|
|
|
* array() is bad, the rest is good
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param string The string to be displayed if the result was good
|
|
|
|
* @param string The string to be displayed if the result was bad
|
|
|
|
* @param string Any other attributes to be set for the h3
|
|
|
|
* @param bool Whether to output the string or return it
|
|
|
|
* @param string What tag to use (you could specify something else than
|
2009-01-08 16:52:13 +01:00
|
|
|
* h3 like div or h2)
|
2009-01-07 11:42:38 +01:00
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @return string HTML code if return parameter is true.
|
2009-01-08 16:52:13 +01:00
|
|
|
*/
|
2009-03-26 Esteban Sanchez <estebans@artica.es>
* godmode/users/configure_user.php: Complete rewritten to fix minor
errors and fit the Pandora style.
* include/auth/ldap.php: Removed process_user_isadmin(). Renamed
process_user_password() to update_user_password(). Renamed
process_user_info to update_user(). update_user_password() does not
require old password anymore.
* include/functions_db.php: Added empty checks on
create_user_profile().
* include/functions_ui.php: print_error_message() renamed to
print_result_message().
* godmode/agentes/configurar_agente.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/reporting_builder.php,
operation/agentes/alerts_status.php, operation/events/events.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/messages/message.php, operation/snmpconsole/snmp_view.php,
operation/users/user_edit.php: Renamed print_result_message(). Some
translatable strings reused to simplify i18n work.
* godmode/users/user_list.php: Renamed print_result_message(). Use
cross.png for deletion links. Style corrections.
* godmode/setup/news.php: Renamed print_result_message(). Use
process_sql_delete() instead of direct mysql_query.
* godmode/reporting/map_builder.php: Renamed print_result_message().
Style correction on process_sql_update().
* godmode/alerts/configure_alert_compound.php: Renamed
print_result_message(). Fixed steps_clean div.
* godmode/setup/setup.php: Return control to index instead of exit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1567 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-26 12:14:49 +01:00
|
|
|
function print_result_message ($result, $good = '', $bad = '', $attributes = '', $return = false, $tag = 'h3') {
|
2009-01-07 11:42:38 +01:00
|
|
|
if ($good == '' || $good === false)
|
|
|
|
$good = __('Request successfully processed');
|
|
|
|
|
|
|
|
if ($bad == '' || $bad === false)
|
|
|
|
$bad = __('Error processing request');
|
|
|
|
|
|
|
|
if (empty ($result)) {
|
2009-03-30 11:27:04 +02:00
|
|
|
return print_error_message ($bad, $attributes, $return, $tag);
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
2009-03-30 11:27:04 +02:00
|
|
|
return print_success_message ($good, $attributes, $return, $tag);
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Evaluates a unix timestamp and returns a span (or whatever tag specified)
|
|
|
|
* with as title the correctly formatted full timestamp and a time comparation
|
|
|
|
* in the tag
|
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param int Any type of timestamp really, but we prefer unixtime
|
|
|
|
* @param bool Whether to output the string or return it
|
|
|
|
* @param array An array with different options for this function
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
* Key html_attr: which html attributes to add (defaults to none)
|
|
|
|
* Key tag: Which html tag to use (defaults to span)
|
|
|
|
* Key prominent: Overrides user preference and display "comparation" or "timestamp"
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
* key units: The type of units.
|
2009-01-07 11:42:38 +01:00
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_timestamp ($unixtime, $return = false, $option = array ()) {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
//TODO: Add/use a javascript timer for the seconds so it automatically updates as time passes by
|
|
|
|
|
|
|
|
if (isset ($option["html_attr"])) {
|
|
|
|
$attributes = $option["html_attr"];
|
|
|
|
} else {
|
|
|
|
$attributes = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset ($option["tag"])) {
|
|
|
|
$tag = $option["tag"];
|
|
|
|
} else {
|
|
|
|
$tag = "span";
|
|
|
|
}
|
|
|
|
|
2009-03-20 20:57:13 +01:00
|
|
|
if (empty ($option["style"])) {
|
|
|
|
$style = 'style="white-space:nowrap;"';
|
|
|
|
} else {
|
|
|
|
$style = 'style="'.$option["style"].'"';
|
|
|
|
}
|
|
|
|
|
2009-01-07 11:42:38 +01:00
|
|
|
if (!empty ($option["prominent"])) {
|
|
|
|
$prominent = $option["prominent"];
|
|
|
|
} else {
|
|
|
|
$prominent = $config["prominent_time"];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_numeric ($unixtime)) {
|
|
|
|
$unixtime = strtotime ($unixtime);
|
|
|
|
}
|
|
|
|
|
|
|
|
//prominent_time is either timestamp or comparation
|
2010-05-13 16:45:52 +02:00
|
|
|
if ($unixtime <= 0) {
|
2009-03-20 20:57:13 +01:00
|
|
|
$title = __('Unknown').'/'.__('Never');
|
|
|
|
$data = __('Unknown');
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
}
|
|
|
|
elseif ($prominent == "timestamp") {
|
2009-01-07 11:42:38 +01:00
|
|
|
$title = human_time_comparation ($unixtime);
|
|
|
|
$data = date ($config["date_format"], $unixtime);
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
}
|
|
|
|
else {
|
2009-01-07 11:42:38 +01:00
|
|
|
$title = date ($config["date_format"], $unixtime);
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
$units = 'large';
|
|
|
|
if (isset($option['units'])) {
|
|
|
|
$units = $option['units'];
|
|
|
|
}
|
|
|
|
$data = human_time_comparation ($unixtime, $units);
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$output = '<'.$tag;
|
|
|
|
switch ($tag) {
|
|
|
|
default:
|
|
|
|
//Usually tags have title attributes, so by default we add, then fall through to add attributes and data
|
|
|
|
$output .= ' title="'.$title.'"';
|
|
|
|
case "h1":
|
|
|
|
case "h2":
|
|
|
|
case "h3":
|
|
|
|
//Above tags don't have title attributes
|
2009-03-20 20:57:13 +01:00
|
|
|
$output .= ' '.$attributes.' '.$style.'>'.$data.'</'.$tag.'>';
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($return)
|
|
|
|
return $output;
|
|
|
|
|
|
|
|
echo $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints a username with real name, link to the user_edit page etc.
|
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param string The username to render
|
|
|
|
* @param bool Whether to return or print
|
2009-01-07 11:42:38 +01:00
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_username ($username, $return = false) {
|
2009-02-19 22:34:27 +01:00
|
|
|
$string = '<a href="index.php?sec=usuario&sec2=operation/users/user_edit&id='.$username.'">'.get_user_fullname ($username).'</a>';
|
2009-01-07 11:42:38 +01:00
|
|
|
|
|
|
|
if ($return)
|
|
|
|
return $string;
|
|
|
|
|
|
|
|
echo $string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Print group icon within a link
|
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param int Group id
|
|
|
|
* @param bool Whether to return or print
|
|
|
|
* @param string What path to use (relative to images/). Defaults to groups_small
|
2009-01-07 11:42:38 +01:00
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
2009-08-01 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php: fix bug that introduce obligatory autorefresh
and maybe some extension run bad with autorefresh.
*include/functions_reporting.php: add function
"get_agent_module_info_with_filter", this function is similar more or less
at "get_agent_module_info" but the function can set SQL filter for
tune the result.
*include/functions_ui.php: add more features at function "print_group_icon"
can set style and only icon not link.
*images/so_aix_small.png, images/network_small.png, images/so_bsd_small.png,
images/so_solaris_small.png, images/so_other_small.png,
images/so_cisco_small.png,
images/status_sets/default/agent_critical_ball.png,
images/status_sets/default/module_warning_ball.png,
images/status_sets/default/module_ok_ball.png,
images/status_sets/default/alert_fired_ball.png,
images/status_sets/default/agent_warning_ball.png,
images/status_sets/default/agent_no_data_ball.png,
images/status_sets/default/alert_disabled_square.png,
images/status_sets/default/agent_no_monitors_ball.png,
images/status_sets/default/agent_down_ball.png,
images/status_sets/default/agent_ok_ball.png,
images/status_sets/default/alert_disabled_ball.png,
images/status_sets/default/module_critical_ball.png,
images/status_sets/default/alert_not_fired_ball.png,
images/so_win_small.png, images/so_hpux_small.png, images/so_mac_small.png,
images/so_linux_small.png: add many icons for many purposes and new
features near in the time.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1913 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-03 20:15:40 +02:00
|
|
|
function print_group_icon ($id_group, $return = false, $path = "groups_small", $style='', $link = true) {
|
2010-04-22 18:51:23 +02:00
|
|
|
if($id_group > 0)
|
|
|
|
$icon = (string) get_db_value ('icon', 'tgrupo', 'id_grupo', (int) $id_group);
|
|
|
|
else
|
|
|
|
$icon = "world";
|
2009-01-07 11:42:38 +01:00
|
|
|
|
2010-06-01 15:22:24 +02:00
|
|
|
if($style == '')
|
|
|
|
$style = 'width: 16px; height: 16px;';
|
|
|
|
|
2009-08-01 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php: fix bug that introduce obligatory autorefresh
and maybe some extension run bad with autorefresh.
*include/functions_reporting.php: add function
"get_agent_module_info_with_filter", this function is similar more or less
at "get_agent_module_info" but the function can set SQL filter for
tune the result.
*include/functions_ui.php: add more features at function "print_group_icon"
can set style and only icon not link.
*images/so_aix_small.png, images/network_small.png, images/so_bsd_small.png,
images/so_solaris_small.png, images/so_other_small.png,
images/so_cisco_small.png,
images/status_sets/default/agent_critical_ball.png,
images/status_sets/default/module_warning_ball.png,
images/status_sets/default/module_ok_ball.png,
images/status_sets/default/alert_fired_ball.png,
images/status_sets/default/agent_warning_ball.png,
images/status_sets/default/agent_no_data_ball.png,
images/status_sets/default/alert_disabled_square.png,
images/status_sets/default/agent_no_monitors_ball.png,
images/status_sets/default/agent_down_ball.png,
images/status_sets/default/agent_ok_ball.png,
images/status_sets/default/alert_disabled_ball.png,
images/status_sets/default/module_critical_ball.png,
images/status_sets/default/alert_not_fired_ball.png,
images/so_win_small.png, images/so_hpux_small.png, images/so_mac_small.png,
images/so_linux_small.png: add many icons for many purposes and new
features near in the time.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1913 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-09-03 20:15:40 +02:00
|
|
|
$output = '';
|
2010-04-30 13:41:43 +02:00
|
|
|
if ($link)
|
|
|
|
$output = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$id_group.'">';
|
|
|
|
|
|
|
|
if (empty ($icon))
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
$output .= '<span title="'. get_group_name($id_group, true).'"> - </span>';
|
2010-04-30 13:41:43 +02:00
|
|
|
else
|
|
|
|
$output .= '<img style="' . $style . '" class="bot" src="images/'.$path.'/'.$icon.'.png" alt="'.get_group_name ($id_group, true).'" title="'.get_group_name ($id_group, true).'" />';
|
|
|
|
|
|
|
|
if ($link)
|
|
|
|
$output .= '</a>';
|
2009-01-07 11:42:38 +01:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
if (!$return)
|
|
|
|
echo $output;
|
2009-01-07 11:42:38 +01:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
return $output;
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
|
|
|
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
/**
|
|
|
|
* Print group icon within a link. Other version.
|
|
|
|
*
|
|
|
|
* @param int Group id
|
|
|
|
* @param bool Whether to return or print
|
|
|
|
* @param string What path to use (relative to images/). Defaults to groups_small
|
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_group_icon2($id_group, $return = false, $path = "images/groups_small", $style='', $link = true) {
|
|
|
|
if($id_group > 0)
|
|
|
|
$icon = (string) get_db_value ('icon', 'tgrupo', 'id_grupo', (int) $id_group);
|
|
|
|
else
|
|
|
|
$icon = "world";
|
|
|
|
|
|
|
|
if($style == '')
|
|
|
|
$style = 'width: 16px; height: 16px;';
|
|
|
|
|
|
|
|
$output = '';
|
|
|
|
if ($link)
|
|
|
|
$output = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$id_group.'">';
|
|
|
|
|
|
|
|
if (empty ($icon))
|
|
|
|
$output .= '<span title="'. get_group_name($id_group, true).'"> - </span>';
|
|
|
|
else
|
|
|
|
$output .= '<img style="' . $style . '" class="bot" src="'.$path.'/'.$icon.'.png" alt="'.get_group_name ($id_group, true).'" title="'.get_group_name ($id_group, true).'" />';
|
|
|
|
|
|
|
|
if ($link)
|
|
|
|
$output .= '</a>';
|
|
|
|
|
|
|
|
if (!$return)
|
|
|
|
echo $output;
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
2009-01-07 11:42:38 +01:00
|
|
|
/**
|
|
|
|
* Get the icon of an operating system.
|
|
|
|
*
|
|
|
|
* @param int Operating system id
|
|
|
|
* @param bool Whether to also append the name of the OS after the icon
|
|
|
|
* @param bool Whether to return or echo the result
|
|
|
|
*
|
|
|
|
* @return string HTML with icon of the OS
|
|
|
|
*/
|
|
|
|
function print_os_icon ($id_os, $name = true, $return = false) {
|
|
|
|
$icon = (string) get_db_value ('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
|
|
|
|
$os_name = get_os_name ($id_os);
|
|
|
|
if (empty ($icon)) {
|
|
|
|
return "-";
|
|
|
|
}
|
|
|
|
|
2010-09-09 14:19:11 +02:00
|
|
|
$output = '<img src="images/os_icons/'.$icon.'" alt="'.$os_name.'" title="'.$os_name.'" />';
|
2009-01-07 11:42:38 +01:00
|
|
|
|
|
|
|
if ($name === true) {
|
|
|
|
$output .= ' - '.$os_name;
|
|
|
|
}
|
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
if (!$return)
|
|
|
|
echo $output;
|
2009-01-07 11:42:38 +01:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
return $output;
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints an agent name with the correct link
|
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param int Agent id
|
|
|
|
* @param bool Whether to return the string or echo it too
|
2009-04-09 23:06:17 +02:00
|
|
|
* @param int Now uses styles to accomplish this
|
2009-10-21 22:25:26 +02:00
|
|
|
* @param string Style of name in css.
|
2009-01-07 11:42:38 +01:00
|
|
|
*
|
|
|
|
* @return string HTML with agent name and link
|
2009-01-08 16:52:13 +01:00
|
|
|
*/
|
2010-08-04 13:08:16 +02:00
|
|
|
function print_agent_name ($id_agent, $return = false, $cutoff = 0, $style = '', $cutname = false) {
|
2009-01-07 11:42:38 +01:00
|
|
|
$agent_name = (string) get_agent_name ($id_agent);
|
2010-08-04 13:08:16 +02:00
|
|
|
$agent_name_full = $agent_name;
|
|
|
|
if($cutname) {
|
|
|
|
$agent_name = printTruncateText($agent_name, $cutname);
|
|
|
|
}
|
|
|
|
$output = '<a style="' . $style . '" href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.'" title="'.$agent_name_full.'"><b>'.$agent_name.'</b></a>';
|
2009-01-07 11:42:38 +01:00
|
|
|
|
|
|
|
//TODO: Add a pretty javascript (using jQuery) popup-box with agent details
|
|
|
|
|
|
|
|
if ($return)
|
|
|
|
return $output;
|
|
|
|
|
|
|
|
echo $output;
|
|
|
|
}
|
2009-01-15 11:21:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Formats a row from the alert table and returns an array usable in the table function
|
|
|
|
*
|
|
|
|
* @param array A valid (non empty) row from the alert table
|
|
|
|
* @param bool Whether or not this is a combined alert
|
|
|
|
* @param bool Whether to print the agent information with the module information
|
|
|
|
* @param string Tab where the function was called from (used for urls)
|
|
|
|
*
|
|
|
|
* @return array A formatted array with proper html for use in $table->data (6 columns)
|
|
|
|
*/
|
2009-02-11 17:55:04 +01:00
|
|
|
function format_alert_row ($alert, $compound = false, $agent = true, $url = '') {
|
2010-03-11 19:52:42 +01:00
|
|
|
|
|
|
|
$actionText = "";
|
2009-01-15 11:21:38 +01:00
|
|
|
require_once ("include/functions_alerts.php");
|
2009-10-21 22:25:26 +02:00
|
|
|
$isFunctionPolicies = enterprise_include_once ('include/functions_policies.php');
|
|
|
|
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
if ($agent) {
|
2010-09-17 14:34:11 +02:00
|
|
|
$index = array('policy' => 0, 'standby' => 1, 'force_execution' => 2, 'agent_name' => 3, 'module_name' => 4,
|
|
|
|
'description' => 5, 'template' => 5, 'action' => 6, 'last_fired' => 7, 'status' => 8,
|
|
|
|
'validate' => 9);
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
}
|
|
|
|
else {
|
2010-09-17 14:34:11 +02:00
|
|
|
$index = array('policy' => 0, 'standby' => 1, 'force_execution' => 2, 'agent_name' => 3, 'module_name' => 3,
|
|
|
|
'description' => 4, 'template' => 4, 'action' => 5, 'last_fired' => 6, 'status' => 7,
|
|
|
|
'validate' => 8);
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($agent) {
|
2010-09-17 14:34:11 +02:00
|
|
|
$index = array('standby' => 0, 'force_execution' => 1, 'agent_name' => 2, 'module_name' => 3,
|
|
|
|
'description' => 4, 'template' => 4, 'action' => 5, 'last_fired' => 6, 'status' => 7,
|
|
|
|
'validate' => 7);
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
}
|
|
|
|
else {
|
2010-09-17 14:34:11 +02:00
|
|
|
$index = array('standby' => 0, 'force_execution' => 1, 'agent_name' => 2, 'module_name' => 2,
|
|
|
|
'description' => 3, 'template' => 3, 'action' => 4, 'last_fired' => 5, 'status' => 6,
|
|
|
|
'validate' => 7);
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
}
|
|
|
|
}
|
2009-10-21 22:25:26 +02:00
|
|
|
|
|
|
|
if ($alert['disabled']) {
|
|
|
|
$disabledHtmlStart = '<span style="font-style: italic; color: #aaaaaa;">';
|
|
|
|
$disabledHtmlEnd = '</span>';
|
|
|
|
$styleDisabled = "font-style: italic; color: #aaaaaa;";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$disabledHtmlStart = '';
|
|
|
|
$disabledHtmlEnd = '';
|
|
|
|
$styleDisabled = "";
|
|
|
|
}
|
2009-01-15 11:21:38 +01:00
|
|
|
|
|
|
|
if (empty ($alert))
|
2009-10-21 22:25:26 +02:00
|
|
|
{
|
|
|
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK)
|
|
|
|
return array ("", "", "", "", "", "", "", "");
|
|
|
|
else
|
|
|
|
return array ("", "", "", "", "", "", "");
|
|
|
|
}
|
2009-01-15 11:21:38 +01:00
|
|
|
|
|
|
|
// Get agent id
|
2009-02-11 17:55:04 +01:00
|
|
|
if ($compound) {
|
|
|
|
$id_agent = $alert['id_agent'];
|
|
|
|
$description = $alert['description'];
|
2009-10-21 22:25:26 +02:00
|
|
|
}
|
|
|
|
else {
|
2009-02-11 17:55:04 +01:00
|
|
|
$id_agent = get_agentmodule_agent ($alert['id_agent_module']);
|
|
|
|
$template = get_alert_template ($alert['id_alert_template']);
|
2009-11-25 10:12:42 +01:00
|
|
|
$description = safe_output($template['name']);
|
2009-02-11 17:55:04 +01:00
|
|
|
}
|
2009-01-15 11:21:38 +01:00
|
|
|
$data = array ();
|
|
|
|
|
2009-10-21 22:25:26 +02:00
|
|
|
if (($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) && (!$compound)) {
|
|
|
|
$policyInfo = isAlertInPolicy($alert['id_agent_module'], $alert['id_alert_template'], false);
|
|
|
|
if ($policyInfo === false)
|
|
|
|
$data[$index['policy']] = '';
|
|
|
|
else {
|
|
|
|
$img = 'images/policies.png';
|
|
|
|
|
|
|
|
$data[$index['policy']] = '<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id_policy'] . '">' .
|
|
|
|
print_image($img,true, array('title' => $policyInfo['name_policy'])) .
|
|
|
|
'</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) && ($compound))
|
|
|
|
$data[$index['policy']] = '';
|
|
|
|
|
2010-09-17 14:34:11 +02:00
|
|
|
// Standby
|
|
|
|
$data[$index['standby']] = '';
|
|
|
|
if ($alert["standby"] == 1) {
|
|
|
|
$data[$index['standby']] = print_image ('images/bell_pause.png', true, array('title' => __('Standby on')));
|
|
|
|
}
|
|
|
|
|
2009-01-15 11:21:38 +01:00
|
|
|
// Force alert execution
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['force_execution']] = '';
|
2009-02-11 17:55:04 +01:00
|
|
|
if (! $compound) {
|
2009-01-15 11:21:38 +01:00
|
|
|
if ($alert["force_execution"] == 0) {
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['force_execution']] =
|
|
|
|
'<a href="'.$url.'&id_alert='.$alert["id"].'&force_execution=1&refr=60"><img src="images/target.png" ></a>';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$data[$index['force_execution']] =
|
|
|
|
'<a href="'.$url.'&id_alert='.$alert["id"].'&refr=60"><img src="images/refresh.png" /></a>';
|
2009-01-15 11:21:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['agent_name']] = $disabledHtmlStart;
|
2009-02-11 17:55:04 +01:00
|
|
|
if ($compound) {
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['agent_name']] .= print_agent_name ($id_agent, true, 20, $styleDisabled);
|
|
|
|
}
|
|
|
|
elseif ($agent == 0) {
|
|
|
|
$data[$index['module_name']] .= mb_substr (get_agentmodule_name ($alert["id_agent_module"]), 0, 20);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$data[$index['agent_name']] .= print_agent_name (get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled);
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
$data[$index['module_name']] = mb_substr (get_agentmodule_name ($alert["id_agent_module"]), 0, 20);
|
2009-01-15 11:21:38 +01:00
|
|
|
}
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['agent_name']] .= $disabledHtmlEnd;
|
2009-01-15 11:21:38 +01:00
|
|
|
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['description']] = '';
|
2009-02-11 17:55:04 +01:00
|
|
|
if (! $compound) {
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['template']] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$template['id'].'">';
|
|
|
|
$data[$index['template']] .= print_image ('images/zoom.png', true);
|
|
|
|
$data[$index['template']] .= '</a> ';
|
2009-12-24 16:57:09 +01:00
|
|
|
$actionDefault = get_db_value_sql("SELECT id_alert_action
|
|
|
|
FROM talert_templates WHERE id = " . $alert['id_alert_template']);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$actionDefault = get_db_value_sql("SELECT id_alert_action FROM talert_compound_actions WHERE id_alert_compound = " . $alert['id']);
|
2009-02-11 17:55:04 +01:00
|
|
|
}
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['description']] .= $disabledHtmlStart . mb_substr (safe_input ($description), 0, 35) . $disabledHtmlEnd;
|
2009-01-15 11:21:38 +01:00
|
|
|
|
2009-12-24 16:57:09 +01:00
|
|
|
$actions = get_alert_agent_module_actions ($alert['id'], false, $compound);
|
2010-02-25 19:48:36 +01:00
|
|
|
|
|
|
|
if (!empty($actions)){
|
|
|
|
$actionText = '<ul class="action_list">';
|
|
|
|
foreach ($actions as $action) {
|
|
|
|
$actionText .= '<li><div><span class="action_name">' . $action['name'];
|
|
|
|
if ($action["fires_min"] != $action["fires_max"]){
|
|
|
|
$actionText .= " (".$action["fires_min"] . " / ". $action["fires_max"] . ")";
|
|
|
|
}
|
|
|
|
$actionText .= '</li></span><br></div>';
|
2009-11-30 16:42:57 +01:00
|
|
|
}
|
2010-02-25 19:48:36 +01:00
|
|
|
$actionText .= '</div></ul>';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($actionDefault != "")
|
|
|
|
$actionText = get_db_sql ("SELECT name FROM talert_actions WHERE id = $actionDefault"). " <i>(".__("Default") . ")</i>";
|
2009-11-30 16:42:57 +01:00
|
|
|
}
|
2010-02-25 19:48:36 +01:00
|
|
|
|
2009-11-25 12:00:59 +01:00
|
|
|
$data[$index['action']] = $actionText;
|
|
|
|
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['last_fired']] = $disabledHtmlStart . print_timestamp ($alert["last_fired"], true) . $disabledHtmlEnd;
|
2009-01-15 11:21:38 +01:00
|
|
|
|
2009-04-06 13:02:05 +02:00
|
|
|
|
|
|
|
$status = STATUS_ALERT_NOT_FIRED;
|
|
|
|
$title = "";
|
2009-01-15 11:21:38 +01:00
|
|
|
|
|
|
|
if ($alert["times_fired"] > 0) {
|
2009-04-06 13:02:05 +02:00
|
|
|
$status = STATUS_ALERT_FIRED;
|
|
|
|
$title = __('Alert fired').' '.$alert["times_fired"].' '.__('times');
|
2009-01-15 11:21:38 +01:00
|
|
|
} elseif ($alert["disabled"] > 0) {
|
2009-04-06 13:02:05 +02:00
|
|
|
$status = STATUS_ALERT_DISABLED;
|
|
|
|
$title = __('Alert disabled');
|
2009-01-15 11:21:38 +01:00
|
|
|
} else {
|
2009-04-06 13:02:05 +02:00
|
|
|
$status = STATUS_ALERT_NOT_FIRED;
|
|
|
|
$title = __('Alert not fired');
|
2009-01-15 11:21:38 +01:00
|
|
|
}
|
|
|
|
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['status']] = print_status_image($status, $title, true);
|
2009-01-15 11:21:38 +01:00
|
|
|
|
2009-02-11 17:55:04 +01:00
|
|
|
if ($compound) {
|
2009-10-21 22:25:26 +02:00
|
|
|
$data[$index['validate']] = print_checkbox ("validate_compound[]", $alert["id"], false, true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$data[$index['validate']] = print_checkbox ("validate[]", $alert["id"], false, true);
|
2009-02-11 17:55:04 +01:00
|
|
|
}
|
2009-01-15 11:21:38 +01:00
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints a substracted string, length specified by cutoff, the full string will be in a rollover.
|
|
|
|
*
|
|
|
|
* @param string The string to be cut
|
|
|
|
* @param int At how much characters to cut
|
|
|
|
* @param bool Whether to return or print it out
|
|
|
|
*
|
|
|
|
* @return An HTML string
|
|
|
|
*/
|
|
|
|
function print_string_substr ($string, $cutoff = 16, $return = false) {
|
2009-02-17 19:20:04 +01:00
|
|
|
if (empty ($string)) {
|
|
|
|
return "";
|
|
|
|
}
|
2009-11-27 Sancho lerena <slerena@artica.es>
* operation/menu.php: User section has no ACL check, always can be seen.
* index.php: Added suppor for user-defined custom language (this code was
on my disk for 3 months, pending to be commited!).
* include/functions_db.php,
* include/functions_agents.php,
* godmode/alerts/alert_list.php,
* godmode/agentes/modificar_agente.php,
* godmode/agentes/configurar_agente.php: Added audit calls to several
management operations who don't have or have insufficient audit info.
* godmode/users/configure_user.php: Fixed several annoyings bugs. Added
custom language support, and added more audit info on management operations.
* godmode/users/user_list.php: More audit info.
* include/config_process.php: Add new debug option to render error log to
/pandora_console.log. Also set timezone if not defined (this makes warnings
on several PHP 5.x setups). Added user custom language support.
* include/functions_events.php: More audit info. Fixed problems with HTML
encoding render.
* functions_io.php: Some cleaning.
* include/functions_messages.php: Fixed problems with HTML
encoding render.
* functions_ui.php: Fixed problems with HTML encoding render in
print_string_substr() function.
* auth/mysql.php: is_user_admin() functions seems to be broken ¿?¿!. Fixed.
* styles/pandora.css: removed green colored left border in default style.
* message.php, incident*: Fixed problems with HTML encoding render.
* user.php: Better ACL check before let user to view/edit another user.
* user_edit: Removed some un-used form fields, some arrangements in layout,
and FIXED forever problems with password change (new code written).
* users/user_statistics.php: Now user can see its own audit records.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2139 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-27 21:02:12 +01:00
|
|
|
|
|
|
|
$string2 = safe_output ($string);
|
|
|
|
if (mb_strlen($string2, "UTF-8") > $cutoff){
|
|
|
|
$string3 = "...";
|
|
|
|
} else {
|
|
|
|
$string3 = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$string = '<span title="'.safe_input($string2).'">'.mb_substr ($string2, 0, $cutoff, "UTF-8").$string3.'</span>';
|
|
|
|
|
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
|
|
|
if ($return === false) {
|
|
|
|
echo $string;
|
|
|
|
}
|
|
|
|
return $string;
|
|
|
|
}
|
2009-01-21 15:56:55 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a helper text explaining the requirement needs for an alert template
|
|
|
|
* to get it fired.
|
|
|
|
*
|
|
|
|
* @param int Alert template id.
|
|
|
|
* @param bool Wheter to return or print it out.
|
2009-01-29 10:06:38 +01:00
|
|
|
* @param bool Wheter to put the values in the string or not.
|
2009-01-21 15:56:55 +01:00
|
|
|
*
|
|
|
|
* @return An HTML string if return was true.
|
|
|
|
*/
|
2009-01-29 10:06:38 +01:00
|
|
|
function print_alert_template_example ($id_alert_template, $return = false, $print_values = true) {
|
2009-01-21 15:56:55 +01:00
|
|
|
$output = '';
|
|
|
|
|
|
|
|
$output .= '<img src="images/information.png" /> ';
|
|
|
|
$output .= '<span id="example">';
|
2009-01-26 11:44:26 +01:00
|
|
|
$template = get_alert_template ($id_alert_template);
|
|
|
|
|
|
|
|
switch ($template['type']) {
|
|
|
|
case 'equal':
|
|
|
|
/* Do not translate the HTML attributes */
|
|
|
|
$output .= __('The alert would fire when the value is <span id="value"></span>');
|
|
|
|
break;
|
|
|
|
case 'not_equal':
|
|
|
|
/* Do not translate the HTML attributes */
|
|
|
|
$output .= __('The alert would fire when the value is not <span id="value"></span>');
|
|
|
|
break;
|
|
|
|
case 'regex':
|
|
|
|
if ($template['matches_value'])
|
2009-01-21 15:56:55 +01:00
|
|
|
/* Do not translate the HTML attributes */
|
2009-01-26 11:44:26 +01:00
|
|
|
$output .= __('The alert would fire when the value matches <span id="value"></span>');
|
|
|
|
else
|
2009-01-21 15:56:55 +01:00
|
|
|
/* Do not translate the HTML attributes */
|
2009-01-26 11:44:26 +01:00
|
|
|
$output .= __('The alert would fire when the value doesn\'t match <span id="value"></span>');
|
|
|
|
$value = $template['value'];
|
|
|
|
break;
|
|
|
|
case 'max_min':
|
|
|
|
if ($template['matches_value'])
|
2009-01-21 15:56:55 +01:00
|
|
|
/* Do not translate the HTML attributes */
|
2009-01-26 11:44:26 +01:00
|
|
|
$output .= __('The alert would fire when the value is between <span id="min"></span> and <span id="max"></span>');
|
|
|
|
else
|
2009-01-21 15:56:55 +01:00
|
|
|
/* Do not translate the HTML attributes */
|
2009-01-26 11:44:26 +01:00
|
|
|
$output .= __('The alert would fire when the value is not between <span id="min"></span> and <span id="max"></span>');
|
|
|
|
break;
|
|
|
|
case 'max':
|
|
|
|
/* Do not translate the HTML attributes */
|
|
|
|
$output .= __('The alert would fire when the value is over <span id="max"></span>');
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 'min':
|
|
|
|
/* Do not translate the HTML attributes */
|
|
|
|
$output .= __('The alert would fire when the value is under <span id="min"></span>');
|
2009-04-02 14:53:27 +02:00
|
|
|
|
|
|
|
break;
|
|
|
|
case 'warning':
|
|
|
|
/* Do not translate the HTML attributes */
|
|
|
|
$output .= __('The alert would fire when the module is in warning status');
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 'critical':
|
|
|
|
/* Do not translate the HTML attributes */
|
|
|
|
$output .= __('The alert would fire when the module is in critical status');
|
2009-01-26 11:44:26 +01:00
|
|
|
break;
|
2009-01-21 15:56:55 +01:00
|
|
|
}
|
|
|
|
|
2009-01-29 10:06:38 +01:00
|
|
|
if ($print_values) {
|
|
|
|
/* Replace span elements with real values. This is done in such way to avoid
|
|
|
|
duplicating strings and make it easily modificable via Javascript. */
|
|
|
|
$output = str_replace ('<span id="value"></span>', $template['value'], $output);
|
|
|
|
$output = str_replace ('<span id="max"></span>', $template['max_value'], $output);
|
|
|
|
$output = str_replace ('<span id="min"></span>', $template['min_value'], $output);
|
|
|
|
}
|
2009-01-21 15:56:55 +01:00
|
|
|
$output .= '</span>';
|
|
|
|
if ($return)
|
|
|
|
return $output;
|
|
|
|
echo $output;
|
|
|
|
}
|
|
|
|
|
2009-02-13 21:23:44 +01:00
|
|
|
/**
|
|
|
|
* Prints a help tip icon.
|
|
|
|
*
|
2009-03-30 11:27:04 +02:00
|
|
|
* @param string Id of the help article
|
|
|
|
* @param bool Whether to return or output the result
|
2009-02-13 21:23:44 +01:00
|
|
|
*
|
|
|
|
* @return string The help tip
|
|
|
|
*/
|
|
|
|
function print_help_icon ($help_id, $return = false) {
|
2009-03-24 Esteban Sanchez <estebans@artica.es>
* general/pandora_help.php: Added support for enterprise help files.
* include/javascript/pandora.js: Renamed pandora_help() to
open_help().
* include/functions_ui.php: Renamed event function on
print_help_icon(). Removed deprecated pandora_help().
* godmode/agentes/module_manager.php: Added enterprise hooks.
* godmode/agentes/module_manager_editor.php: Added categories
construction here. Added enterprise hooks.
* godmode/agentes/module_manager_editor_common.php: Replaced
deprecated pandora_help() with print_help_icon(). Moved categories
construction to module_manager_editor.
* include/config_process.php: Updated build version.
* include/styles/pandora.css: Fixed textarea height.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/massive_config.php,
godmode/agentes/massive_edit_modules.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/planned_downtime.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/reporting/map_builder.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask_form.php, godmode/servers/plugin.php,
godmode/setup/setup.php, operation/agentes/alerts_status.php,
operation/agentes/tactical.php,
godmode/agentes/agent_manager.php: Replaced deprecated pandora_help()
with print_help_icon().
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1557 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-24 16:38:54 +01:00
|
|
|
$output = ' '.print_image ("images/help.png", true,
|
|
|
|
array ("class" => "img_help",
|
|
|
|
"title" => __('Help'),
|
|
|
|
"onclick" => "open_help ('".$help_id."')"));
|
2009-02-13 21:23:44 +01:00
|
|
|
if (!$return)
|
|
|
|
echo $output;
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a CSS file to the HTML head tag.
|
|
|
|
*
|
|
|
|
* To make a CSS file available just put it in include/styles. The
|
|
|
|
* file name should be like "name.css". The "name" would be the value
|
|
|
|
* needed to pass to this function.
|
|
|
|
|
|
|
|
* @param string Script name to add without the "jquery." prefix and the ".js"
|
|
|
|
* suffix. Example:
|
|
|
|
<code>
|
|
|
|
require_css_file ('pandora');
|
|
|
|
// Would include include/styles/pandora.js
|
|
|
|
</code>
|
|
|
|
*
|
|
|
|
* @return bool True if the file was added. False if the file doesn't exist.
|
|
|
|
*/
|
|
|
|
function require_css_file ($name, $path = 'include/styles/') {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$filename = $path.$name.'.css';
|
|
|
|
|
|
|
|
if (! isset ($config['css']))
|
|
|
|
$config['css'] = array ();
|
|
|
|
if (isset ($config['css'][$name]))
|
|
|
|
return true;
|
|
|
|
if (! file_exists ($filename) && ! file_exists ($config['homedir'].'/'.$filename))
|
|
|
|
return false;
|
|
|
|
$config['css'][$name] = $filename;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a javascript file to the HTML head tag.
|
|
|
|
*
|
|
|
|
* To make a javascript file available just put it in include/javascript. The
|
|
|
|
* file name should be like "name.js". The "name" would be the value
|
|
|
|
* needed to pass to this function.
|
|
|
|
|
|
|
|
* @param string Script name to add without the "jquery." prefix and the ".js"
|
|
|
|
* suffix. Example:
|
|
|
|
<code>
|
|
|
|
require_javascript_file ('pandora');
|
|
|
|
// Would include include/javascript/pandora.js
|
|
|
|
</code>
|
|
|
|
*
|
|
|
|
* @return bool True if the file was added. False if the file doesn't exist.
|
|
|
|
*/
|
|
|
|
function require_javascript_file ($name, $path = 'include/javascript/') {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$filename = $path.$name.'.js';
|
|
|
|
|
|
|
|
if (! isset ($config['js']))
|
|
|
|
$config['js'] = array ();
|
|
|
|
if (isset ($config['js'][$name]))
|
|
|
|
return true;
|
|
|
|
/* We checks two paths because it may fails on enterprise */
|
|
|
|
if (! file_exists ($filename) && ! file_exists ($config['homedir'].'/'.$filename))
|
|
|
|
return false;
|
2010-02-10 11:16:51 +01:00
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$config['js'][$name] = $filename;
|
2010-02-10 11:16:51 +01:00
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a jQuery file to the HTML head tag.
|
|
|
|
*
|
|
|
|
* To make a jQuery script available just put it in include/javascript. The
|
|
|
|
* file name should be like "jquery.name.js". The "name" would be the value
|
|
|
|
* needed to pass to this function. Notice that this function does not manage
|
|
|
|
* jQuery denpendencies.
|
|
|
|
|
|
|
|
* @param string Script name to add without the "jquery." prefix and the ".js"
|
|
|
|
* suffix. Example:
|
|
|
|
<code>
|
|
|
|
require_jquery_file ('form');
|
|
|
|
// Would include include/javascript/jquery.form.js
|
|
|
|
</code>
|
|
|
|
*
|
|
|
|
* @return bool True if the file was added. False if the file doesn't exist.
|
|
|
|
*/
|
|
|
|
function require_jquery_file ($name, $path = 'include/javascript/') {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$filename = $path.'jquery.'.$name.'.js';
|
|
|
|
|
|
|
|
if (! isset ($config['jquery']))
|
|
|
|
$config['jquery'] = array ();
|
|
|
|
if (isset ($config['jquery'][$name]))
|
|
|
|
return true;
|
|
|
|
/* We checks two paths because it may fails on enterprise */
|
|
|
|
if (! file_exists ($filename) && ! file_exists ($config['homedir'].'/'.$filename))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
$config['jquery'][$name] = $filename;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback function to add stuff to the head. This allows us to add scripts
|
|
|
|
* to the header after the fact as well as extensive validation.
|
|
|
|
*
|
|
|
|
* DO NOT CALL print_f, echo, ob_start, ob_flush, ob_end functions here.
|
|
|
|
*
|
|
|
|
* To add css just put them in include/styles and then add them to the
|
|
|
|
* $config['css'] array
|
|
|
|
*
|
|
|
|
* @param string Callback will fill this with the current buffer.
|
|
|
|
* @param bitfield Callback will fill this with a bitfield (see ob_start)
|
|
|
|
*
|
|
|
|
* @return string String to return to the browser
|
|
|
|
*/
|
|
|
|
function process_page_head ($string, $bitfield) {
|
|
|
|
global $config;
|
2009-05-19 21:04:43 +02:00
|
|
|
|
|
|
|
if (isset ($config['ignore_callback']) && $config['ignore_callback'] == true) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output = '';
|
|
|
|
|
|
|
|
if ($config["refr"] > 0) {
|
2009-04-21 21:03:16 +02:00
|
|
|
$query = get_url_refresh (false);
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output .= '<meta http-equiv="refresh" content="'.$config["refr"].'; URL='.$query.'" />';
|
|
|
|
}
|
|
|
|
$output .= "\n\t";
|
|
|
|
$output .= '<title>Pandora FMS - '.__('the Flexible Monitoring System').'</title>
|
|
|
|
<meta http-equiv="expires" content="0" />
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
|
|
<meta http-equiv="Content-Style-Type" content="text/css" />
|
|
|
|
<meta name="resource-type" content="document" />
|
|
|
|
<meta name="distribution" content="global" />
|
|
|
|
<meta name="author" content="Sancho Lerena" />
|
|
|
|
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others" />
|
|
|
|
<meta name="keywords" content="pandora, monitoring, system, GPL, software" />
|
|
|
|
<meta name="robots" content="index, follow" />
|
|
|
|
<link rel="icon" href="images/pandora.ico" type="image/ico" />
|
2009-03-05 18:40:40 +01:00
|
|
|
<link rel="alternate" href="operation/events/events_rss.php" title="Pandora RSS Feed" type="application/rss+xml" />';
|
2009-04-13 18:13:55 +02:00
|
|
|
|
2009-02-19 22:34:27 +01:00
|
|
|
if ($config["language"] != "en") {
|
2009-02-24 17:31:02 +01:00
|
|
|
//Load translated strings - load them last so they overload all the objects
|
|
|
|
require_javascript_file ("time_".$config["language"]);
|
|
|
|
require_javascript_file ("date".$config["language"]);
|
|
|
|
require_javascript_file ("countdown_".$config["language"]);
|
2009-02-19 22:34:27 +01:00
|
|
|
}
|
|
|
|
$output .= "\n\t";
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
//Load CSS
|
|
|
|
if (empty ($config['css'])) {
|
2009-03-02 Esteban Sanchez <estebans@artica.es>
* include/functions_menu.php: Added to repository. Functions for menu.
* operation/menu.php, godmode/menu.php: Added class to menu due to
changes in print_menu().
* general/main_menu.php: temp_print_menu() moved to functions_menu.php
* include/functions_themes.php: Added to repository. Implement
functions relative to themes (only CSS themes list at this moment).
* include/styles/pandora.css, include/styles/pandora_black.css,
include/styles/pandora_minimal.css, include/styles/pandora_red.css:
Added author, name and description comments to adopt to new
get_themes() interface.
* include/styles/pandora_width.css: Improved and make lighter by
simply rewrite some classes.
* include/functions.php: Added is_ajax().
* godmode/agentes/module_manager_editor.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php, godmode/groups/group_list.php,
godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php,
operation/agentes/estado_agente.php, operation/agentes/ver_agente.php,
operation/events/events.php, operation/messages/message.php: Use
is_ajax()
* godmode/setup/setup.php: Use enterprise_include() instead of manual
checking. Use get_css_themes() to show the theme list.
* include/styles/common.css: Added to repository. Minimal styles to
make pandora works and common with all the CSS themes.
* include/functions_ui.php: Added common.css file.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1496 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-02 14:43:15 +01:00
|
|
|
$config['css'] = array ();
|
2009-02-24 17:31:02 +01:00
|
|
|
}
|
|
|
|
|
2009-05-29 11:28:48 +02:00
|
|
|
//User style should go last so it can rewrite common styles
|
2009-04-13 18:13:55 +02:00
|
|
|
$config['css'] = array_merge (array (
|
|
|
|
"common" => "include/styles/common.css",
|
|
|
|
"menu" => "include/styles/menu.css",
|
2009-05-13 19:00:58 +02:00
|
|
|
"tip", "include/styles/tip.css",
|
|
|
|
$config['style'] => "include/styles/".$config['style'].".css"), $config['css']);
|
2009-02-24 17:31:02 +01:00
|
|
|
|
|
|
|
//We can't load empty and we loaded (conditionally) ie
|
|
|
|
$loaded = array ('', 'ie');
|
|
|
|
foreach ($config['css'] as $name => $filename) {
|
|
|
|
if (in_array ($name, $loaded))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
array_push ($loaded, $name);
|
|
|
|
if (!empty ($config["compact_header"])) {
|
|
|
|
$output .= '<style type="text/css">';
|
|
|
|
$style = file_get_contents ($config["homedir"]."/".$filename);
|
2009-04-13 18:13:55 +02:00
|
|
|
//Replace paths
|
|
|
|
$style = str_replace (array ("@import url(", "../../images"), array ("@import url(include/styles/", "images"), $style);
|
|
|
|
//Remove comments
|
|
|
|
$output .= preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $style);
|
2009-02-24 17:31:02 +01:00
|
|
|
$output .= '</style>';
|
|
|
|
} else {
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output .= '<link rel="stylesheet" href="'.$filename.'" type="text/css" />'."\n\t";
|
|
|
|
}
|
|
|
|
}
|
2009-02-24 17:31:02 +01:00
|
|
|
//End load CSS
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
//Load JS
|
|
|
|
if (empty ($config['js'])) {
|
|
|
|
$config['js'] = array (); //If it's empty, false or not init set array to empty just in case
|
|
|
|
}
|
|
|
|
|
|
|
|
//Pandora specific JavaScript should go first
|
|
|
|
$config['js'] = array_merge (array ("pandora" => "include/javascript/pandora.js"), $config['js']);
|
|
|
|
|
|
|
|
//Load other javascript
|
|
|
|
//We can't load empty
|
|
|
|
$loaded = array ('');
|
|
|
|
foreach ($config['js'] as $name => $filename) {
|
|
|
|
if (in_array ($name, $loaded))
|
|
|
|
continue;
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
array_push ($loaded, $name);
|
|
|
|
if (!empty ($config["compact_header"])) {
|
|
|
|
$output .= '<script type="text/javascript">/* <![CDATA[ */'."\n";
|
|
|
|
$output .= file_get_contents ($config["homedir"]."/".$filename);
|
|
|
|
$output .= "\n".'/* ]]> */</script>';
|
|
|
|
} else {
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output .= '<script type="text/javascript" src="'.$filename.'"></script>'."\n\t";
|
|
|
|
}
|
|
|
|
}
|
2009-02-24 17:31:02 +01:00
|
|
|
//End load JS
|
|
|
|
|
|
|
|
//Load jQuery
|
|
|
|
if (empty ($config['jquery'])) {
|
|
|
|
$config['jquery'] = array (); //If it's empty, false or not init set array to empty just in case
|
|
|
|
}
|
|
|
|
|
|
|
|
//Pandora specific jquery should go first
|
2009-03-03 16:21:13 +01:00
|
|
|
$config['jquery'] = array_merge (array ("jquery" => "include/javascript/jquery.js",
|
|
|
|
"pandora" => "include/javascript/jquery.pandora.js"),
|
|
|
|
$config['jquery']);
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
//Then add each script as necessary
|
|
|
|
$loaded = array ('');
|
|
|
|
foreach ($config['jquery'] as $name => $filename) {
|
|
|
|
if (in_array ($name, $loaded))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
array_push ($loaded, $name);
|
|
|
|
if (!empty ($config["compact_header"])) {
|
|
|
|
$output .= '<script type="text/javascript">/* <![CDATA[ */'."\n";
|
|
|
|
$output .= file_get_contents ($config["homedir"]."/".$filename);
|
|
|
|
$output .= "\n".'/* ]]> */</script>';
|
|
|
|
} else {
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output .= '<script type="text/javascript" src="'.$filename.'"></script>'."\n\t";
|
|
|
|
}
|
|
|
|
}
|
2009-03-13 12:22:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
$output .= '<!--[if gte IE 6]>
|
|
|
|
<link rel="stylesheet" href="include/styles/ie.css" type="text/css"/>
|
|
|
|
<![endif]-->';
|
2009-04-13 18:13:55 +02:00
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output .= $string;
|
2009-04-13 18:13:55 +02:00
|
|
|
|
|
|
|
if (!empty ($config["compact_header"])) {
|
|
|
|
$output = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $output);
|
|
|
|
}
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback function to add stuff to the body
|
|
|
|
*
|
|
|
|
* @param string Callback will fill this with the current buffer.
|
|
|
|
* @param bitfield Callback will fill this with a bitfield (see ob_start)
|
|
|
|
*
|
|
|
|
* @return string String to return to the browser
|
|
|
|
*/
|
|
|
|
function process_page_body ($string, $bitfield) {
|
|
|
|
global $config;
|
|
|
|
|
2009-05-19 21:04:43 +02:00
|
|
|
if (isset ($config['ignore_callback']) && $config['ignore_callback'] == true) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
// Show custom background
|
2009-05-29 11:28:48 +02:00
|
|
|
$output = '<body'.($config["pure"] ? ' class="pure"' : '').'>';
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
|
2009-04-13 18:13:55 +02:00
|
|
|
if (!empty ($config["compact_header"])) {
|
|
|
|
require_once ($config["homedir"]."/include/htmlawed.php");
|
|
|
|
$htmLawedconfig = array ("valid_xhtml" => 1, "tidy" => -1);
|
|
|
|
$output .= htmLawed ($string, $htmLawedconfig);
|
|
|
|
} else {
|
|
|
|
$output .= $string;
|
|
|
|
}
|
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
$output .= '</body>';
|
2009-04-13 18:13:55 +02:00
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
return $output;
|
|
|
|
}
|
2009-02-20 22:48:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints a pagination menu to browse into a collection of data.
|
|
|
|
*
|
|
|
|
* @param int $count Number of elements in the collection.
|
|
|
|
* @param string $url URL of the pagination links. It must include all form
|
|
|
|
* values as GET form.
|
|
|
|
* @param int $offset Current offset for the pagination. Default value would be
|
|
|
|
* taken from $_REQUEST['offset']
|
|
|
|
* @param int $pagination Current pagination size. If a user requests a larger
|
|
|
|
* pagination than config["block_size"]
|
|
|
|
* @param bool $return Whether to return or print this
|
|
|
|
*
|
|
|
|
* @return string The pagination div or nothing if no pagination needs to be done
|
|
|
|
*/
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
function pagination ($count, $url = false, $offset = 0, $pagination = 0, $return = false, $offset_name = 'offset') {
|
2009-02-20 22:48:09 +01:00
|
|
|
global $config;
|
|
|
|
|
|
|
|
if (empty ($pagination)) {
|
2009-05-18 Esteban Sanchez <estebans@artica.es>
* images/award_star_bronze_1.png, images/award_star_bronze_2.png,
images/award_star_bronze_3.png, images/award_star_gold_2.png,
images/award_star_silver_1.png, images/bullet_add.png,
images/bullet_black.png, images/bullet_blue.png,
images/bullet_delete.png, images/bullet_disk.png,
images/bullet_error.png, images/bullet_go.png,
images/bullet_green.png, images/bullet_key.png,
images/bullet_white.png, images/bullet_wrench.png,
images/bullet_yellow.png, images/dot_down.png, images/exclamation.png,
images/flag_blue.png, images/flag_green.png, images/flag_yellow.png,
images/help_small.jpg, images/lock_open.png, images/mod_udp_proc.png,
images/newspaper.png, images/phone_sound.png, images/pixel_blue.png,
images/plugin_disabled.png, images/plugin_enabled.png,
images/pulpo_lupa.png, images/shield.png, images/so_beos.png,
images/status_busy.png, images/status_online.png, images/user_female.png,
images/user_gray.png, images/user_orange.png, images/user_red.png,
images/webcam.png: Deleted from repository. Unused icons.
* images/agents_group.png: Added to repository. New icon.
* godmode/agentes/configurar_agente.php,
operation/agentes/ver_agente.php: Replaced icon for agent group.
* include/functions_db.php: Replaced icons for data server. Style
correction.
* include/functions_ui.php: Cast block_size value for sanity.
* ChangeLog: Added some lines of a previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1692 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-18 16:57:30 +02:00
|
|
|
$pagination = (int) $config["block_size"];
|
2009-02-20 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
2009-05-07 16:44:26 +02:00
|
|
|
if (is_string ($offset)) {
|
|
|
|
$offset_name = $offset;
|
|
|
|
$offset = (int) get_parameter ($offset_name);
|
|
|
|
}
|
|
|
|
|
2009-02-20 22:48:09 +01:00
|
|
|
if (empty ($offset)) {
|
2009-05-07 16:44:26 +02:00
|
|
|
$offset = (int) get_parameter ($offset_name);
|
2009-02-20 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
2009-05-07 16:44:26 +02:00
|
|
|
if (empty ($url)) {
|
|
|
|
$url = get_url_refresh (array ($offset_name => false));
|
|
|
|
}
|
2009-02-20 22:48:09 +01:00
|
|
|
|
|
|
|
/* URL passed render links with some parameter
|
|
|
|
&offset - Offset records passed to next page
|
|
|
|
&counter - Number of items to be blocked
|
|
|
|
Pagination needs $url to build the base URL to render links, its a base url, like
|
|
|
|
" http://pandora/index.php?sec=godmode&sec2=godmode/admin_access_logs "
|
|
|
|
*/
|
|
|
|
$block_limit = 15; // Visualize only $block_limit blocks
|
|
|
|
if ($count <= $pagination) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// If exists more registers than I can put in a page, calculate index markers
|
2009-02-24 17:24:02 +01:00
|
|
|
$index_counter = ceil ($count /$pagination); // Number of blocks of block_size with data
|
|
|
|
$index_page = ceil ($offset / $pagination) - (ceil ($block_limit / 2)); // block to begin to show data;
|
2009-02-20 22:48:09 +01:00
|
|
|
if ($index_page < 0)
|
|
|
|
$index_page = 0;
|
|
|
|
|
|
|
|
// This calculate index_limit, block limit for this search.
|
|
|
|
if (($index_page + $block_limit) > $index_counter)
|
|
|
|
$index_limit = $index_counter;
|
|
|
|
else
|
|
|
|
$index_limit = $index_page + $block_limit;
|
|
|
|
|
|
|
|
// This calculate if there are more blocks than visible (more than $block_limit blocks)
|
|
|
|
if ($index_counter > $block_limit )
|
|
|
|
$paginacion_maxima = 1; // If maximum blocks ($block_limit), show only 10 and "...."
|
|
|
|
else
|
|
|
|
$paginacion_maxima = 0;
|
|
|
|
|
|
|
|
// This setup first block of query
|
|
|
|
if ( $paginacion_maxima == 1)
|
|
|
|
if ($index_page == 0)
|
|
|
|
$inicio_pag = 0;
|
|
|
|
else
|
|
|
|
$inicio_pag = $index_page;
|
|
|
|
else
|
|
|
|
$inicio_pag = 0;
|
|
|
|
|
2009-04-01 10:04:49 +02:00
|
|
|
$output = '<div class="pagination">';
|
2009-02-20 22:48:09 +01:00
|
|
|
// Show GOTO FIRST button
|
2009-05-14 Esteban Sanchez <estebans@artica.es>
* images/go_first.png, images/go_last.png, images/go_next.png
images/go_previous.png, images/page_refresh.png: Added to repository.
* images/b_blue.png, images/b_green.png, images/binary.png,
images/b_magenta.png, images/b_red.png, images/brick.png,
images/bricks.png, images/bug.png, images/b_white.png,
images/b_yellow.png, images/cog.png, images/comments.png,
images/computer_error.png, images/computer.png, images/database_gear.png,
images/database_lightning.png, images/database.png,
images/database_refresh.png, images/disk.png, images/god3.png,
images/god5.png, images/god7.png, images/god8.png,
images/lightbulb_off.png, images/lightbulb.png,
images/lightning.png, images/network.png, images/plugin.png,
images/reporting_edit.png, images/setup.png: Update to tango theme.
Some of them were repainted using tango palette.
* images/control_end_blue.png, images/control_fastforward_blue.png
images/control_rewind_blue.png, images/control_start_blue.png
images/transmit.png: Deleted. Unused icons.
* general/header.php: Changed refresh icon.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1691 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-14 16:21:37 +02:00
|
|
|
$output .= '<a class="pagination go_first" href="'.$url.'&'.$offset_name.'=0">'.print_image ("images/go_first.png", true, array ("class" => "bot")).'</a> ';
|
2009-02-20 22:48:09 +01:00
|
|
|
// Show PREVIOUS button
|
2009-02-24 17:24:02 +01:00
|
|
|
if ($index_page > 0) {
|
|
|
|
$index_page_prev = ($index_page - (floor ($block_limit / 2))) * $pagination;
|
2009-02-20 22:48:09 +01:00
|
|
|
if ($index_page_prev < 0)
|
|
|
|
$index_page_prev = 0;
|
2009-05-14 Esteban Sanchez <estebans@artica.es>
* images/go_first.png, images/go_last.png, images/go_next.png
images/go_previous.png, images/page_refresh.png: Added to repository.
* images/b_blue.png, images/b_green.png, images/binary.png,
images/b_magenta.png, images/b_red.png, images/brick.png,
images/bricks.png, images/bug.png, images/b_white.png,
images/b_yellow.png, images/cog.png, images/comments.png,
images/computer_error.png, images/computer.png, images/database_gear.png,
images/database_lightning.png, images/database.png,
images/database_refresh.png, images/disk.png, images/god3.png,
images/god5.png, images/god7.png, images/god8.png,
images/lightbulb_off.png, images/lightbulb.png,
images/lightning.png, images/network.png, images/plugin.png,
images/reporting_edit.png, images/setup.png: Update to tango theme.
Some of them were repainted using tango palette.
* images/control_end_blue.png, images/control_fastforward_blue.png
images/control_rewind_blue.png, images/control_start_blue.png
images/transmit.png: Deleted. Unused icons.
* general/header.php: Changed refresh icon.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1691 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-14 16:21:37 +02:00
|
|
|
$output .= '<a class="pagination go_rewind" href="'.$url.'&'.$offset_name.'='.$index_page_prev.'">'.print_image ("images/go_previous.png", true, array ("class" => "bot")).'</a>';
|
2009-02-20 22:48:09 +01:00
|
|
|
}
|
|
|
|
$output .= " ";
|
|
|
|
// Draw blocks markers
|
|
|
|
// $i stores number of page
|
|
|
|
for ($i = $inicio_pag; $i < $index_limit; $i++) {
|
|
|
|
$inicio_bloque = ($i * $pagination);
|
|
|
|
$final_bloque = $inicio_bloque + $pagination;
|
|
|
|
if ($final_bloque > $count){ // if upper limit is beyond max, this shouldnt be possible !
|
|
|
|
$final_bloque = ($i-1) * $pagination + $count-(($i-1) * $pagination);
|
|
|
|
}
|
|
|
|
$output .= "<span>";
|
|
|
|
|
|
|
|
$inicio_bloque_fake = $inicio_bloque + 1;
|
|
|
|
// To Calculate last block (doesnt end with round data,
|
|
|
|
// it must be shown if not round to block limit)
|
2009-05-07 16:44:26 +02:00
|
|
|
$output .= '<a class="pagination" href="'.$url.'&'.$offset_name.'='.$inicio_bloque.'">';
|
2009-02-20 22:48:09 +01:00
|
|
|
if ($inicio_bloque == $offset) {
|
|
|
|
$output .= "<b>[ $i ]</b>";
|
|
|
|
} else {
|
|
|
|
$output .= "[ $i ]";
|
|
|
|
}
|
|
|
|
$output .= '</a></span>';
|
|
|
|
}
|
|
|
|
$output .= " ";
|
|
|
|
// Show NEXT PAGE (fast forward)
|
|
|
|
// Index_counter stores max of blocks
|
|
|
|
if (($paginacion_maxima == 1) AND (($index_counter - $i) > 0)) {
|
|
|
|
$prox_bloque = ($i + ceil ($block_limit / 2)) * $pagination;
|
|
|
|
if ($prox_bloque > $count)
|
|
|
|
$prox_bloque = ($count -1) - $pagination;
|
2009-05-14 Esteban Sanchez <estebans@artica.es>
* images/go_first.png, images/go_last.png, images/go_next.png
images/go_previous.png, images/page_refresh.png: Added to repository.
* images/b_blue.png, images/b_green.png, images/binary.png,
images/b_magenta.png, images/b_red.png, images/brick.png,
images/bricks.png, images/bug.png, images/b_white.png,
images/b_yellow.png, images/cog.png, images/comments.png,
images/computer_error.png, images/computer.png, images/database_gear.png,
images/database_lightning.png, images/database.png,
images/database_refresh.png, images/disk.png, images/god3.png,
images/god5.png, images/god7.png, images/god8.png,
images/lightbulb_off.png, images/lightbulb.png,
images/lightning.png, images/network.png, images/plugin.png,
images/reporting_edit.png, images/setup.png: Update to tango theme.
Some of them were repainted using tango palette.
* images/control_end_blue.png, images/control_fastforward_blue.png
images/control_rewind_blue.png, images/control_start_blue.png
images/transmit.png: Deleted. Unused icons.
* general/header.php: Changed refresh icon.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1691 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-14 16:21:37 +02:00
|
|
|
$output .= '<a class="pagination go_fastforward" href="'.$url.'&'.$offset_name.'='.$prox_bloque.'">'.print_image ("images/go_next.png", true, array ("class" => "bot")).'</a>';
|
2009-02-20 22:48:09 +01:00
|
|
|
$i = $index_counter;
|
|
|
|
}
|
|
|
|
// if exists more registers than i can put in a page (defined by $block_size config parameter)
|
|
|
|
// get offset for index calculation
|
|
|
|
// Draw "last" block link, ajust for last block will be the same
|
|
|
|
// as painted in last block (last integer block).
|
|
|
|
if (($count - $pagination) > 0) {
|
|
|
|
$myoffset = floor (($count - 1) / $pagination) * $pagination;
|
2009-05-14 Esteban Sanchez <estebans@artica.es>
* images/go_first.png, images/go_last.png, images/go_next.png
images/go_previous.png, images/page_refresh.png: Added to repository.
* images/b_blue.png, images/b_green.png, images/binary.png,
images/b_magenta.png, images/b_red.png, images/brick.png,
images/bricks.png, images/bug.png, images/b_white.png,
images/b_yellow.png, images/cog.png, images/comments.png,
images/computer_error.png, images/computer.png, images/database_gear.png,
images/database_lightning.png, images/database.png,
images/database_refresh.png, images/disk.png, images/god3.png,
images/god5.png, images/god7.png, images/god8.png,
images/lightbulb_off.png, images/lightbulb.png,
images/lightning.png, images/network.png, images/plugin.png,
images/reporting_edit.png, images/setup.png: Update to tango theme.
Some of them were repainted using tango palette.
* images/control_end_blue.png, images/control_fastforward_blue.png
images/control_rewind_blue.png, images/control_start_blue.png
images/transmit.png: Deleted. Unused icons.
* general/header.php: Changed refresh icon.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1691 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-14 16:21:37 +02:00
|
|
|
$output .= '<a class="pagination go_last" href="'.$url.'&'.$offset_name.'='.$myoffset.'">'.print_image ("images/go_last.png", true, array ("class" => "bot")).'</a>';
|
2009-02-20 22:48:09 +01:00
|
|
|
}
|
|
|
|
// End div and layout
|
|
|
|
$output .= "</div>";
|
|
|
|
|
|
|
|
if ($return === false)
|
|
|
|
echo $output;
|
|
|
|
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints only a tip button which shows a text when the user puts the mouse over it.
|
|
|
|
*
|
|
|
|
* @param string Complete text to show in the tip
|
|
|
|
* @param bool whether to return an output string or echo now
|
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
|
|
|
function print_help_tip ($text, $return = false) {
|
|
|
|
$output = '<a href="#" class="tip"> <span>'.$text.'</span></a>';
|
|
|
|
|
|
|
|
if ($return)
|
|
|
|
return $output;
|
|
|
|
echo $output;
|
|
|
|
}
|
2009-02-25 13:24:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Powerful debug function that also shows a backtrace.
|
|
|
|
*
|
|
|
|
* This functions need to have active $config['debug'] variable to work.
|
|
|
|
*
|
|
|
|
* @param mixed Variable name to debug
|
2009-03-12 10:20:49 +01:00
|
|
|
* @param bool Wheter to print the backtrace or not.
|
2009-03-27 12:33:11 +01:00
|
|
|
*
|
|
|
|
* @return bool Tru if the debug was actived. False if not.
|
2009-02-25 13:24:06 +01:00
|
|
|
*/
|
2009-03-12 10:20:49 +01:00
|
|
|
function debug ($var, $backtrace = true) {
|
2009-02-25 13:24:06 +01:00
|
|
|
global $config;
|
|
|
|
if (! isset ($config['debug']))
|
2009-03-27 12:33:11 +01:00
|
|
|
return false;
|
2009-02-25 13:24:06 +01:00
|
|
|
|
|
|
|
static $id = 0;
|
|
|
|
static $trace_id = 0;
|
|
|
|
|
|
|
|
$id++;
|
|
|
|
|
2009-03-12 10:20:49 +01:00
|
|
|
if ($backtrace) {
|
|
|
|
echo '<div class="debug">';
|
|
|
|
echo '<a href="#" onclick="$(\'#trace-'.$id.'\').toggle ();return false;">Backtrace</a>';
|
|
|
|
echo '<div id="trace-'.$id.'" class="backtrace invisible">';
|
2009-02-25 13:24:06 +01:00
|
|
|
echo '<ol>';
|
2009-03-12 10:20:49 +01:00
|
|
|
$traces = debug_backtrace ();
|
|
|
|
/* Ignore debug function */
|
|
|
|
unset ($traces[0]);
|
|
|
|
foreach ($traces as $trace) {
|
|
|
|
$trace_id++;
|
|
|
|
|
|
|
|
/* Many classes are used to allow better customization. Please, do not
|
|
|
|
remove them */
|
2009-02-25 13:24:06 +01:00
|
|
|
echo '<li>';
|
2009-03-12 10:20:49 +01:00
|
|
|
if (isset ($trace['class']))
|
|
|
|
echo '<span class="class">'.$trace['class'].'</span>';
|
|
|
|
if (isset ($trace['type']))
|
|
|
|
echo '<span class="type">'.$trace['type'].'</span>';
|
|
|
|
echo '<span class="function">';
|
|
|
|
echo '<a href="#" onclick="$(\'#args-'.$trace_id.'\').toggle ();return false;">'.$trace['function'].'()</a>';
|
|
|
|
echo '</span>';
|
|
|
|
if (isset ($trace['file'])) {
|
|
|
|
echo ' - <span class="filename">';
|
|
|
|
echo str_replace ($config['homedir'].'/', '', $trace['file']);
|
|
|
|
echo ':'.$trace['line'].'</span>';
|
|
|
|
} else {
|
|
|
|
echo ' - <span class="filename"><em>Unknown file</em></span>';
|
|
|
|
}
|
|
|
|
echo '<pre id="args-'.$trace_id.'" class="invisible">';
|
|
|
|
echo '<div class="parameters">Parameter values:</div>';
|
|
|
|
echo '<ol>';
|
|
|
|
foreach ($trace['args'] as $arg) {
|
|
|
|
echo '<li>';
|
|
|
|
print_r ($arg);
|
|
|
|
echo '</li>';
|
|
|
|
}
|
|
|
|
echo '</ol>';
|
|
|
|
echo '</pre>';
|
2009-02-25 16:15:14 +01:00
|
|
|
echo '</li>';
|
2009-02-25 13:24:06 +01:00
|
|
|
}
|
|
|
|
echo '</ol>';
|
2009-03-12 10:20:49 +01:00
|
|
|
echo '</div></div>';
|
2009-02-25 13:24:06 +01:00
|
|
|
}
|
2009-02-20 22:48:09 +01:00
|
|
|
|
2009-02-25 13:24:06 +01:00
|
|
|
/* Actually print the variable given */
|
|
|
|
echo '<pre class="debug">';
|
|
|
|
print_r ($var);
|
|
|
|
echo '</pre>';
|
2009-03-27 12:33:11 +01:00
|
|
|
return true;
|
2009-02-25 13:24:06 +01:00
|
|
|
}
|
2009-03-02 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php: Rewrote get_agentmodule_sla with
faster calculations (count in SQL).
* include/functions_ui.php: Added print_moduletype_icon that prints the
whole (correct) icon including rollover text
* include/functions_db.php: Updated some documenation and removed
deprecated functions that are now in the auth parts. Renamed
return_status_agent_module to get_agentmodule_status
* operation/agentes/sla_view.php: Made it use the 2.0 SQL and HTML
functions
* godmode/agentes/configurar_agente.php: Fixed tab links
* operation/events/events.php, include/functions_visual_map.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/ver_agente.php,
operation/reporting/custom_reporting.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php: Fixed renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1497 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-02 20:16:46 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints icon of a module type
|
|
|
|
*
|
|
|
|
* @param int Module Type ID
|
|
|
|
* @param bool Whether to return or print
|
|
|
|
*
|
|
|
|
* @return string An HTML string with the icon. Printed if return is false
|
|
|
|
*/
|
|
|
|
function print_moduletype_icon ($id_moduletype, $return = false) {
|
2009-03-24 Esteban Sanchez <estebans@artica.es>
* general/pandora_help.php: Added support for enterprise help files.
* include/javascript/pandora.js: Renamed pandora_help() to
open_help().
* include/functions_ui.php: Renamed event function on
print_help_icon(). Removed deprecated pandora_help().
* godmode/agentes/module_manager.php: Added enterprise hooks.
* godmode/agentes/module_manager_editor.php: Added categories
construction here. Added enterprise hooks.
* godmode/agentes/module_manager_editor_common.php: Replaced
deprecated pandora_help() with print_help_icon(). Moved categories
construction to module_manager_editor.
* include/config_process.php: Updated build version.
* include/styles/pandora.css: Fixed textarea height.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/massive_config.php,
godmode/agentes/massive_edit_modules.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/planned_downtime.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/reporting/map_builder.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask_form.php, godmode/servers/plugin.php,
godmode/setup/setup.php, operation/agentes/alerts_status.php,
operation/agentes/tactical.php,
godmode/agentes/agent_manager.php: Replaced deprecated pandora_help()
with print_help_icon().
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1557 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-24 16:38:54 +01:00
|
|
|
global $config;
|
|
|
|
|
2009-03-26 16:55:30 +01:00
|
|
|
$type = get_db_row ("ttipo_modulo", "id_tipo", (int) $id_moduletype, array ("descripcion", "icon"));
|
2009-03-02 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php: Rewrote get_agentmodule_sla with
faster calculations (count in SQL).
* include/functions_ui.php: Added print_moduletype_icon that prints the
whole (correct) icon including rollover text
* include/functions_db.php: Updated some documenation and removed
deprecated functions that are now in the auth parts. Renamed
return_status_agent_module to get_agentmodule_status
* operation/agentes/sla_view.php: Made it use the 2.0 SQL and HTML
functions
* godmode/agentes/configurar_agente.php: Fixed tab links
* operation/events/events.php, include/functions_visual_map.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/ver_agente.php,
operation/reporting/custom_reporting.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php: Fixed renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1497 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-02 20:16:46 +01:00
|
|
|
if ($type === false) {
|
|
|
|
$type = array ();
|
2009-06-24 Jorge Gonzalez <jorgegonz@artica.es>
* include/functions_reporting.php, include/functions_ui.php,
* operation/incidents/incident.php,
* operation/snmpconsole/snmp_view.php, operation/events/events.php,
* operation/agentes/tactical.php, godmode/users/user_list.php,
* godmode/users/configure_user.php,
* godmode/profiles/profile_list.php,
* godmode/agentes/module_manager_editor_wmi.php,
* godmode/agentes/massive_edit_modules.php,
* godmode/agentes/manage_config_remote.php,
* godmode/modules/manage_network_components_form_network.php,
* godmode/modules/manage_network_components_form_wmi.php,
* godmode/servers/manage_export.php,
* godmode/servers/manage_recontask.php,
* godmode/servers/modificar_server.php: Some translatable strings
* reused to simplify i18n work.
* include/languages/es.po, include/languages/es.mo: Updated Spanish
* translation.
* include/languages/index.pot: Updated po template.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1763 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-06-24 15:36:29 +02:00
|
|
|
$type["descripcion"] = __('Unknown type');
|
2009-03-02 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php: Rewrote get_agentmodule_sla with
faster calculations (count in SQL).
* include/functions_ui.php: Added print_moduletype_icon that prints the
whole (correct) icon including rollover text
* include/functions_db.php: Updated some documenation and removed
deprecated functions that are now in the auth parts. Renamed
return_status_agent_module to get_agentmodule_status
* operation/agentes/sla_view.php: Made it use the 2.0 SQL and HTML
functions
* godmode/agentes/configurar_agente.php: Fixed tab links
* operation/events/events.php, include/functions_visual_map.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/ver_agente.php,
operation/reporting/custom_reporting.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php: Fixed renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1497 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-02 20:16:46 +01:00
|
|
|
$type["icon"] = 'b_down.png';
|
|
|
|
}
|
2009-03-24 Esteban Sanchez <estebans@artica.es>
* general/pandora_help.php: Added support for enterprise help files.
* include/javascript/pandora.js: Renamed pandora_help() to
open_help().
* include/functions_ui.php: Renamed event function on
print_help_icon(). Removed deprecated pandora_help().
* godmode/agentes/module_manager.php: Added enterprise hooks.
* godmode/agentes/module_manager_editor.php: Added categories
construction here. Added enterprise hooks.
* godmode/agentes/module_manager_editor_common.php: Replaced
deprecated pandora_help() with print_help_icon(). Moved categories
construction to module_manager_editor.
* include/config_process.php: Updated build version.
* include/styles/pandora.css: Fixed textarea height.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/massive_config.php,
godmode/agentes/massive_edit_modules.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/planned_downtime.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/reporting/map_builder.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask_form.php, godmode/servers/plugin.php,
godmode/setup/setup.php, operation/agentes/alerts_status.php,
operation/agentes/tactical.php,
godmode/agentes/agent_manager.php: Replaced deprecated pandora_help()
with print_help_icon().
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1557 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-24 16:38:54 +01:00
|
|
|
$imagepath = 'images/'.$type["icon"];
|
|
|
|
if (! file_exists ($config['homedir'].'/'.$imagepath))
|
|
|
|
$imagepath = ENTERPRISE_DIR.'/'.$imagepath;
|
|
|
|
|
2009-03-26 16:55:30 +01:00
|
|
|
return print_image ($imagepath, $return,
|
|
|
|
array ("border" => 0,
|
|
|
|
"title" => $type["descripcion"]));
|
2009-03-02 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php: Rewrote get_agentmodule_sla with
faster calculations (count in SQL).
* include/functions_ui.php: Added print_moduletype_icon that prints the
whole (correct) icon including rollover text
* include/functions_db.php: Updated some documenation and removed
deprecated functions that are now in the auth parts. Renamed
return_status_agent_module to get_agentmodule_status
* operation/agentes/sla_view.php: Made it use the 2.0 SQL and HTML
functions
* godmode/agentes/configurar_agente.php: Fixed tab links
* operation/events/events.php, include/functions_visual_map.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/ver_agente.php,
operation/reporting/custom_reporting.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php: Fixed renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1497 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-02 20:16:46 +01:00
|
|
|
}
|
2009-03-04 16:59:00 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Format a file size from bytes to a human readable meassure.
|
|
|
|
*
|
|
|
|
* @param int File size in bytes
|
|
|
|
* @return string Bytes converted to a human readable meassure.
|
|
|
|
*/
|
|
|
|
function format_filesize ($bytes) {
|
|
|
|
$bytes = (int) $bytes;
|
|
|
|
$strs = array ('B', 'kB', 'MB', 'GB', 'TB');
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
if ($bytes <= 0) {
|
2009-03-04 16:59:00 +01:00
|
|
|
return "0 ".$strs[0];
|
|
|
|
}
|
|
|
|
$con = 1024;
|
|
|
|
$log = (int) (log ($bytes, $con));
|
|
|
|
|
|
|
|
return format_numeric ($bytes / pow ($con, $log), 1).' '.$strs[$log];
|
|
|
|
}
|
2009-04-06 13:02:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current path to the selected image set to show the
|
|
|
|
* status of agents and alerts.
|
|
|
|
*
|
|
|
|
* @return array An array with the image path, image width and image height.
|
|
|
|
*/
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
function get_status_images_path () {
|
2009-04-06 13:02:05 +02:00
|
|
|
global $config;
|
|
|
|
|
|
|
|
$imageset = $config["status_images_set"];
|
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
if (strpos ($imageset, ",") === false)
|
|
|
|
$imageset .= ",40x18";
|
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.php
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php,
godmode/alerts/alert_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-03-02 15:13:00 +01:00
|
|
|
list ($imageset, $sizes) = preg_split ("/\,/", $imageset);
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
if (strpos ($sizes, "x") === false)
|
|
|
|
$sizes .= "x18";
|
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.php
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php,
godmode/alerts/alert_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-03-02 15:13:00 +01:00
|
|
|
list ($imagewidth, $imageheight) = preg_split ("/x/", $sizes);
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
$imagespath = 'images/status_sets/'.$imageset;
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
return array ($imagespath);
|
2009-04-06 13:02:05 +02:00
|
|
|
}
|
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
define ('STATUS_MODULE_OK', 'module_ok.png');
|
|
|
|
define ('STATUS_MODULE_CRITICAL', 'module_critical.png');
|
|
|
|
define ('STATUS_MODULE_WARNING', 'module_warning.png');
|
2010-08-04 13:08:16 +02:00
|
|
|
define ('STATUS_MODULE_NO_DATA', 'module_no_data.png');
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
define ('STATUS_AGENT_CRITICAL', 'agent_critical.png');
|
|
|
|
define ('STATUS_AGENT_WARNING', 'agent_warning.png');
|
|
|
|
define ('STATUS_AGENT_DOWN', 'agent_down.png');
|
|
|
|
define ('STATUS_AGENT_OK', 'agent_ok.png');
|
|
|
|
define ('STATUS_AGENT_NO_DATA', 'agent_no_data.png');
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
define ('STATUS_ALERT_FIRED', 'alert_fired.png');
|
|
|
|
define ('STATUS_ALERT_NOT_FIRED', 'alert_not_fired.png');
|
|
|
|
define ('STATUS_ALERT_DISABLED', 'alert_disabled.png');
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
define ('STATUS_SERVER_OK', 'server_ok.png');
|
|
|
|
define ('STATUS_SERVER_DOWN', 'server_down.png');
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-20 16:00:27 +02:00
|
|
|
/**
|
|
|
|
* Prints an image representing a status.
|
|
|
|
*
|
|
|
|
* @param string
|
|
|
|
* @param string
|
|
|
|
* @param bool Whether to return an output string or echo now (optional, echo by default).
|
|
|
|
*
|
|
|
|
* @return string HTML code if return parameter is true.
|
|
|
|
*/
|
2010-08-12 17:26:11 +02:00
|
|
|
function print_status_image ($type, $title = "", $return = false, $options = false) {
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
list ($imagepath) = get_status_images_path ();
|
|
|
|
|
2009-04-20 16:00:27 +02:00
|
|
|
$imagepath .= "/".$type;
|
2009-04-13 Esteban Sanchez <estebans@artica.es>
* general/footer.php: Removed Firefox icon. Style correction.
* godmode/agentes/agent_manager.php: Replaced > with ». Style
correction when setting bold attributes.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php,
godmode/alerts/alert_list.php, godmode/db/db_audit.php,
godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php,
godmode/db/db_purge.php, godmode/db/db_refine.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/module_list.php, godmode/profiles/profile_list.php,
godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask.php,
godmode/servers/manage_recontask_form.php,
godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php,
godmode/setup/links.php, godmode/setup/news.php,
godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php,
godmode/users/user_list.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/agentes/status_monitor.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php,
operation/messages/message.php, operation/reporting/custom_reporting.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php, operation/servers/view_server.php,
operation/users/user.php, operation/users/user_edit.php,
operation/users/user_statistics.php, operation/visual_console/index.php,
godmode/agentes/agent_template.php: Replaced > with »
* operation/agentes/datos_agente.php: Return instead of exit
* include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS
control to preview the OS icon on a select.
* include/functions_reports.php: Fixed a bug on delete_report() that
returns error when the report has no content.
* include/functions_ui.php: Removed border attribute on print_os_icon().
Some fixes to meta refresh element on process_page_head(). Fixed
format_filesize() when length is zero.
* godmode/menu.php: Replaced link to file manager. Added enterprise hook.
* godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php
* include/styles/pandora.css: Textarea width reduced to 99%
* godmode/setup/setup.php: Added get_os_icon AJAX operation.
* images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png,
images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to
repository. Mime type icons.
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments.
* include/functions_filemanager.php: Added to repository. Minimal API for
file manager system.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
|
|
|
|
2010-08-12 17:26:11 +02:00
|
|
|
if($options === false) {
|
|
|
|
$options = array();
|
|
|
|
}
|
|
|
|
|
|
|
|
$options['title'] = $title;
|
|
|
|
|
|
|
|
return print_image ($imagepath, $return, $options);
|
2009-04-06 13:02:05 +02:00
|
|
|
}
|
|
|
|
|
2009-04-20 16:00:27 +02:00
|
|
|
/**
|
|
|
|
* Prints a form to search agents.
|
|
|
|
*
|
|
|
|
* @param array Extra options for the function. To be documented.
|
|
|
|
* @param array Extra and hidden filter for the agent search.
|
|
|
|
*/
|
|
|
|
function print_ui_agents_list ($options = false, $filter = false, $return = false) {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$output = '';
|
|
|
|
|
|
|
|
$group_filter = true;
|
|
|
|
$text_filter = true;
|
|
|
|
$access = 'AR';
|
|
|
|
$table_heads = array (__('Name'), __('Group'), __('Status'));
|
|
|
|
$table_renders = array ('view_link', 'group', 'status');
|
|
|
|
$table_align = array ('', '', 'center');
|
|
|
|
$table_size = array ('50%', '45%', '5%');
|
|
|
|
$fields = false;
|
|
|
|
$show_filter_form = true;
|
|
|
|
if (is_array ($options)) {
|
|
|
|
if (isset ($options['group_filter']))
|
|
|
|
$group_filter = (bool) $options['group_filter'];
|
|
|
|
if (isset ($options['text_filter']))
|
|
|
|
$text_filter = (bool) $options['text_filter'];
|
|
|
|
if (isset ($options['access']))
|
|
|
|
$access = (string) $options['access'];
|
|
|
|
if (isset ($options['table_heads']))
|
|
|
|
$table_heads = (array) $options['table_heads'];
|
|
|
|
if (isset ($options['table_renders']))
|
|
|
|
$table_renders = (array) $options['table_renders'];
|
|
|
|
if (isset ($options['table_align']))
|
|
|
|
$table_align = (array) $options['table_align'];
|
|
|
|
if (isset ($options['table_size']))
|
|
|
|
$table_size = (array) $options['table_size'];
|
|
|
|
if (isset ($options['fields']))
|
|
|
|
$fields = (array) $options['fields'];
|
|
|
|
if (isset ($options['show_filter_form']))
|
|
|
|
$show_filter_form = (bool) $options['show_filter_form'];
|
|
|
|
|
|
|
|
if (count ($table_renders) != count ($table_heads))
|
|
|
|
trigger_error ('Different count for table_renders and table_heads options');
|
|
|
|
|
|
|
|
unset ($options);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($return)
|
|
|
|
return get_include_contents ($config['homedir'].'/general/ui/agents_list.php',
|
|
|
|
get_defined_vars ());
|
|
|
|
|
|
|
|
include ($config['homedir'].'/general/ui/agents_list.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the content of a PHP file instead of dumping to the output.
|
|
|
|
*
|
|
|
|
* Picked from PHP official doc.
|
|
|
|
*
|
|
|
|
* @param string File name to include and get content.
|
|
|
|
* @param array Extra parameters in an indexed array to be passed to the file.
|
|
|
|
*
|
|
|
|
* @return string Content of the file after being processed. False if the file
|
|
|
|
* could not be included.
|
|
|
|
*/
|
|
|
|
function get_include_contents ($filename, $params = false) {
|
2010-08-18 13:35:42 +02:00
|
|
|
global $config;
|
|
|
|
|
2009-04-20 16:00:27 +02:00
|
|
|
ob_start ();
|
|
|
|
|
|
|
|
if (is_array ($params)) {
|
|
|
|
extract ($params);
|
|
|
|
}
|
|
|
|
|
2010-08-18 13:35:42 +02:00
|
|
|
$filename = realpath ($filename);
|
|
|
|
if (strncmp ($config["homedir"], $filename, strlen ($config["homedir"])) != 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-04-20 16:00:27 +02:00
|
|
|
$result = include ($filename);
|
|
|
|
if ($result === false) {
|
|
|
|
ob_end_clean ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$contents = ob_get_contents ();
|
|
|
|
ob_end_clean ();
|
|
|
|
|
|
|
|
return $contents;
|
|
|
|
}
|
2010-08-23 18:35:25 +02:00
|
|
|
/**
|
|
|
|
* Print a code into a DIV and enable a toggle to show and hide it
|
|
|
|
*
|
|
|
|
* @param string html code
|
|
|
|
* @param string name of the link
|
|
|
|
* @param string title of the link
|
|
|
|
* @param bool if the div will be hidden by default (default: true)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
function toggle($code, $name, $title = '', $hidde_default = true) {
|
|
|
|
// Generate unique Id
|
|
|
|
$uniqid = uniqid('');
|
|
|
|
|
|
|
|
// Options
|
|
|
|
if($hidde_default) {
|
|
|
|
$style = 'display:none';
|
|
|
|
$toggle_a = "$('#tgl_div_".$uniqid."').show();";
|
|
|
|
$toggle_b = "$('#tgl_div_".$uniqid."').hide();";
|
|
|
|
$image_a = "images/go.png";
|
|
|
|
$image_b = "images/down.png";
|
|
|
|
}else {
|
|
|
|
$style = '';
|
|
|
|
$toggle_a = "$('#tgl_div_".$uniqid."').hide();";
|
|
|
|
$toggle_b = "$('#tgl_div_".$uniqid."').show();";
|
|
|
|
$image_a = "images/down.png";
|
|
|
|
$image_b = "images/go.png";
|
|
|
|
}
|
|
|
|
// Link to toggle
|
|
|
|
echo '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b> '.print_image ($image_b, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a><br><br>';
|
|
|
|
|
|
|
|
// Code into a div
|
2010-08-23 18:43:32 +02:00
|
|
|
echo "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
|
2010-08-23 18:35:25 +02:00
|
|
|
echo $code;
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
// JQuery Toggle
|
|
|
|
|
|
|
|
echo '<script type="text/javascript">';
|
|
|
|
echo '/* <![CDATA[ */';
|
|
|
|
echo "$(document).ready (function () {";
|
|
|
|
echo "$('#tgl_ctrl_".$uniqid."').toggle(function() {";
|
|
|
|
echo $toggle_a;
|
|
|
|
echo "$('#image_".$uniqid."').attr({src: '".$image_a."'});";
|
|
|
|
echo "}, function() {";
|
|
|
|
echo $toggle_b;
|
|
|
|
echo "$('#image_".$uniqid."').attr({src: '".$image_b."'});";
|
|
|
|
echo "});";
|
|
|
|
echo "});";
|
|
|
|
echo '/* ]]> */';
|
|
|
|
echo '</script>';
|
|
|
|
}
|
2009-04-21 21:03:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct and return the URL to be used in order to refresh the current page correctly.
|
|
|
|
*
|
2009-05-07 16:44:26 +02:00
|
|
|
* @param array Extra parameters to be added to the URL. It has prevalence over
|
|
|
|
* GET and POST. False values will be ignored.
|
|
|
|
* @param bool Whether to return the relative URL or the absolute URL. Returns
|
|
|
|
* relative by default
|
|
|
|
* @param bool Whether to add POST values to the URL.
|
2009-04-21 21:03:16 +02:00
|
|
|
*/
|
2009-05-07 16:44:26 +02:00
|
|
|
function get_url_refresh ($params = false, $relative = true, $add_post = true) {
|
2009-04-21 21:03:16 +02:00
|
|
|
// Agent selection filters and refresh
|
|
|
|
global $config;
|
|
|
|
$url = '';
|
|
|
|
|
2009-05-07 16:44:26 +02:00
|
|
|
if (sizeof ($_REQUEST)) {
|
2009-04-21 21:03:16 +02:00
|
|
|
//Some (old) browsers don't like the ?&key=var
|
2009-05-07 16:44:26 +02:00
|
|
|
$url .= '?';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! is_array ($params))
|
|
|
|
$params = array ();
|
2009-05-22 11:08:55 +02:00
|
|
|
/* Avoid showing login info */
|
|
|
|
$params['pass'] = false;
|
|
|
|
$params['nick'] = false;
|
|
|
|
$params['unnamed'] = false;
|
2009-04-21 21:03:16 +02:00
|
|
|
|
|
|
|
//We don't clean these variables up as they're only being passed along
|
|
|
|
foreach ($_GET as $key => $value) {
|
2009-05-07 16:44:26 +02:00
|
|
|
if (isset ($params[$key]))
|
2009-04-21 21:03:16 +02:00
|
|
|
continue;
|
2009-05-27 13:04:11 +02:00
|
|
|
if (strstr ($key, 'create'))
|
|
|
|
continue;
|
|
|
|
if (strstr ($key, 'update'))
|
|
|
|
continue;
|
|
|
|
if (strstr ($key, 'new'))
|
|
|
|
continue;
|
|
|
|
if (strstr ($key, 'delete'))
|
|
|
|
continue;
|
2009-10-08 16:25:37 +02:00
|
|
|
$url .= $key.'='.$value.'&';
|
2009-04-21 21:03:16 +02:00
|
|
|
}
|
|
|
|
|
2009-05-07 16:44:26 +02:00
|
|
|
if ($add_post) {
|
|
|
|
foreach ($_POST as $key => $value) {
|
|
|
|
if (isset ($params[$key]))
|
|
|
|
continue;
|
2009-05-27 13:04:11 +02:00
|
|
|
if (strstr ($key, 'create'))
|
|
|
|
continue;
|
|
|
|
if (strstr ($key, 'update'))
|
|
|
|
continue;
|
|
|
|
if (strstr ($key, 'new'))
|
|
|
|
continue;
|
|
|
|
if (strstr ($key, 'delete'))
|
|
|
|
continue;
|
2009-10-08 16:25:37 +02:00
|
|
|
$url .= $key.'='.$value.'&';
|
2009-04-21 21:03:16 +02:00
|
|
|
}
|
2009-05-07 16:44:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($params as $key => $value) {
|
|
|
|
if ($value === false)
|
|
|
|
continue;
|
2009-10-08 16:25:37 +02:00
|
|
|
$url .= $key.'='.$value.'&';
|
2009-05-07 16:44:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Removes final & */
|
2009-10-08 16:25:37 +02:00
|
|
|
$pos = strrpos ($url, '&', 0);
|
2009-05-07 16:44:26 +02:00
|
|
|
if ($pos) {
|
|
|
|
$url = substr_replace ($url, '', $pos, 5);
|
|
|
|
}
|
|
|
|
|
2009-10-08 16:25:37 +02:00
|
|
|
$url = htmlspecialchars ($url);
|
2009-05-07 16:44:26 +02:00
|
|
|
if (! $relative) {
|
|
|
|
return get_full_url ($url);
|
2009-04-21 21:03:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return $url;
|
|
|
|
}
|
2009-05-07 16:44:26 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a full URL in Pandora.
|
|
|
|
*
|
|
|
|
* An example of full URL is http:/localhost/pandora_console/index.php?sec=gsetup&sec2=godmode/setup/setup
|
|
|
|
*
|
|
|
|
* @param string If provided, it will be added after the index.php
|
|
|
|
*
|
|
|
|
* @return string A full URL in Pandora.
|
|
|
|
*/
|
|
|
|
function get_full_url ($url = false) {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$was_empty = false;
|
|
|
|
if (empty ($url)) {
|
|
|
|
$was_empty = true;
|
|
|
|
$url = $_SERVER['REQUEST_URI'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($config['https']) {
|
|
|
|
//When $config["https"] is set, always force https
|
|
|
|
$protocol = 'https';
|
|
|
|
$ssl = true;
|
|
|
|
} elseif (isset ($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === true || $_SERVER['HTTPS'] == 'on')) {
|
|
|
|
$protocol = 'https';
|
|
|
|
$ssl = true;
|
|
|
|
} else {
|
|
|
|
$protocol = 'http';
|
|
|
|
$ssl = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$fullurl = $protocol.'://' . $_SERVER['SERVER_NAME'];
|
|
|
|
|
|
|
|
if ((!$ssl && $_SERVER['SERVER_PORT'] != 80) || ($ssl && $_SERVER['SERVER_PORT'] != 443)) {
|
|
|
|
$fullurl .= ":".$_SERVER['SERVER_PORT'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! $was_empty) {
|
|
|
|
$fullurl .= $_SERVER['SCRIPT_NAME'];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $fullurl.$url;
|
|
|
|
}
|
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a standard page header (Pandora FMS 3.1 version)
|
|
|
|
*
|
|
|
|
* @param string Title
|
|
|
|
* @param string Icon path
|
|
|
|
* @param boolean Return (false will print using a echo)
|
|
|
|
* @param boolean help (Help ID to print the Help link)
|
|
|
|
* @param boolean Godmode (false = operation mode).
|
|
|
|
* @param string Options (HTML code for make tabs or just a brief info string
|
|
|
|
* @return string Header HTML
|
|
|
|
*/
|
|
|
|
|
|
|
|
function print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = ""){
|
2010-10-14 14:27:09 +02:00
|
|
|
$title = safe_input_html($title);
|
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
|
|
|
if (($icon == "") && ($godmode == true)){
|
|
|
|
$icon = "images/setup.png";
|
|
|
|
}
|
|
|
|
|
2010-03-02 20:25:51 +01:00
|
|
|
if (($icon == "") && ($godmode == false)){
|
|
|
|
$icon = "images/comments.png";
|
|
|
|
}
|
|
|
|
|
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
|
|
|
if ($godmode == true){
|
|
|
|
$type = "nomn";
|
2010-07-26 13:08:59 +02:00
|
|
|
$type2 = "menu_tab_frame";
|
|
|
|
$separator_class = "separator";
|
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$type = "view";
|
|
|
|
$type2 = "menu_tab_frame_view";
|
2010-07-26 13:08:59 +02:00
|
|
|
$separator_class = "separator_view";
|
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$buffer = '<div id="'.$type2.'" style=""><div id="menu_tab_left">';
|
|
|
|
|
|
|
|
|
|
|
|
$buffer .= '<ul class="mn"><li class="'.$type.'"> <img src="'.$icon.'" style="margin-bottom: -3px;" class="bottom" border="0"> ';
|
|
|
|
$buffer .= $title;
|
|
|
|
if ($help != "")
|
|
|
|
$buffer .= " " . print_help_icon ($help, true);
|
|
|
|
$buffer .= '</ul></div>';
|
|
|
|
|
2010-02-23 17:36:24 +01:00
|
|
|
if (is_array($options)) {
|
|
|
|
$buffer .= '<div id="menu_tab"><ul class="mn">';
|
2010-07-26 13:08:59 +02:00
|
|
|
foreach ($options as $key => $option) {
|
|
|
|
if ($key == 'separator') {
|
|
|
|
$buffer .= '<li class='.$separator_class.'>';
|
2010-03-17 20:07:49 +01:00
|
|
|
$buffer .= '</li>';
|
2010-07-26 13:08:59 +02:00
|
|
|
} else {
|
|
|
|
if (is_array($option)) {
|
|
|
|
$class = 'nomn';
|
|
|
|
if ($option['active']) {
|
|
|
|
$class = 'nomn_high';
|
|
|
|
}
|
|
|
|
|
|
|
|
$buffer .= '<li class="' . $class . '">';
|
|
|
|
$buffer .= $option['text'];
|
|
|
|
$buffer .= '</li>';
|
|
|
|
} else {
|
|
|
|
$buffer .= '<li class="nomn">';
|
|
|
|
$buffer .= $option;
|
|
|
|
$buffer .= '</li>';
|
|
|
|
}
|
2010-03-17 20:07:49 +01:00
|
|
|
}
|
2010-02-23 17:36:24 +01:00
|
|
|
}
|
|
|
|
$buffer .= '</ul></div>';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($options != ""){
|
|
|
|
$buffer .= '<div id="menu_tab"><ul class="mn"><li class="nomn">';
|
|
|
|
$buffer .= $options;
|
|
|
|
$buffer .= '</li></ul></div>';
|
|
|
|
}
|
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$buffer .= '</div><br><br><br>';
|
|
|
|
|
|
|
|
if (!$return)
|
|
|
|
echo $buffer;
|
|
|
|
|
|
|
|
return $buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-07 11:42:38 +01:00
|
|
|
?>
|