2009-07-22 17:26:31 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
require ("include/config.php");
|
2009-07-29 19:19:27 +02:00
|
|
|
require_once ("include/functions_reporting.php");
|
|
|
|
|
|
|
|
// Load enterprise extensions
|
|
|
|
enterprise_include ('operation/reporting/custom_reporting.php');
|
2009-07-22 17:26:31 +02:00
|
|
|
|
|
|
|
$searchGraphs = $searchAgents = (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, "AR"));
|
|
|
|
$linkEditUser = check_acl ($config['id_user'], 0, "UM");
|
|
|
|
$searchMaps = give_acl ($config["id_user"], 0, "AR");
|
|
|
|
|
|
|
|
$arrayKeywords = explode(' ', $config['search_keywords']);
|
|
|
|
$temp = array();
|
|
|
|
foreach($arrayKeywords as $keyword)
|
|
|
|
array_push($temp, "%" . $keyword . "%");
|
|
|
|
$stringSearchSQL = implode(" ",$temp);
|
|
|
|
|
|
|
|
if ($config['search_category'] == "all") $searchTab = "agents";
|
|
|
|
else $searchTab = $config['search_category'];
|
|
|
|
|
|
|
|
//INI SECURITY ACL
|
|
|
|
if ((!$searchAgents) && ($searchTab == 'agents')) $searchTab = "users";
|
|
|
|
|
|
|
|
if ((!$searchGraphs) && ($searchTab == 'graphs')) $searchTab = "users";
|
|
|
|
if ((!$searchMaps) && ($searchTab == 'maps')) $searchTab = "users";
|
|
|
|
//END SECURITY ACL
|
|
|
|
|
|
|
|
$agents = false;
|
|
|
|
if ($searchTab == 'agents') {
|
|
|
|
if ($searchAgents) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$sql = "SELECT id_agente, tagente.nombre, tagente.id_os, tagente.intervalo, tagente.id_grupo
|
2009-07-22 17:26:31 +02:00
|
|
|
FROM tagente
|
|
|
|
INNER JOIN tgrupo
|
|
|
|
ON tgrupo.id_grupo = tagente.id_grupo
|
2009-10-13 Sancho Lerena <slerena@artica.es>
Upps, Tuesday #13, bad day for a last commit before launch RC1 ! :-S
* general/logon_ok.php: Fixed ugly format of table showing last activity
(has a too wide table width).
* godmode/admin_access_logs.php: Removed that crappy div fashion code and
replaced by old and reliable table-based-code :-) to fix the mess with the
pagination.
* godmode/agentes/configurar_agente.php: fixed problem with postprocess
values very bug (like 0.0000000123), parameter is now passed as string
because PHP is passing the value as scientific notation and mYsql don't
understand that.
* operation/agentes/exportdata.php,
* operation/search_results.php,
* godmode/reporting/map_builder.php,
* godmode/agentes/agent_manager.php,
* godmode/reporting/graph_builder.php,
* godmode/agentes/modificar_agente.php: Added non-case search SQL code for make
agent searches non case sensitive (nombre COLLATE utf8_general_ci LIKE...)
* module_manager_editor_common.php: More size for postprocess field.
* pandora_console/godmode/alerts/configure_alert_action.php: More width for
field2 in action form.
* godmode/alerts/configure_alert_command.php: Command field has more width
and added a help icon for macro subtitutions.
* include/functions_db.php: get_agent_name() now defaults to non uppercase
the agent names, because 3.0 has case sensitive agent names, and all
data must show the real Case.
* include/styles/pandora.css: removed uppercase transition for menu items
and agent tabs.
* operation/agentes/estado_agente.php: Agent is not shown in uppercase
anymore.
* operation/agentes/estado_generalagente.php: Agent name and parent name
is not in uppercase. OS version shows only last 15 characters or full string
if strlen() < 15.
* operation/agentes/status_monitor.php: Agent name is not in uppercase
anymore.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2015 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-13 20:59:48 +02:00
|
|
|
WHERE tagente.nombre COLLATE utf8_general_ci LIKE '%" . $stringSearchSQL . "%' OR
|
2009-07-29 19:19:27 +02:00
|
|
|
tgrupo.nombre LIKE '%" . $stringSearchSQL . "%'
|
|
|
|
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
2009-07-22 17:26:31 +02:00
|
|
|
$agents = process_sql($sql);
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$sql = "SELECT count(id_agente)
|
|
|
|
FROM tagente
|
|
|
|
INNER JOIN tgrupo
|
|
|
|
ON tgrupo.id_grupo = tagente.id_grupo
|
2009-10-13 Sancho Lerena <slerena@artica.es>
Upps, Tuesday #13, bad day for a last commit before launch RC1 ! :-S
* general/logon_ok.php: Fixed ugly format of table showing last activity
(has a too wide table width).
* godmode/admin_access_logs.php: Removed that crappy div fashion code and
replaced by old and reliable table-based-code :-) to fix the mess with the
pagination.
* godmode/agentes/configurar_agente.php: fixed problem with postprocess
values very bug (like 0.0000000123), parameter is now passed as string
because PHP is passing the value as scientific notation and mYsql don't
understand that.
* operation/agentes/exportdata.php,
* operation/search_results.php,
* godmode/reporting/map_builder.php,
* godmode/agentes/agent_manager.php,
* godmode/reporting/graph_builder.php,
* godmode/agentes/modificar_agente.php: Added non-case search SQL code for make
agent searches non case sensitive (nombre COLLATE utf8_general_ci LIKE...)
* module_manager_editor_common.php: More size for postprocess field.
* pandora_console/godmode/alerts/configure_alert_action.php: More width for
field2 in action form.
* godmode/alerts/configure_alert_command.php: Command field has more width
and added a help icon for macro subtitutions.
* include/functions_db.php: get_agent_name() now defaults to non uppercase
the agent names, because 3.0 has case sensitive agent names, and all
data must show the real Case.
* include/styles/pandora.css: removed uppercase transition for menu items
and agent tabs.
* operation/agentes/estado_agente.php: Agent is not shown in uppercase
anymore.
* operation/agentes/estado_generalagente.php: Agent name and parent name
is not in uppercase. OS version shows only last 15 characters or full string
if strlen() < 15.
* operation/agentes/status_monitor.php: Agent name is not in uppercase
anymore.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2015 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-13 20:59:48 +02:00
|
|
|
WHERE tagente.nombre COLLATE utf8_general_ci LIKE '%" . $stringSearchSQL . "%' OR
|
2009-07-29 19:19:27 +02:00
|
|
|
tgrupo.nombre LIKE '%" . $stringSearchSQL . "%'";
|
|
|
|
$totalAgents = get_db_row_sql($sql);
|
|
|
|
$totalAgents = $totalAgents[0];
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$users = false;
|
|
|
|
if ($searchTab == 'users') {
|
2009-07-29 19:19:27 +02:00
|
|
|
$sql = "SELECT id_user, fullname, firstname, lastname, middlename, email, last_connect, is_admin, comments FROM tusuario
|
2009-07-22 17:26:31 +02:00
|
|
|
WHERE fullname LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
firstname LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
lastname LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
middlename LIKE '%" . $stringSearchSQL . "%' OR
|
2009-07-29 19:19:27 +02:00
|
|
|
email LIKE '%" . $stringSearchSQL . "%'
|
|
|
|
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
2009-07-22 17:26:31 +02:00
|
|
|
$users = process_sql($sql);
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$sql = "SELECT COUNT(id_user) FROM tusuario
|
|
|
|
WHERE fullname LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
firstname LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
lastname LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
middlename LIKE '%" . $stringSearchSQL . "%' OR
|
|
|
|
email LIKE '%" . $stringSearchSQL . "%'";
|
|
|
|
$totalUsers = get_db_row_sql($sql);
|
|
|
|
$totalUsers = $totalUsers[0];
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$alerts = false;
|
2009-07-29 19:19:27 +02:00
|
|
|
if ($searchTab == 'alerts') {
|
|
|
|
$sql = "SELECT t1.disabled, t3.id_agente, t3.nombre AS agent_name, t2.nombre AS module_name, t4.name AS template_name,
|
|
|
|
(SELECT GROUP_CONCAT(t6.name)
|
|
|
|
FROM talert_template_module_actions AS t5
|
|
|
|
INNER JOIN talert_actions AS t6 ON t6.id = t5.id_alert_action
|
|
|
|
WHERE t5.id_alert_template_module = t1.id) AS actions
|
|
|
|
FROM talert_template_modules AS t1
|
|
|
|
INNER JOIN tagente_modulo AS t2
|
|
|
|
ON t1.id_agent_module = t2.id_agente_modulo
|
|
|
|
INNER JOIN tagente AS t3
|
|
|
|
ON t2.id_agente = t3.id_agente
|
|
|
|
INNER JOIN talert_templates AS t4
|
|
|
|
ON t1.id_alert_template = t4.id
|
|
|
|
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
2009-07-22 17:26:31 +02:00
|
|
|
$alerts = process_sql($sql);
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$sql = "SELECT COUNT(t1.id)
|
|
|
|
FROM talert_template_modules AS t1
|
|
|
|
INNER JOIN tagente_modulo AS t2
|
|
|
|
ON t1.id_agent_module = t2.id_agente_modulo
|
|
|
|
INNER JOIN tagente AS t3
|
|
|
|
ON t2.id_agente = t3.id_agente
|
|
|
|
INNER JOIN talert_templates AS t4
|
|
|
|
ON t1.id_alert_template = t4.id";
|
|
|
|
$totalAlerts = get_db_row_sql($sql);
|
|
|
|
$totalAlerts = $totalAlerts[0];
|
|
|
|
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$graphs = false;
|
|
|
|
if ($searchTab == 'graphs') {
|
|
|
|
if ($searchGraphs) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$sql = "SELECT id_graph, name, description FROM tgraph WHERE name LIKE '%" . $stringSearchSQL . "%' OR description LIKE '%" . $stringSearchSQL . "%'
|
|
|
|
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
2009-07-22 17:26:31 +02:00
|
|
|
$graphs = process_sql($sql);
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$sql = "SELECT COUNT(id_graph) FROM tgraph WHERE name LIKE '%" . $stringSearchSQL . "%' OR description LIKE '%" . $stringSearchSQL . "%'";
|
|
|
|
$totalGraphs = get_db_row_sql($sql);
|
|
|
|
$totalGraphs = $totalGraphs[0];
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$reports = false;
|
|
|
|
if (($config['search_category'] == 'all') || ($config['search_category'] == 'reports')) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$sql = "SELECT id_report, name, description FROM treport WHERE name LIKE '%" . $stringSearchSQL . "%'
|
|
|
|
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
2009-07-22 17:26:31 +02:00
|
|
|
$reports = process_sql($sql);
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$sql = "SELECT COUNT(id_report) FROM treport WHERE name LIKE '%" . $stringSearchSQL . "%'";
|
|
|
|
$totalReports = get_db_row_sql($sql);
|
|
|
|
$totalReports = $totalReports[0];
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$maps = false;
|
|
|
|
if (($config['search_category'] == 'all') || ($config['search_category'] == 'maps')) {
|
|
|
|
if ($searchMaps) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$sql = "SELECT t1.id, t1.name, t1.id_group,
|
|
|
|
(SELECT COUNT(*) FROM tlayout_data AS t2 WHERE t2.id_layout = t1.id) AS count
|
|
|
|
FROM tlayout AS t1 WHERE t1.name LIKE '%" . $stringSearchSQL . "%'
|
|
|
|
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
2009-07-22 17:26:31 +02:00
|
|
|
$maps = process_sql($sql);
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$sql = "SELECT COUNT(id) FROM tlayout WHERE name LIKE '%" . $stringSearchSQL . "%'";
|
|
|
|
$totalMaps = get_db_row_sql($sql);
|
|
|
|
$totalMaps = $totalMaps[0];
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-29 19:19:27 +02:00
|
|
|
///////// INI MENU AND TABS /////////////
|
|
|
|
|
2009-08-06 20:55:54 +02:00
|
|
|
$img_style = array ("class" => "top", "width" => 16);
|
|
|
|
|
|
|
|
/*
|
|
|
|
echo '<div id="menu_tab_frame"><div id="menu_tab_left"><ul class="mn">';
|
|
|
|
echo '<li class="nomn"><a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">';
|
|
|
|
print_image ("images/setup.png", false, $img_style);
|
|
|
|
echo ' '.mb_substr (get_agent_name ($id_agente), 0, 21).'</a>';
|
|
|
|
echo "</li></ul></div>";
|
|
|
|
|
|
|
|
echo '<div id="menu_tab"><ul class="mn"><li class="nomn">';
|
|
|
|
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
|
|
|
print_image ("images/zoom.png", false, $img_style);
|
|
|
|
echo ' '.__('View').'</a></li>';
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "
|
|
|
|
<div id='menu_tab_frame_view'>
|
|
|
|
<div id='menu_tab_left'>
|
|
|
|
<ul class='mn'>
|
|
|
|
<li class='view'>" . __('Search') . ": \"" . $config['search_keywords'] . "\"</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id='menu_tab'>
|
|
|
|
<ul class='mn'>";
|
|
|
|
|
|
|
|
if ($searchAgents)
|
|
|
|
{
|
|
|
|
if ($searchTab == "agents")
|
|
|
|
echo "<li class='nomn_high'>";
|
|
|
|
else
|
|
|
|
echo "<li class='nomn'>";
|
2009-08-06 20:55:54 +02:00
|
|
|
echo "<a href='?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>";
|
|
|
|
print_image ("images/bricks.png", false, $img_style);
|
|
|
|
echo " ".__('Agents')."</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "</li>";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($searchTab == "users")
|
|
|
|
echo "<li class='nomn_high'>";
|
|
|
|
else
|
|
|
|
echo "<li class='nomn'>";
|
2009-08-06 20:55:54 +02:00
|
|
|
echo "<a href='?search_category=users&keywords=".$config['search_keywords']. "&head_search_keywords=Search'> ";
|
|
|
|
print_image ("images/group.png", false, $img_style);
|
|
|
|
echo " ".__('Users')."</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "</li>";
|
|
|
|
|
|
|
|
if ($searchTab == "alerts")
|
|
|
|
echo "<li class='nomn_high'>";
|
|
|
|
else
|
|
|
|
echo "<li class='nomn'>";
|
2009-08-06 20:55:54 +02:00
|
|
|
echo "<a href='?search_category=alerts&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
|
|
|
print_image ("images/god2.png", false, $img_style);
|
|
|
|
echo " ".__('Alerts')."</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "</li>";
|
|
|
|
|
|
|
|
if ($searchGraphs)
|
|
|
|
{
|
|
|
|
if ($searchTab == "graphs")
|
|
|
|
echo "<li class='nomn_high'>";
|
|
|
|
else
|
|
|
|
echo "<li class='nomn'>";
|
2009-08-06 20:55:54 +02:00
|
|
|
echo "<a href='?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
|
|
|
print_image ("images/chart_curve.png", false, $img_style);
|
|
|
|
echo " ".__('Graphs'). "</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "</li>";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($searchTab == "reports")
|
|
|
|
echo "<li class='nomn_high'>";
|
|
|
|
else
|
|
|
|
echo "<li class='nomn'>";
|
2009-08-06 20:55:54 +02:00
|
|
|
echo "<a href='?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
|
|
|
print_image ("images/reporting.png", false, $img_style);
|
|
|
|
echo " ".__('Reports')."</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "</li>";
|
|
|
|
|
|
|
|
if ($searchMaps)
|
|
|
|
{
|
|
|
|
if ($searchTab == "maps")
|
|
|
|
echo "<li class='nomn_high'>";
|
|
|
|
else
|
|
|
|
echo "<li class='nomn'>";
|
2009-08-06 20:55:54 +02:00
|
|
|
echo "<a href='?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
|
|
|
print_image ("images/camera.png", false, $img_style);
|
|
|
|
echo " ".__('Maps')."</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
echo "</li>";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "</ul>
|
|
|
|
</div>
|
|
|
|
</div>";
|
|
|
|
echo "<div style='height: 25px'> </div>";
|
|
|
|
|
2009-07-29 19:19:27 +02:00
|
|
|
///////// END MENU AND TABS /////////////
|
|
|
|
|
2009-07-22 17:26:31 +02:00
|
|
|
if (($agents === false) && ($users === false) && ($alerts === false) && ($graphs === false)
|
|
|
|
&& ($reports === false) && ($maps === false)) {
|
2009-09-26 19:23:51 +02:00
|
|
|
echo "<br><div class='nf'>" . __("Zero results found") . "</div>\n";
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($agents !== false) {
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->width = "98%";
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Agent');
|
|
|
|
$table->head[1] = __('OS');
|
|
|
|
$table->head[2] = __('Interval');
|
|
|
|
$table->head[3] = __('Group');
|
|
|
|
$table->head[4] = __('Modules');
|
|
|
|
$table->head[5] = __('Status');
|
|
|
|
$table->head[6] = __('Alerts');
|
|
|
|
$table->head[7] = __('Last contact');
|
|
|
|
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[0] = "left";
|
|
|
|
$table->align[1] = "center";
|
|
|
|
$table->align[2] = "center";
|
|
|
|
$table->align[3] = "center";
|
|
|
|
$table->align[4] = "center";
|
|
|
|
$table->align[5] = "center";
|
|
|
|
$table->align[6] = "center";
|
|
|
|
$table->align[7] = "right";
|
|
|
|
|
|
|
|
$table->data = array ();
|
|
|
|
|
2009-07-22 17:26:31 +02:00
|
|
|
foreach ($agents as $agent) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$agent_info = get_agent_module_info ($agent["id_agente"]);
|
|
|
|
|
|
|
|
$modulesCell = '<b>'. $agent_info["modules"] . '</b>';
|
|
|
|
if ($agent_info["monitor_normal"] > 0)
|
|
|
|
$modulesCell .= '</b> : <span class="green">'.$agent_info["monitor_normal"].'</span>';
|
|
|
|
if ($agent_info["monitor_warning"] > 0)
|
|
|
|
$modulesCell .= ' : <span class="yellow">'.$agent_info["monitor_warning"].'</span>';
|
|
|
|
if ($agent_info["monitor_critical"] > 0)
|
|
|
|
$modulesCell .= ' : <span class="red">'.$agent_info["monitor_critical"].'</span>';
|
|
|
|
if ($agent_info["monitor_down"] > 0)
|
|
|
|
$modulesCell .= ' : <span class="grey">'.$agent_info["monitor_down"].'</span>';
|
|
|
|
|
|
|
|
array_push($table->data, array(
|
|
|
|
print_agent_name ($agent["id_agente"], true, "upper"),
|
|
|
|
print_os_icon ($agent["id_os"], false, true),
|
|
|
|
(($agent_info["interval"] > $agent["intervalo"]) ? $agent_info["interval"] : $agent['intervalo']),
|
|
|
|
print_group_icon ($agent["id_grupo"], true),
|
|
|
|
$modulesCell,
|
|
|
|
$agent_info["status_img"],
|
|
|
|
$agent_info["alert_img"],
|
|
|
|
print_timestamp ($agent_info["last_contact"], true)));
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
echo "<br />";pagination ($totalAgents);
|
|
|
|
print_table ($table); unset($table);
|
|
|
|
pagination ($totalAgents);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($users !== false) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->width = "98%";
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('User ID');
|
|
|
|
$table->head[1] = __('Name');
|
|
|
|
$table->head[2] = __('Email');
|
|
|
|
$table->head[3] = __('Last contact');
|
|
|
|
$table->head[4] = __('Profile');
|
|
|
|
$table->head[5] = __('Description');
|
|
|
|
|
|
|
|
$table->data = array ();
|
|
|
|
|
2009-07-22 17:26:31 +02:00
|
|
|
foreach ($users as $user) {
|
|
|
|
if ($linkEditUser)
|
2009-07-29 19:19:27 +02:00
|
|
|
$userIDCell = "<a href='?sec=gusuarios&sec2=godmode/users/configure_user&id=" .
|
|
|
|
$user['id_user'] . "'>" . $user['id_user'] . "</a>";
|
2009-07-22 17:26:31 +02:00
|
|
|
else
|
2009-07-29 19:19:27 +02:00
|
|
|
$userIDCell = $user['id_user'];
|
|
|
|
|
|
|
|
if ($user["is_admin"]) {
|
|
|
|
$profileCell = print_image ("images/user_suit.png", true,
|
|
|
|
array ("alt" => __('Admin'),
|
|
|
|
"title" => __('Administrator'))).' ';
|
|
|
|
} else {
|
|
|
|
$profileCell = print_image ("images/user_green.png", true,
|
|
|
|
array ("alt" => __('User'),
|
|
|
|
"title" => __('Standard User'))).' ';
|
|
|
|
}
|
|
|
|
$profileCell .= '<a href="#" class="tip"><span>';
|
|
|
|
$result = get_db_all_rows_field_filter ("tusuario_perfil", "id_usuario", $user['id_user']);
|
|
|
|
if ($result !== false) {
|
|
|
|
foreach ($result as $row) {
|
|
|
|
$profileCell .= get_profile_name ($row["id_perfil"]);
|
|
|
|
$profileCell .= " / ";
|
|
|
|
$profileCell .= get_group_name ($row["id_grupo"]);
|
|
|
|
$profileCell .= "<br />";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$profileCell .= __('The user doesn\'t have any assigned profile/group');
|
|
|
|
}
|
|
|
|
$profileCell .= "</span></a>";
|
|
|
|
|
|
|
|
array_push($table->data, array(
|
|
|
|
$userIDCell,
|
|
|
|
$user['fullname'],
|
|
|
|
"<a href='mailto:" . $user['email'] . "'>" . $user['email'] . "</a>",
|
|
|
|
print_timestamp ($user["last_connect"], true),
|
|
|
|
$profileCell,
|
|
|
|
$user['comments']));
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
echo "<br />";pagination ($totalUsers);
|
|
|
|
print_table ($table); unset($table);
|
|
|
|
pagination ($totalUsers);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($alerts !== false) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->width = "98%";
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = '';
|
|
|
|
$table->head[1] = __('Agent');
|
|
|
|
$table->head[2] = __('Module');
|
|
|
|
$table->head[3] = __('Template');
|
|
|
|
$table->head[4] = __('Action');
|
|
|
|
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[0] = "center";
|
|
|
|
$table->align[1] = "left";
|
|
|
|
$table->align[2] = "left";
|
|
|
|
$table->align[3] = "left";
|
|
|
|
$table->align[4] = "left";
|
|
|
|
|
|
|
|
$table->valign = array ();
|
|
|
|
$table->valign[0] = "top";
|
|
|
|
$table->valign[1] = "top";
|
|
|
|
$table->valign[2] = "top";
|
|
|
|
$table->valign[3] = "top";
|
|
|
|
$table->valign[4] = "top";
|
|
|
|
|
|
|
|
$table->data = array ();
|
2009-07-22 17:26:31 +02:00
|
|
|
foreach ($alerts as $alert) {
|
2009-07-29 19:19:27 +02:00
|
|
|
if ($alert['disabled'])
|
|
|
|
$disabledCell = print_image ('images/lightbulb_off.png', true, array('title' => 'disable', 'alt' => 'disable'));
|
|
|
|
else
|
|
|
|
$disabledCell = print_image ('images/lightbulb.png', true, array('alt' => 'enable', 'title' => 'enable'));
|
|
|
|
|
|
|
|
$actionCell = '';
|
|
|
|
if (strlen($alert["actions"]) > 0) {
|
|
|
|
$arrayActions = explode(',', $alert["actions"]);
|
|
|
|
$actionCell = '<ul class="action_list">';
|
|
|
|
foreach ($arrayActions as $action)
|
|
|
|
$actionCell .= '<li><div><span class="action_name">' . $action . '</span></div><br /></li>';
|
|
|
|
$actionCell .= '</ul>';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
array_push($table->data, array(
|
|
|
|
$disabledCell,
|
|
|
|
print_agent_name ($alert["id_agente"], true, "upper"),
|
|
|
|
$alert["module_name"],
|
|
|
|
$alert["template_name"],$actionCell
|
|
|
|
));
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
echo "<br />";pagination ($totalAlerts);
|
|
|
|
print_table ($table); unset($table);
|
|
|
|
pagination ($totalAlerts);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($graphs !== false) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->width = "98%";
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Graph name');
|
|
|
|
$table->head[1] = __('Description');
|
|
|
|
|
|
|
|
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[1] = "center";
|
|
|
|
$table->align[2] = "center";
|
|
|
|
|
|
|
|
$table->data = array ();
|
2009-07-22 17:26:31 +02:00
|
|
|
foreach ($graphs as $graph) {
|
2009-07-29 19:19:27 +02:00
|
|
|
array_push($table->data, array(
|
|
|
|
"<a href='?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=" .
|
|
|
|
$graph['id_graph'] . "'>" . $graph['name'] . "</a>",
|
|
|
|
$graph['description']
|
|
|
|
));
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
echo "<br />";pagination ($totalGraphs);
|
|
|
|
print_table ($table); unset($table);
|
|
|
|
pagination ($totalGraphs);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($reports !== false) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->width = "98%";
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Report name');
|
|
|
|
$table->head[1] = __('Description');
|
|
|
|
$table->head[2] = __('HTML');
|
|
|
|
$table->head[3] = __('XML');
|
|
|
|
enterprise_hook ('load_custom_reporting_1');
|
|
|
|
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[0] = "center";
|
|
|
|
$table->align[1] = "center";
|
|
|
|
$table->align[2] = "center";
|
|
|
|
$table->align[3] = "center";
|
|
|
|
|
|
|
|
$table->data = array ();
|
2009-07-22 17:26:31 +02:00
|
|
|
foreach ($reports as $report) {
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
$data = array(
|
|
|
|
"<a href='?sec=greporting&sec2=godmode/reporting/reporting_builder&edit_report=1&id_report=" . $report['id_report'] . "' title='" . __("Edit") . "'>" .
|
|
|
|
$report['name'] . "</a>",
|
|
|
|
$report['description'],
|
|
|
|
'<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'"><img src="images/reporting.png" /></a>',
|
|
|
|
'<a href="ajax.php?page=operation/reporting/reporting_xml&id='.$report['id_report'].'"><img src="images/database_lightning.png" /></a>'
|
|
|
|
);
|
|
|
|
enterprise_hook ('load_custom_reporting_2');
|
|
|
|
|
|
|
|
array_push($table->data, $data);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
echo "<br />";pagination ($totalReports);
|
|
|
|
print_table ($table); unset($table);
|
|
|
|
pagination ($totalReports);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($maps !== false) {
|
2009-07-29 19:19:27 +02:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->width = "98%";
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Name');
|
|
|
|
$table->head[1] = __('Group');
|
|
|
|
$table->head[2] = __('Elements');
|
|
|
|
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[0] = "center";
|
|
|
|
$table->align[1] = "center";
|
|
|
|
$table->align[2] = "center";
|
|
|
|
|
|
|
|
$table->data = array ();
|
2009-07-22 17:26:31 +02:00
|
|
|
foreach ($maps as $map) {
|
2009-07-29 19:19:27 +02:00
|
|
|
array_push($table->data, array(
|
|
|
|
"<a href='?sec=visualc&sec2=operation/visual_console/render_view&id=" .
|
|
|
|
$map['id'] . "'>" . $map['name'] . "</a>",
|
|
|
|
print_group_icon ($layout["id_group"], true) . " " . get_group_name ($layout["id_group"]),
|
|
|
|
$map['count']
|
|
|
|
));
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
2009-07-29 19:19:27 +02:00
|
|
|
|
|
|
|
echo "<br />";pagination ($totalMaps);
|
|
|
|
print_table ($table); unset($table);
|
|
|
|
pagination ($totalMaps);
|
2009-07-22 17:26:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|