2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2006-10-04 18:15:20 +02:00
|
|
|
|
2009-06-08 20:26:14 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2008-07-30 20:39:40 +02:00
|
|
|
|
2006-10-04 18:15:20 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
2011-03-23 Raul Mateos <raulofpandora@gmail.com>
* extensions/ssh_console.php, extensions/vnc_view.php,
extensions/update_manager.php, extensions/users_connected.php,
extensions/extension_uploader.php, extensions/insert_data.php,
extensions/module_groups.php, extensions/plugin_registration.php,
extensions/agent_modules.php, extensions/resource_registration.php,
extensions/resource_exportation.php, extensions/dbmanager.php,
extensions/pandora_logs.php, general/*.php, ajax.php,
operation/search_*.php, operation/menu.php, operation/extensions.php,
godmode/menu.php, godmode/extensions.php, godmode/admin_access_logs.php:
CReverted unwanted license changes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4126 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-23 17:13:28 +01:00
|
|
|
// modify it under the terms of the GNU General Public License
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
2006-10-04 18:15:20 +02:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2006-10-04 18:15:20 +02:00
|
|
|
// GNU General Public License for more details.
|
2009-06-08 20:26:14 +02:00
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-11-11 15:24:34 +01:00
|
|
|
require_once ("include/config.php");
|
|
|
|
|
2009-01-20 21:01:25 +01:00
|
|
|
// This solves problems in enterprise load
|
|
|
|
global $config;
|
|
|
|
|
2008-11-11 15:24:34 +01:00
|
|
|
check_login ();
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
|
2008-08-05 12:47:40 +02:00
|
|
|
/* Call all extensions login function */
|
2012-04-13 12:39:28 +02:00
|
|
|
//extensions_call_login_function ();
|
2008-08-05 12:47:40 +02:00
|
|
|
|
2008-11-11 15:24:34 +01:00
|
|
|
require_once ("include/functions_reporting.php");
|
2011-04-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php, include/graphs/functions_gd.php,
include/graphs/fgraph.php, include/functions_visual_map.php,
include/fgraph.php, operation/agentes/estado_generalagente.php,
operation/agentes/tactical.php. operation/agentes/stat_win.php,
operation/servers/view_server.php, operation/servers/view_server_detail.php,
mobile/operation/agents/tactical.php, general/logon_ok.php,
godmode/reporting/graph_builder.preview.php: added function "progress_bar2"
and changed in source code of Pandora.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4199 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-13 11:29:10 +02:00
|
|
|
require_once ($config["homedir"] . '/include/functions_graph.php');
|
2008-11-11 15:24:34 +01:00
|
|
|
|
2011-04-13 18:11:02 +02:00
|
|
|
ui_print_page_header (__('Welcome to Pandora FMS Web Console'));
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
|
2014-06-10 16:34:27 +02:00
|
|
|
if (tags_has_user_acl_tags()) {
|
2013-01-10 17:00:30 +01:00
|
|
|
ui_print_tags_warning();
|
|
|
|
}
|
2014-06-10 16:34:27 +02:00
|
|
|
|
|
|
|
|
2014-10-21 11:11:09 +02:00
|
|
|
?>
|
|
|
|
<table border="0" width="98%">
|
|
|
|
<tr>
|
|
|
|
|
2014-12-01 09:52:22 +01:00
|
|
|
<td width="30%" style="padding-right: 10px;" valign="top">
|
2014-10-21 11:11:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$data = reporting_get_group_stats ();
|
|
|
|
|
|
|
|
///////////////
|
|
|
|
// Overview Table
|
|
|
|
///////////////
|
|
|
|
|
|
|
|
$table->class = "databox";
|
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->head = array ();
|
|
|
|
$table->data = array ();
|
|
|
|
$table->style[0] = 'text-align:center;';
|
|
|
|
$table->width = "100%";
|
|
|
|
$table->head[0] = '<span>' . __('Pandora FMS Overview') . '</span>';
|
|
|
|
$table->head_colspan[0] = 4;
|
|
|
|
|
|
|
|
// Indicators
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_indicators($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Alerts
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_alerts($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Modules by status
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_modules_status($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Total agents and modules
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_agents_monitors($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Users
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_users($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
html_print_table($table);
|
|
|
|
unset($table);
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td width="70%" valign="top">
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
$options = array();
|
|
|
|
$options['id_user'] = $config['id_user'];
|
|
|
|
$options['modal'] = false;
|
|
|
|
$options['limit'] = 3;
|
|
|
|
$news = get_news($options);
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($news)) {
|
|
|
|
//////////////////NEWS BOARD/////////////////////////////
|
|
|
|
echo '<div id="news_board">';
|
|
|
|
|
|
|
|
echo '<table cellpadding="4" cellspacing="4" class="databox">';
|
|
|
|
echo '<tr><th><span>' . __('News board') . '</span></th></tr>';
|
|
|
|
if ($config["prominent_time"] == "timestamp") {
|
|
|
|
$comparation_suffix = "";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$comparation_suffix = __('ago');
|
|
|
|
}
|
|
|
|
foreach ($news as $article) {
|
|
|
|
$text = io_safe_output($article["text"]);
|
|
|
|
|
|
|
|
|
|
|
|
echo '<tr><th><b>'.$article["subject"].'</b></th></tr>';
|
|
|
|
echo '<tr><td>' . __('by') . ' <b>' .
|
|
|
|
$article["author"] . '</b> <i>' . ui_print_timestamp ($article["timestamp"], true).'</i> ' . $comparation_suffix . '</td></tr>';
|
|
|
|
echo '<tr><td class="datos">';
|
|
|
|
echo nl2br($text);
|
|
|
|
echo '</td></tr>';
|
|
|
|
}
|
|
|
|
echo '</table>';
|
|
|
|
echo '</div>'; // News board
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<br><br>';
|
|
|
|
|
|
|
|
//////////////////END OF NEWS BOARD/////////////////////////////
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////LAST ACTIVITY/////////////////////////////
|
|
|
|
|
|
|
|
// Show last activity from this user
|
|
|
|
echo '<div id="activity">';
|
|
|
|
|
|
|
|
$table->width = '100%'; //Don't specify px
|
|
|
|
$table->data = array ();
|
|
|
|
$table->size = array ();
|
|
|
|
$table->size[2] = '150px';
|
|
|
|
$table->size[3] = '130px';
|
|
|
|
$table->size[5] = '200px';
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('User');
|
|
|
|
$table->head[1] = '';
|
|
|
|
$table->head[2] = __('Action');
|
|
|
|
$table->head[3] = __('Date');
|
|
|
|
$table->head[4] = __('Source IP');
|
|
|
|
$table->head[5] = __('Comments');
|
|
|
|
$table->title = '<span>' . __('This is your last activity in Pandora FMS console') . '</span>';
|
|
|
|
|
|
|
|
switch ($config["dbtype"]) {
|
|
|
|
case "mysql":
|
|
|
|
$sql = sprintf ("SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp
|
|
|
|
FROM tsesion
|
|
|
|
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - " . SECONDS_1WEEK . ")
|
|
|
|
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10", $config["id_user"]);
|
|
|
|
break;
|
|
|
|
case "postgresql":
|
|
|
|
$sql = sprintf ("SELECT \"id_usuario\", accion, fecha, \"ip_origen\", descripcion, utimestamp
|
|
|
|
FROM tsesion
|
|
|
|
WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - " . SECONDS_1WEEK . ")
|
|
|
|
AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 10", $config["id_user"]);
|
|
|
|
break;
|
|
|
|
case "oracle":
|
|
|
|
$sql = sprintf ("SELECT id_usuario, accion, fecha, ip_origen, descripcion, utimestamp
|
|
|
|
FROM tsesion
|
|
|
|
WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (" . SECONDS_1DAY . ")) - " . SECONDS_1WEEK . ")
|
|
|
|
AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC", $config["id_user"]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
$sessions = db_get_all_rows_sql ($sql);
|
|
|
|
|
|
|
|
if ($sessions === false)
|
|
|
|
$sessions = array ();
|
|
|
|
|
|
|
|
foreach ($sessions as $session) {
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
switch ($config["dbtype"]) {
|
|
|
|
case "mysql":
|
|
|
|
case "oracle":
|
|
|
|
$session_id_usuario = $session['id_usuario'];
|
|
|
|
$session_ip_origen = $session['ip_origen'];
|
|
|
|
break;
|
|
|
|
case "postgresql":
|
|
|
|
$session_id_usuario = $session['id_usuario'];
|
|
|
|
$session_ip_origen = $session['ip_origen'];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$data[0] = '<strong>' . $session_id_usuario . '</strong>';
|
|
|
|
$data[1] = ui_print_session_action_icon ($session['accion'], true);
|
|
|
|
$data[2] = $session['accion'];
|
|
|
|
$data[3] = ui_print_help_tip($session['fecha'], true) . human_time_comparation($session['utimestamp'], 'tiny');
|
|
|
|
$data[4] = $session_ip_origen;
|
|
|
|
$data[5] = io_safe_output ($session['descripcion']);
|
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
|
|
|
echo "<div style='width:100%; overflow-x:auto;'>";
|
|
|
|
html_print_table ($table);
|
|
|
|
unset($table);
|
|
|
|
echo "</div>";
|
|
|
|
echo "</div>"; // activity
|
|
|
|
|
|
|
|
//////////////////END OF LAST ACTIVIYY/////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
|
|
return;
|
2014-06-10 16:34:27 +02:00
|
|
|
// ---------------------------------------------------------------------
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
// Site news !
|
2014-06-10 16:34:27 +02:00
|
|
|
// ---------------------------------------------------------------------
|
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
|
|
|
|
2014-09-23 12:16:15 +02:00
|
|
|
//echo '<div id="left_column_logon_ok" id="leftcolumn">';
|
2014-10-21 11:11:09 +02:00
|
|
|
echo '<div style="width:30%; float:left;" id="leftcolumn">';
|
2014-12-01 09:52:22 +01:00
|
|
|
|
|
|
|
|
2014-10-21 11:11:09 +02:00
|
|
|
$data = reporting_get_group_stats ();
|
|
|
|
|
|
|
|
///////////////
|
|
|
|
// Overview Table
|
|
|
|
///////////////
|
|
|
|
|
|
|
|
$table->class = "databox";
|
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->head = array ();
|
|
|
|
$table->data = array ();
|
|
|
|
$table->style[0] = 'text-align:center;';
|
|
|
|
$table->width = "100%";
|
|
|
|
$table->head[0] = '<span>' . __('Pandora FMS Overview') . '</span>';
|
|
|
|
$table->head_colspan[0] = 4;
|
|
|
|
|
|
|
|
// Indicators
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_indicators($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Alerts
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_alerts($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Modules by status
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_modules_status($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Total agents and modules
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_agents_monitors($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
// Users
|
|
|
|
$tdata = array();
|
|
|
|
$tdata[0] = reporting_get_stats_users($data);
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
$table->data[] = $tdata;
|
|
|
|
|
|
|
|
html_print_table($table);
|
|
|
|
unset($table);
|
2014-12-01 09:52:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-21 11:11:09 +02:00
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// Site stats (global!)
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//echo '<div id="right_column_logon_ok" id="rightcolumn">';
|
|
|
|
echo '<div style="width: 50%; float:left;" id="rightcolumn">';
|
|
|
|
|
|
|
|
$options = array();
|
2014-05-30 11:27:20 +02:00
|
|
|
$options['id_user'] = $config['id_user'];
|
|
|
|
$options['modal'] = false;
|
|
|
|
$options['limit'] = 3;
|
|
|
|
$news = get_news($options);
|
2013-03-15 15:35:52 +01:00
|
|
|
|
2014-10-21 11:11:09 +02:00
|
|
|
|
|
|
|
if (!empty($news)) {
|
|
|
|
//////////////////NEWS BOARD/////////////////////////////
|
|
|
|
echo '<div id="news_board">';
|
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
echo '<table cellpadding="4" cellspacing="4" class="databox">';
|
2013-04-23 16:57:29 +02:00
|
|
|
echo '<tr><th><span>' . __('News board') . '</span></th></tr>';
|
2013-02-28 12:43:10 +01:00
|
|
|
if ($config["prominent_time"] == "timestamp") {
|
|
|
|
$comparation_suffix = "";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$comparation_suffix = __('ago');
|
|
|
|
}
|
|
|
|
foreach ($news as $article) {
|
2013-08-19 08:49:17 +02:00
|
|
|
$text = io_safe_output($article["text"]);
|
|
|
|
|
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
echo '<tr><th><b>'.$article["subject"].'</b></th></tr>';
|
2014-10-21 11:11:09 +02:00
|
|
|
echo '<tr><td>' . __('by') . ' <b>' .
|
|
|
|
$article["author"] . '</b> <i>' . ui_print_timestamp ($article["timestamp"], true).'</i> ' . $comparation_suffix . '</td></tr>';
|
2013-02-28 12:43:10 +01:00
|
|
|
echo '<tr><td class="datos">';
|
2013-08-19 08:49:17 +02:00
|
|
|
echo nl2br($text);
|
2013-02-28 12:43:10 +01:00
|
|
|
echo '</td></tr>';
|
|
|
|
}
|
|
|
|
echo '</table>';
|
2014-10-21 11:11:09 +02:00
|
|
|
echo '</div>'; // News board
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<br><br>';
|
|
|
|
|
|
|
|
//////////////////END OF NEWS BOARD/////////////////////////////
|
2012-02-28 12:48:45 +01:00
|
|
|
}
|
2013-02-28 12:43:10 +01:00
|
|
|
|
|
|
|
//////////////////LAST ACTIVITY/////////////////////////////
|
|
|
|
|
|
|
|
// Show last activity from this user
|
|
|
|
echo '<div id="activity">';
|
2013-03-15 15:35:52 +01:00
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
$table->width = '100%'; //Don't specify px
|
|
|
|
$table->data = array ();
|
|
|
|
$table->size = array ();
|
2013-04-10 09:57:54 +02:00
|
|
|
$table->size[2] = '150px';
|
|
|
|
$table->size[3] = '130px';
|
|
|
|
$table->size[5] = '200px';
|
2013-02-28 12:43:10 +01:00
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('User');
|
2013-04-10 09:57:54 +02:00
|
|
|
$table->head[1] = '';
|
|
|
|
$table->head[2] = __('Action');
|
|
|
|
$table->head[3] = __('Date');
|
|
|
|
$table->head[4] = __('Source IP');
|
|
|
|
$table->head[5] = __('Comments');
|
2013-04-23 16:57:29 +02:00
|
|
|
$table->title = '<span>' . __('This is your last activity in Pandora FMS console') . '</span>';
|
2013-03-15 15:35:52 +01:00
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
switch ($config["dbtype"]) {
|
|
|
|
case "mysql":
|
|
|
|
$sql = sprintf ("SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp
|
|
|
|
FROM tsesion
|
|
|
|
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - " . SECONDS_1WEEK . ")
|
|
|
|
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10", $config["id_user"]);
|
|
|
|
break;
|
|
|
|
case "postgresql":
|
|
|
|
$sql = sprintf ("SELECT \"id_usuario\", accion, fecha, \"ip_origen\", descripcion, utimestamp
|
|
|
|
FROM tsesion
|
|
|
|
WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - " . SECONDS_1WEEK . ")
|
|
|
|
AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 10", $config["id_user"]);
|
|
|
|
break;
|
|
|
|
case "oracle":
|
|
|
|
$sql = sprintf ("SELECT id_usuario, accion, fecha, ip_origen, descripcion, utimestamp
|
|
|
|
FROM tsesion
|
|
|
|
WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (" . SECONDS_1DAY . ")) - " . SECONDS_1WEEK . ")
|
|
|
|
AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC", $config["id_user"]);
|
|
|
|
break;
|
2011-11-12 03:54:57 +01:00
|
|
|
}
|
2013-03-15 15:35:52 +01:00
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
$sessions = db_get_all_rows_sql ($sql);
|
2013-03-15 15:35:52 +01:00
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
if ($sessions === false)
|
|
|
|
$sessions = array ();
|
2013-03-15 15:35:52 +01:00
|
|
|
|
2013-02-28 12:43:10 +01:00
|
|
|
foreach ($sessions as $session) {
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
switch ($config["dbtype"]) {
|
|
|
|
case "mysql":
|
|
|
|
case "oracle":
|
|
|
|
$session_id_usuario = $session['id_usuario'];
|
|
|
|
$session_ip_origen = $session['ip_origen'];
|
|
|
|
break;
|
|
|
|
case "postgresql":
|
|
|
|
$session_id_usuario = $session['id_usuario'];
|
|
|
|
$session_ip_origen = $session['ip_origen'];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$data[0] = '<strong>' . $session_id_usuario . '</strong>';
|
|
|
|
$data[1] = ui_print_session_action_icon ($session['accion'], true);
|
2013-04-10 09:57:54 +02:00
|
|
|
$data[2] = $session['accion'];
|
2014-06-02 18:57:20 +02:00
|
|
|
$data[3] = ui_print_help_tip($session['fecha'], true) . human_time_comparation($session['utimestamp'], 'tiny');
|
2013-04-10 09:57:54 +02:00
|
|
|
$data[4] = $session_ip_origen;
|
|
|
|
$data[5] = io_safe_output ($session['descripcion']);
|
2013-02-28 12:43:10 +01:00
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
2006-12-15 16:25:19 +01:00
|
|
|
}
|
2013-02-28 12:43:10 +01:00
|
|
|
echo "<div style='width:100%; overflow-x:auto;'>";
|
|
|
|
html_print_table ($table);
|
|
|
|
unset($table);
|
|
|
|
echo "</div>";
|
|
|
|
echo "</div>"; // activity
|
|
|
|
|
|
|
|
//////////////////END OF LAST ACTIVIYY/////////////////////////////
|
|
|
|
|
2013-02-25 17:44:26 +01:00
|
|
|
|
|
|
|
|
2009-12-04 13:12:04 +01:00
|
|
|
echo "</div>";
|
2013-02-26 17:10:02 +01:00
|
|
|
echo "<div style='clear:both'></div>";
|
2012-12-27 09:24:11 +01:00
|
|
|
?>
|