mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
2012-08-17 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: fixed the error messages althought you have event data. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6875 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
cb962963b4
commit
2694f6bd73
@ -1,15 +1,31 @@
|
|||||||
2012-08-16 Vanessa Gil <vanessa.gil@artica.es>
|
2012-08-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_api.php: fixed the error messages althought you
|
||||||
|
have event data.
|
||||||
|
|
||||||
* pandoradb.oracle.sql
|
2012-08-16 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
pandoradb.postgreSQL.sql
|
|
||||||
pandoradb.sql
|
* extensions/plugin_registration.php, extensions/insert_data.php,
|
||||||
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
|
operation/users/user_edit.php, operation/events/events_list.php,
|
||||||
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
|
operation/events/events.php, operation/events/export_csv.php,
|
||||||
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Changed
|
operation/incidents/incident_detail.php,
|
||||||
type 'subnet' and 'field1' to trecon_task table.
|
operation/visual_console/render_view.php, extras/pandora_diag.php,
|
||||||
|
mobile/operation/agents/view_agents.php,
|
||||||
* godmode/servers/manage_recontask_form.php: Added help tip:
|
godmode/servers/manage_recontask.php,
|
||||||
several networks to recon task.
|
godmode/reporting/visual_console_builder.wizard.php,
|
||||||
|
include/functions_api.php: cleaned source code style.
|
||||||
|
|
||||||
|
* godmode/setup/setup_visuals.php, operation/gis_maps/ajax.php,
|
||||||
|
operation/gis_maps/index.php, operation/gis_maps/render_view.php,
|
||||||
|
include/functions_config.php, include/functions_gis.php,
|
||||||
|
include/javascript/openlayers.pandora.js: added the feature to
|
||||||
|
hidden the names of agents in the map, and when it is set the
|
||||||
|
default icon in the setup and the agent haven't the icon, then this
|
||||||
|
is show in the map. Some code from the files "functions_config.php"
|
||||||
|
and "setup_visuals.php" are modifications of Sancho Lerena from the
|
||||||
|
branch 4.0.
|
||||||
|
|
||||||
|
MERGED FROM BRANCH PANDORA 4.0
|
||||||
|
|
||||||
2012-08-16 Sergio Martin <sergio.martin@artica.es>
|
2012-08-16 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
@ -191,7 +191,10 @@ function mainInsertData() {
|
|||||||
page: "operation/agentes/exportdata",
|
page: "operation/agentes/exportdata",
|
||||||
"search_agents_2": 1,
|
"search_agents_2": 1,
|
||||||
"q": term,
|
"q": term,
|
||||||
id_group: function() { return $("#id_group").val(); }};
|
id_group: function() {
|
||||||
|
return $("#id_group").val();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: data_params,
|
data: data_params,
|
||||||
|
@ -89,9 +89,9 @@ function pluginreg_extension_main () {
|
|||||||
unlink ($config["attachment_store"] . "/plugin_definition.ini");
|
unlink ($config["attachment_store"] . "/plugin_definition.ini");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify if a plugin with the same name is already registered
|
// Verify if a plugin with the same name is already registered
|
||||||
|
|
||||||
$sql0 = "SELECT COUNT(*) FROM tplugin WHERE name = '" . io_safe_input ($ini_array["plugin_definition"]["name"]) . "'";
|
$sql0 = "SELECT COUNT(*) FROM tplugin WHERE name = '" . io_safe_input ($ini_array["plugin_definition"]["name"]) . "'";
|
||||||
$result = db_get_sql ($sql0);
|
$result = db_get_sql ($sql0);
|
||||||
|
|
||||||
@ -99,9 +99,9 @@ function pluginreg_extension_main () {
|
|||||||
if ($result> 0) {
|
if ($result> 0) {
|
||||||
echo "<h2 class=error>".__("Plugin already registered. Aborting!")."</h2>";
|
echo "<h2 class=error>".__("Plugin already registered. Aborting!")."</h2>";
|
||||||
unlink ($config["attachment_store"] . "/plugin_definition.ini");
|
unlink ($config["attachment_store"] . "/plugin_definition.ini");
|
||||||
return;;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = array(
|
$values = array(
|
||||||
'name' => io_safe_input ($ini_array["plugin_definition"]["name"]),
|
'name' => io_safe_input ($ini_array["plugin_definition"]["name"]),
|
||||||
'description' => io_safe_input ($ini_array["plugin_definition"]["description"]),
|
'description' => io_safe_input ($ini_array["plugin_definition"]["description"]),
|
||||||
|
@ -52,7 +52,7 @@ if (!isset($argc))
|
|||||||
|
|
||||||
if ($console_mode == 1) {
|
if ($console_mode == 1) {
|
||||||
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
|
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
|
||||||
|
|
||||||
if ($argc == 1 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) {
|
if ($argc == 1 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) {
|
||||||
echo "\nThis command line script gives information about Pandora FMS database.
|
echo "\nThis command line script gives information about Pandora FMS database.
|
||||||
This program only can be executed from console, and need a parameter, the
|
This program only can be executed from console, and need a parameter, the
|
||||||
@ -76,9 +76,9 @@ full path to Pandora FMS 'config.php' file.
|
|||||||
else {
|
else {
|
||||||
if (file_exists("../include/config.php"))
|
if (file_exists("../include/config.php"))
|
||||||
include "../include/config.php";
|
include "../include/config.php";
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Not from console, this is a web session
|
// Not from console, this is a web session
|
||||||
if ((!isset($config["id_user"])) OR (!check_acl ($config["id_user"], 0, "PM"))) {
|
if ((!isset($config["id_user"])) OR (!check_acl ($config["id_user"], 0, "PM"))) {
|
||||||
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
|
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
|
||||||
@ -121,43 +121,90 @@ render_info ("tsesion");
|
|||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_version'", "DB Schema Version");
|
render_info_data ("SELECT `value`
|
||||||
render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_build'", "DB Schema Build");
|
FROM tconfig
|
||||||
render_info_data ("SELECT `value` FROM tconfig WHERE `token` = 'enterprise_installed'", "Enterprise installed");
|
WHERE `token` = 'db_scheme_version'", "DB Schema Version");
|
||||||
render_row ( date ("Y/m/d H:i:s",db_get_sql ("SELECT `value` FROM tconfig WHERE `token` = 'db_maintance'")), "PandoraDB Last run");
|
render_info_data ("SELECT `value`
|
||||||
|
FROM tconfig
|
||||||
|
WHERE `token` = 'db_scheme_build'", "DB Schema Build");
|
||||||
|
render_info_data ("SELECT `value`
|
||||||
|
FROM tconfig
|
||||||
|
WHERE `token` = 'enterprise_installed'", "Enterprise installed");
|
||||||
|
render_row ( date ("Y/m/d H:i:s",
|
||||||
|
db_get_sql ("SELECT `value`
|
||||||
|
FROM tconfig
|
||||||
|
WHERE `token` = 'db_maintance'")), "PandoraDB Last run");
|
||||||
|
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'customer_key';", "Update Key");
|
render_info_data ("SELECT value
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'updating_code_path'", "Updating code path");
|
FROM tupdate_settings
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'keygen_path'", "Keygen path");
|
WHERE `key` = 'customer_key';", "Update Key");
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE `key` = 'current_update'", "Current Update #");
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE `key` = 'updating_code_path'", "Updating code path");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE `key` = 'keygen_path'", "Keygen path");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE `key` = 'current_update'", "Current Update #");
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
render_info_data ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_version'", "DB Schema Version");
|
render_info_data ("SELECT \"value\"
|
||||||
render_info_data ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_build'", "DB Schema Build");
|
FROM tconfig
|
||||||
render_info_data ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'enterprise_installed'", "Enterprise installed");
|
WHERE \"token\" = 'db_scheme_version'", "DB Schema Version");
|
||||||
render_row ( date ("Y/m/d H:i:s",db_get_sql ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_maintance'")), "PandoraDB Last run");
|
render_info_data ("SELECT \"value\"
|
||||||
|
FROM tconfig
|
||||||
|
WHERE \"token\" = 'db_scheme_build'", "DB Schema Build");
|
||||||
|
render_info_data ("SELECT \"value\"
|
||||||
|
FROM tconfig
|
||||||
|
WHERE \"token\" = 'enterprise_installed'", "Enterprise installed");
|
||||||
|
render_row ( date ("Y/m/d H:i:s",
|
||||||
|
db_get_sql ("SELECT \"value\"
|
||||||
|
FROM tconfig WHERE \"token\" = 'db_maintance'")), "PandoraDB Last run");
|
||||||
|
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'customer_key';", "Update Key");
|
render_info_data ("SELECT value
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'updating_code_path'", "Updating code path");
|
FROM tupdate_settings
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'keygen_path'", "Keygen path");
|
WHERE \"key\" = 'customer_key';", "Update Key");
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE \"key\" = 'current_update'", "Current Update #");
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE \"key\" = 'updating_code_path'", "Updating code path");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE \"key\" = 'keygen_path'", "Keygen path");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE \"key\" = 'current_update'", "Current Update #");
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
render_info_data ("SELECT value FROM tconfig WHERE token = 'db_scheme_version'", "DB Schema Version");
|
render_info_data ("SELECT value
|
||||||
render_info_data ("SELECT value FROM tconfig WHERE token = 'db_scheme_build'", "DB Schema Build");
|
FROM tconfig
|
||||||
render_info_data ("SELECT value FROM tconfig WHERE token = 'enterprise_installed'", "Enterprise installed");
|
WHERE token = 'db_scheme_version'", "DB Schema Version");
|
||||||
render_row (db_get_sql ("SELECT value FROM tconfig WHERE token = 'db_maintance'"), "PandoraDB Last run");
|
render_info_data ("SELECT value
|
||||||
|
FROM tconfig
|
||||||
|
WHERE token = 'db_scheme_build'", "DB Schema Build");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tconfig
|
||||||
|
WHERE token = 'enterprise_installed'", "Enterprise installed");
|
||||||
|
render_row (db_get_sql ("SELECT value
|
||||||
|
FROM tconfig
|
||||||
|
WHERE token = 'db_maintance'"), "PandoraDB Last run");
|
||||||
|
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'customer_key'", "Update Key");
|
render_info_data ("SELECT value
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'updating_code_path'", "Updating code path");
|
FROM tupdate_settings
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'keygen_path'", "Keygen path");
|
WHERE key = 'customer_key'", "Update Key");
|
||||||
render_info_data ("SELECT value FROM tupdate_settings WHERE key = 'current_update'", "Current Update #");
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE key = 'updating_code_path'", "Updating code path");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE key = 'keygen_path'", "Keygen path");
|
||||||
|
render_info_data ("SELECT value
|
||||||
|
FROM tupdate_settings
|
||||||
|
WHERE key = 'current_update'", "Current Update #");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($console_mode == 0) {
|
if ($console_mode == 0) {
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
?>
|
|
@ -124,7 +124,7 @@ $table->data["all_3"][0] = __('Agents');
|
|||||||
$table->data["all_3"][1] = html_print_select (agents_get_group_agents (0, false, "none", false, true),
|
$table->data["all_3"][1] = html_print_select (agents_get_group_agents (0, false, "none", false, true),
|
||||||
'id_agents[]', 0, false, '', '', true, true);
|
'id_agents[]', 0, false, '', '', true, true);
|
||||||
|
|
||||||
$table->data["all_3"][2] = ' <span style="vertical-align: top;">' . __('Modules') . '</span>';
|
$table->data["all_3"][2] = ' <span style="vertical-align: top;">' . __('Modules') . '</span>';
|
||||||
|
|
||||||
$table->data["all_3"][3] = html_print_select (array (), 'module[]', 0, false, __('None'), -1, true, true);
|
$table->data["all_3"][3] = html_print_select (array (), 'module[]', 0, false, __('None'), -1, true, true);
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ if ($result !== false) {
|
|||||||
|
|
||||||
// PORTS
|
// PORTS
|
||||||
if ($row["id_recon_script"] == 0) {
|
if ($row["id_recon_script"] == 0) {
|
||||||
$data[7] = substr($row["recon_ports"],0,15);
|
$data[7] = substr($row["recon_ports"],0,15);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data[7] = "-";
|
$data[7] = "-";
|
||||||
|
@ -37,6 +37,7 @@ enterprise_include ('godmode/setup/setup_visuals.php');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once ('include/functions_themes.php');
|
require_once ('include/functions_themes.php');
|
||||||
|
require_once ('include/functions_gis.php');
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
ui_print_page_header (__('Visual configuration'), "", false, "", true);
|
ui_print_page_header (__('Visual configuration'), "", false, "", true);
|
||||||
@ -139,9 +140,47 @@ $table->data[20][0] = __('Item title size text') . ui_print_help_tip(__('When th
|
|||||||
$table->data[20][1] = html_print_input_text ('item_title_size_text', $config["item_title_size_text"], '', 3, 3, true);
|
$table->data[20][1] = html_print_input_text ('item_title_size_text', $config["item_title_size_text"], '', 3, 3, true);
|
||||||
|
|
||||||
|
|
||||||
|
$table->data[21][0] = __('GIS Labels') . ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
|
||||||
|
$table->data[21][1] = __('Yes').' '.html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).' ';
|
||||||
|
$table->data[21][1] .= __('No').' '.html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
|
||||||
|
|
||||||
|
|
||||||
|
$listIcons = gis_get_array_list_icons();
|
||||||
|
|
||||||
|
$arraySelectIcon = array();
|
||||||
|
foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index;
|
||||||
|
|
||||||
|
$path = 'images/gis_map/icons/'; //TODO set better method the path
|
||||||
|
|
||||||
|
$table->data[22][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
|
||||||
|
|
||||||
|
$gis_default_icon = $config["gis_default_icon"];
|
||||||
|
|
||||||
|
if ($gis_default_icon == '') {
|
||||||
|
$display_icons = 'none';
|
||||||
|
// Hack to show no icon. Use any given image to fix not found image errors
|
||||||
|
$path_without = "images/spinner.png";
|
||||||
|
$path_default = "images/spinner.png";
|
||||||
|
$path_ok = "images/spinner.png";
|
||||||
|
$path_bad = "images/spinner.png";
|
||||||
|
$path_warning = "images/spinner.png";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$display_icons = '';
|
||||||
|
$path_without = $path . $gis_default_icon . ".default.png";
|
||||||
|
$path_default = $path . $gis_default_icon . ".default.png";
|
||||||
|
$path_ok = $path . $gis_default_icon . ".ok.png";
|
||||||
|
$path_bad = $path . $gis_default_icon . ".bad.png";
|
||||||
|
$path_warning = $path . $gis_default_icon . ".warning.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[22][1] = html_print_select($arraySelectIcon, "gis_default_icon", $gis_default_icon, "changeIcons();", __('None'), '', true) . ' ' . html_print_image($path_ok, true, array("id" => "icon_ok", "style" => "display:".$display_icons.";")) . ' ' . html_print_image($path_bad, true, array("id" => "icon_bad", "style" => "display:".$display_icons.";")) . ' ' . html_print_image($path_warning, true, array("id" => "icon_warning", "style" => "display:".$display_icons.";"));
|
||||||
|
|
||||||
|
|
||||||
echo '<form id="form_setup" method="post">';
|
echo '<form id="form_setup" method="post">';
|
||||||
html_print_input_hidden ('update_config', 1);
|
html_print_input_hidden ('update_config', 1);
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"');
|
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"');
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
@ -784,7 +784,7 @@ function api_set_delete_agent($id, $thrash1, $thrast2, $thrash3) {
|
|||||||
* @param $thrash3 Don't use.
|
* @param $thrash3 Don't use.
|
||||||
*/
|
*/
|
||||||
function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
||||||
|
|
||||||
$where = '';
|
$where = '';
|
||||||
|
|
||||||
if (isset($other['data'][0])){
|
if (isset($other['data'][0])){
|
||||||
@ -795,22 +795,22 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
}
|
}
|
||||||
if (isset($other['data'][1])){
|
if (isset($other['data'][1])){
|
||||||
// Filter by group
|
// Filter by group
|
||||||
if ($other['data'][1] != ""){
|
if ($other['data'][1] != "") {
|
||||||
$where .= " AND id_grupo = " . $other['data'][1];
|
$where .= " AND id_grupo = " . $other['data'][1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($other['data'][3])){
|
if (isset($other['data'][3])) {
|
||||||
// Filter by name
|
// Filter by name
|
||||||
if ($other['data'][3] != ""){
|
if ($other['data'][3] != ""){
|
||||||
$where .= " AND nombre LIKE ('%" . $other['data'][3] . "%')";
|
$where .= " AND nombre LIKE ('%" . $other['data'][3] . "%')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($other['data'][4])){
|
if (isset($other['data'][4])) {
|
||||||
// Filter by policy
|
// Filter by policy
|
||||||
if ($other['data'][4] != ""){
|
if ($other['data'][4] != "") {
|
||||||
$filter_by_policy = enterprise_hook('policies_get_filter_by_agent', array($other['data'][4]));
|
$filter_by_policy = enterprise_hook('policies_get_filter_by_agent', array($other['data'][4]));
|
||||||
if ($filter_by_policy !== ENTERPRISE_NOT_HOOK){
|
if ($filter_by_policy !== ENTERPRISE_NOT_HOOK){
|
||||||
$where .= $filter_by_policy;
|
$where .= $filter_by_policy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -824,9 +824,9 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
$result_agents = array();
|
$result_agents = array();
|
||||||
// Filter by state
|
// Filter by state
|
||||||
$sql = "SELECT id_agente, nombre, direccion, comentarios, tconfig_os.name, url_address FROM tagente, tconfig_os WHERE tagente.id_os = tconfig_os.id_os AND disabled = 0 " . $where;
|
$sql = "SELECT id_agente, nombre, direccion, comentarios, tconfig_os.name, url_address FROM tagente, tconfig_os WHERE tagente.id_os = tconfig_os.id_os AND disabled = 0 " . $where;
|
||||||
|
|
||||||
$all_agents = db_get_all_rows_sql($sql);
|
$all_agents = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
// Filter by status: unknown, warning, critical, without modules
|
// Filter by status: unknown, warning, critical, without modules
|
||||||
if (isset($other['data'][2])){
|
if (isset($other['data'][2])){
|
||||||
if ($other['data'][2] != "") {
|
if ($other['data'][2] != "") {
|
||||||
@ -837,12 +837,12 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
$modules = db_get_all_rows_filter('tagente_modulo', $filter_modules, 'id_agente_modulo');
|
$modules = db_get_all_rows_filter('tagente_modulo', $filter_modules, 'id_agente_modulo');
|
||||||
$result_modules = array();
|
$result_modules = array();
|
||||||
// Skip non init modules
|
// Skip non init modules
|
||||||
foreach ($modules as $module){
|
foreach ($modules as $module) {
|
||||||
if (modules_get_agentmodule_is_init($module['id_agente_modulo'])){
|
if (modules_get_agentmodule_is_init($module['id_agente_modulo'])){
|
||||||
$result_modules[] = $module;
|
$result_modules[] = $module;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Without modules NO_MODULES
|
// Without modules NO_MODULES
|
||||||
if ($other['data'][2] == 'no_modules'){
|
if ($other['data'][2] == 'no_modules'){
|
||||||
if (empty($result_modules) and $other['data'][2] == 'no_modules'){
|
if (empty($result_modules) and $other['data'][2] == 'no_modules'){
|
||||||
@ -853,27 +853,27 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
else {
|
else {
|
||||||
$status = agents_get_status($agent['id_agente'], true);
|
$status = agents_get_status($agent['id_agente'], true);
|
||||||
// Filter by status
|
// Filter by status
|
||||||
switch ($other['data'][2]){
|
switch ($other['data'][2]) {
|
||||||
case 'warning':
|
case 'warning':
|
||||||
if ($status == 2){
|
if ($status == 2) {
|
||||||
$result_agents[] = $agent;
|
$result_agents[] = $agent;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'critical':
|
case 'critical':
|
||||||
if ($status == 1){
|
if ($status == 1) {
|
||||||
$result_agents[] = $agent;
|
$result_agents[] = $agent;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'unknown':
|
case 'unknown':
|
||||||
if ($status == 3){
|
if ($status == 3) {
|
||||||
$result_agents[] = $agent;
|
$result_agents[] = $agent;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'normal':
|
case 'normal':
|
||||||
if ($status == 0){
|
if ($status == 0) {
|
||||||
$result_agents[] = $agent;
|
$result_agents[] = $agent;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -886,13 +886,13 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
$result_agents = $all_agents;
|
$result_agents = $all_agents;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($result_agents) > 0 and $result_agents !== false){
|
if (count($result_agents) > 0 and $result_agents !== false) {
|
||||||
$data = array('type' => 'array', 'data' => $result_agents);
|
$data = array('type' => 'array', 'data' => $result_agents);
|
||||||
|
|
||||||
returnData('csv', $data, $separator);
|
returnData('csv', $data, $separator);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
returnError('error_all_agents', 'No agents retrieved.');
|
returnError('error_all_agents', 'No agents retrieved.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -910,13 +910,15 @@ function api_get_all_agents($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
* @param $thrash3 Don't use.
|
* @param $thrash3 Don't use.
|
||||||
*/
|
*/
|
||||||
function api_get_agent_modules($thrash1, $thrash2, $other, $thrash3) {
|
function api_get_agent_modules($thrash1, $thrash2, $other, $thrash3) {
|
||||||
|
|
||||||
$sql = sprintf("SELECT id_agente, id_agente_modulo, nombre
|
$sql = sprintf("SELECT id_agente, id_agente_modulo, nombre
|
||||||
FROM tagente_modulo WHERE id_agente = %d AND disabled = 0 AND delete_pending = 0", $other['data'][0]);
|
FROM tagente_modulo
|
||||||
|
WHERE id_agente = %d AND disabled = 0
|
||||||
$all_modules = db_get_all_rows_sql($sql);
|
AND delete_pending = 0", $other['data'][0]);
|
||||||
|
|
||||||
if (count($all_modules) > 0 and $all_modules !== false){
|
$all_modules = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
if (count($all_modules) > 0 and $all_modules !== false) {
|
||||||
$data = array('type' => 'array', 'data' => $all_modules);
|
$data = array('type' => 'array', 'data' => $all_modules);
|
||||||
|
|
||||||
returnData('csv', $data, ';');
|
returnData('csv', $data, ';');
|
||||||
@ -940,14 +942,16 @@ function api_get_agent_modules($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
* @param $thrash3 Don't use.
|
* @param $thrash3 Don't use.
|
||||||
*/
|
*/
|
||||||
function api_get_group_agent($thrash1, $thrash2, $other, $thrash3) {
|
function api_get_group_agent($thrash1, $thrash2, $other, $thrash3) {
|
||||||
|
|
||||||
$sql = sprintf("SELECT groups.nombre nombre
|
$sql = sprintf("SELECT groups.nombre nombre
|
||||||
FROM tagente agents, tgrupo groups WHERE id_agente = %d AND agents.disabled = 0 AND groups.disabled = 0
|
FROM tagente agents, tgrupo groups
|
||||||
AND agents.id_grupo = groups.id_grupo", $other['data'][0]);
|
WHERE id_agente = %d AND agents.disabled = 0
|
||||||
|
AND groups.disabled = 0
|
||||||
$group_names = db_get_all_rows_sql($sql);
|
AND agents.id_grupo = groups.id_grupo", $other['data'][0]);
|
||||||
|
|
||||||
if (count($group_names) > 0 and $group_names !== false){
|
$group_names = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
if (count($group_names) > 0 and $group_names !== false) {
|
||||||
$data = array('type' => 'array', 'data' => $group_names);
|
$data = array('type' => 'array', 'data' => $group_names);
|
||||||
|
|
||||||
returnData('csv', $data, ';');
|
returnData('csv', $data, ';');
|
||||||
@ -971,21 +975,23 @@ function api_get_group_agent($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
* @param $thrash3 Don't use.
|
* @param $thrash3 Don't use.
|
||||||
*/
|
*/
|
||||||
function api_get_policies($thrash1, $thrash2, $other, $thrash3) {
|
function api_get_policies($thrash1, $thrash2, $other, $thrash3) {
|
||||||
|
|
||||||
$where = '';
|
$where = '';
|
||||||
|
|
||||||
if ($other['data'][0] != ""){
|
if ($other['data'][0] != "") {
|
||||||
$where .= ' AND id_agent = ' . $other['data'][0];
|
$where .= ' AND id_agent = ' . $other['data'][0];
|
||||||
|
|
||||||
$sql = sprintf("SELECT policy.id, name, id_agent FROM tpolicies policy, tpolicy_agents pol_agents
|
$sql = sprintf("SELECT policy.id, name, id_agent
|
||||||
WHERE policy.id = pol_agents.id %s", $where);
|
FROM tpolicies policy, tpolicy_agents pol_agents
|
||||||
} else {
|
WHERE policy.id = pol_agents.id %s", $where);
|
||||||
$sql = "SELECT id, name FROM tpolicies policy";
|
}
|
||||||
|
else {
|
||||||
|
$sql = "SELECT id, name FROM tpolicies policy";
|
||||||
}
|
}
|
||||||
|
|
||||||
$policies = db_get_all_rows_sql($sql);
|
$policies = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
if (count($policies) > 0 and $policies !== false){
|
if (count($policies) > 0 and $policies !== false) {
|
||||||
$data = array('type' => 'array', 'data' => $policies);
|
$data = array('type' => 'array', 'data' => $policies);
|
||||||
|
|
||||||
returnData('csv', $data, ';');
|
returnData('csv', $data, ';');
|
||||||
@ -1012,14 +1018,15 @@ function api_get_policy_modules($thrash1, $thrash2, $other, $thrash3) {
|
|||||||
|
|
||||||
$where = '';
|
$where = '';
|
||||||
|
|
||||||
if ($other['data'][0] == ""){
|
if ($other['data'][0] == "") {
|
||||||
returnError('error_policy_modules', 'Error retrieving policy modules. Id_policy cannot be left blank.');
|
returnError('error_policy_modules', 'Error retrieving policy modules. Id_policy cannot be left blank.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$policies = enterprise_hook('policies_get_modules_api', array($other['data'][0], $other['data'][1]));
|
$policies = enterprise_hook('policies_get_modules_api',
|
||||||
|
array($other['data'][0], $other['data'][1]));
|
||||||
|
|
||||||
if ($policies === ENTERPRISE_NOT_HOOK){
|
if ($policies === ENTERPRISE_NOT_HOOK) {
|
||||||
returnError('error_policy_modules', 'Error retrieving policy modules.');
|
returnError('error_policy_modules', 'Error retrieving policy modules.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1291,7 +1298,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugin_module_fields = array('id_agente', 'disabled', 'id_module_group', 'min_warning', 'max_warning', 'str_warning',
|
$plugin_module_fields = array('id_agente', 'disabled', 'id_module_group', 'min_warning', 'max_warning', 'str_warning',
|
||||||
'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'history_data', 'ip_target',
|
'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'history_data', 'ip_target',
|
||||||
'tcp_port', 'snmp_community', 'snmp_oid', 'module_interval', 'post_process', 'min', 'max',
|
'tcp_port', 'snmp_community', 'snmp_oid', 'module_interval', 'post_process', 'min', 'max',
|
||||||
'custom_id', 'descripcion', 'id_plugin', 'plugin_user', 'plugin_pass', 'plugin_parameter');
|
'custom_id', 'descripcion', 'id_plugin', 'plugin_user', 'plugin_pass', 'plugin_parameter');
|
||||||
@ -1696,49 +1703,49 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) {
|
|||||||
*/
|
*/
|
||||||
function api_set_new_network_component($id, $thrash1, $other, $thrash2) {
|
function api_set_new_network_component($id, $thrash1, $other, $thrash2) {
|
||||||
|
|
||||||
if ($id == ""){
|
if ($id == "") {
|
||||||
returnError('error_set_new_network_component', __('Error creating network component. Network component name cannot be left blank.'));
|
returnError('error_set_new_network_component', __('Error creating network component. Network component name cannot be left blank.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][0] < 6 or $other['data'][0] > 18){
|
if ($other['data'][0] < 6 or $other['data'][0] > 18) {
|
||||||
returnError('error_set_new_network_component', __('Error creating network component. Incorrect value for Network component type field.'));
|
returnError('error_set_new_network_component', __('Error creating network component. Incorrect value for Network component type field.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][17] == ""){
|
if ($other['data'][17] == "") {
|
||||||
returnError('error_set_new_network_component', __('Error creating network component. Network component group cannot be left blank.'));
|
returnError('error_set_new_network_component', __('Error creating network component. Network component group cannot be left blank.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = array (
|
$values = array (
|
||||||
'description' => $other['data'][1],
|
'description' => $other['data'][1],
|
||||||
'module_interval' => $other['data'][2],
|
'module_interval' => $other['data'][2],
|
||||||
'max' => $other['data'][3],
|
'max' => $other['data'][3],
|
||||||
'min' => $other['data'][4],
|
'min' => $other['data'][4],
|
||||||
'snmp_community' => $other['data'][5],
|
'snmp_community' => $other['data'][5],
|
||||||
'id_module_group' => $other['data'][6],
|
'id_module_group' => $other['data'][6],
|
||||||
'id_modulo' => 2,
|
'id_modulo' => 2,
|
||||||
'max_timeout' => $other['data'][7],
|
'max_timeout' => $other['data'][7],
|
||||||
'history_data' => $other['data'][8],
|
'history_data' => $other['data'][8],
|
||||||
'min_warning' => $other['data'][9],
|
'min_warning' => $other['data'][9],
|
||||||
'max_warning' => $other['data'][10],
|
'max_warning' => $other['data'][10],
|
||||||
'str_warning' => $other['data'][11],
|
'str_warning' => $other['data'][11],
|
||||||
'min_critical' => $other['data'][12],
|
'min_critical' => $other['data'][12],
|
||||||
'max_critical' => $other['data'][13],
|
'max_critical' => $other['data'][13],
|
||||||
'str_critical' => $other['data'][14],
|
'str_critical' => $other['data'][14],
|
||||||
'min_ff_event' => $other['data'][15],
|
'min_ff_event' => $other['data'][15],
|
||||||
'post_process' => $other['data'][16]);
|
'post_process' => $other['data'][16]);
|
||||||
|
|
||||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $id);
|
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $id);
|
||||||
|
|
||||||
if ($name_check !== false){
|
if ($name_check !== false) {
|
||||||
returnError('error_set_new_network_component', __('Error creating network component. This network component already exists.'));
|
returnError('error_set_new_network_component', __('Error creating network component. This network component already exists.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = network_components_create_network_component ($id, $other['data'][0], $other['data'][17], $values);
|
$id = network_components_create_network_component ($id, $other['data'][0], $other['data'][17], $values);
|
||||||
|
|
||||||
if (!$id)
|
if (!$id)
|
||||||
returnError('error_set_new_network_component', 'Error creating network component.');
|
returnError('error_set_new_network_component', 'Error creating network component.');
|
||||||
else
|
else
|
||||||
@ -1764,54 +1771,54 @@ function api_set_new_network_component($id, $thrash1, $other, $thrash2) {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) {
|
function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) {
|
||||||
|
|
||||||
if ($id == ""){
|
if ($id == "") {
|
||||||
returnError('error_set_new_plugin_component', __('Error creating plugin component. Plugin component name cannot be left blank.'));
|
returnError('error_set_new_plugin_component', __('Error creating plugin component. Plugin component name cannot be left blank.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][7] == ""){
|
if ($other['data'][7] == "") {
|
||||||
returnError('error_set_new_plugin_component', __('Error creating plugin component. Incorrect value for Id plugin.'));
|
returnError('error_set_new_plugin_component', __('Error creating plugin component. Incorrect value for Id plugin.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][21] == ""){
|
if ($other['data'][21] == "") {
|
||||||
returnError('error_set_new_plugin_component', __('Error creating plugin component. Plugin component group cannot be left blank.'));
|
returnError('error_set_new_plugin_component', __('Error creating plugin component. Plugin component group cannot be left blank.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = array (
|
$values = array (
|
||||||
'description' => $other['data'][1],
|
'description' => $other['data'][1],
|
||||||
'module_interval' => $other['data'][2],
|
'module_interval' => $other['data'][2],
|
||||||
'max' => $other['data'][3],
|
'max' => $other['data'][3],
|
||||||
'min' => $other['data'][4],
|
'min' => $other['data'][4],
|
||||||
'tcp_port' => $other['data'][5],
|
'tcp_port' => $other['data'][5],
|
||||||
'id_module_group' => $other['data'][6],
|
'id_module_group' => $other['data'][6],
|
||||||
'id_modulo' => 4,
|
'id_modulo' => 4,
|
||||||
'id_plugin' => $other['data'][7],
|
'id_plugin' => $other['data'][7],
|
||||||
'plugin_user' => $other['data'][8],
|
'plugin_user' => $other['data'][8],
|
||||||
'plugin_pass' => $other['data'][9],
|
'plugin_pass' => $other['data'][9],
|
||||||
'plugin_parameter' => $other['data'][10],
|
'plugin_parameter' => $other['data'][10],
|
||||||
'max_timeout' => $other['data'][11],
|
'max_timeout' => $other['data'][11],
|
||||||
'history_data' => $other['data'][12],
|
'history_data' => $other['data'][12],
|
||||||
'min_warning' => $other['data'][13],
|
'min_warning' => $other['data'][13],
|
||||||
'max_warning' => $other['data'][14],
|
'max_warning' => $other['data'][14],
|
||||||
'str_warning' => $other['data'][15],
|
'str_warning' => $other['data'][15],
|
||||||
'min_critical' => $other['data'][16],
|
'min_critical' => $other['data'][16],
|
||||||
'max_critical' => $other['data'][17],
|
'max_critical' => $other['data'][17],
|
||||||
'str_critical' => $other['data'][18],
|
'str_critical' => $other['data'][18],
|
||||||
'min_ff_event' => $other['data'][19],
|
'min_ff_event' => $other['data'][19],
|
||||||
'post_process' => $other['data'][20]);
|
'post_process' => $other['data'][20]);
|
||||||
|
|
||||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $id);
|
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $id);
|
||||||
|
|
||||||
if ($name_check !== false){
|
if ($name_check !== false) {
|
||||||
returnError('error_set_new_plugin_component', __('Error creating plugin component. This plugin component already exists.'));
|
returnError('error_set_new_plugin_component', __('Error creating plugin component. This plugin component already exists.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = network_components_create_network_component ($id, $other['data'][0], $other['data'][21], $values);
|
$id = network_components_create_network_component ($id, $other['data'][0], $other['data'][21], $values);
|
||||||
|
|
||||||
if (!$id)
|
if (!$id)
|
||||||
returnError('error_set_new_plugin_component', 'Error creating plugin component.');
|
returnError('error_set_new_plugin_component', 'Error creating plugin component.');
|
||||||
else
|
else
|
||||||
@ -1838,40 +1845,40 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) {
|
function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) {
|
||||||
|
|
||||||
if ($id == ""){
|
if ($id == "") {
|
||||||
returnError('error_set_new_snmp_component', __('Error creating SNMP component. SNMP component name cannot be left blank.'));
|
returnError('error_set_new_snmp_component', __('Error creating SNMP component. SNMP component name cannot be left blank.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][0] < 15 or $other['data'][0] > 17){
|
if ($other['data'][0] < 15 or $other['data'][0] > 17) {
|
||||||
returnError('error_set_new_snmp_component', __('Error creating SNMP component. Incorrect value for Snmp component type field.'));
|
returnError('error_set_new_snmp_component', __('Error creating SNMP component. Incorrect value for Snmp component type field.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][25] == ""){
|
if ($other['data'][25] == "") {
|
||||||
returnError('error_set_new_snmp_component', __('Error creating SNMP component. Snmp component group cannot be left blank.'));
|
returnError('error_set_new_snmp_component', __('Error creating SNMP component. Snmp component group cannot be left blank.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# SNMP version 3
|
# SNMP version 3
|
||||||
if ($other['data'][16] == "3"){
|
if ($other['data'][16] == "3") {
|
||||||
|
|
||||||
if ($other['data'][22] != "AES" and $other['data'][22] != "DES"){
|
if ($other['data'][22] != "AES" and $other['data'][22] != "DES") {
|
||||||
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_priv_method doesn\'t exists. Set it to \'AES\' or \'DES\'. '));
|
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_priv_method doesn\'t exists. Set it to \'AES\' or \'DES\'. '));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][25] != "authNoPriv" and $other['data'][25] != "authPriv" and $other['data'][25] != "noAuthNoPriv"){
|
if ($other['data'][25] != "authNoPriv" and $other['data'][25] != "authPriv" and $other['data'][25] != "noAuthNoPriv"){
|
||||||
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. '));
|
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. '));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['data'][24] != "MD5" and $other['data'][24] != "SHA"){
|
if ($other['data'][24] != "MD5" and $other['data'][24] != "SHA") {
|
||||||
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. '));
|
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. '));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = array (
|
$values = array (
|
||||||
'description' => $other['data'][1],
|
'description' => $other['data'][1],
|
||||||
'module_interval' => $other['data'][2],
|
'module_interval' => $other['data'][2],
|
||||||
@ -3792,7 +3799,7 @@ function api_get_graph_module_data($id, $thrash1, $other, $thrash2) {
|
|||||||
|
|
||||||
$homeurl = '../';
|
$homeurl = '../';
|
||||||
$ttl = 1;
|
$ttl = 1;
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
$config['flash_charts'] = 0;
|
$config['flash_charts'] = 0;
|
||||||
|
|
||||||
@ -5006,7 +5013,7 @@ function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = nul
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($other['type'] == 'string') {
|
if ($other['type'] == 'string') {
|
||||||
if ($other['data'] != '') {
|
if ($other['data'] != '') {
|
||||||
returnError('error_parameter', 'Error in the parameters.');
|
returnError('error_parameter', 'Error in the parameters.');
|
||||||
@ -5018,18 +5025,20 @@ function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = nul
|
|||||||
}
|
}
|
||||||
else if ($other['type'] == 'array') {
|
else if ($other['type'] == 'array') {
|
||||||
$separator = $other['data'][0];
|
$separator = $other['data'][0];
|
||||||
|
|
||||||
$filterString = otherParameter2Filter($other);
|
$filterString = otherParameter2Filter($other);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dataRows = db_get_all_rows_filter('tevento', $filterString);
|
$dataRows = db_get_all_rows_filter('tevento', $filterString);
|
||||||
$last_error = error_get_last();
|
$last_error = error_get_last();
|
||||||
if (!empty($last_error)) {
|
if (empty($dataRows)) {
|
||||||
returnError('ERROR_API_PANDORAFMS', $returnType);
|
if (!empty($last_error)) {
|
||||||
|
returnError('ERROR_API_PANDORAFMS', $returnType);
|
||||||
return;
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['type'] = 'array';
|
$data['type'] = 'array';
|
||||||
$data['data'] = $dataRows;
|
$data['data'] = $dataRows;
|
||||||
|
|
||||||
|
@ -232,6 +232,9 @@ function config_update_config () {
|
|||||||
config_update_value ('module_size_text_medium', get_parameter('module_size_text_medium'));
|
config_update_value ('module_size_text_medium', get_parameter('module_size_text_medium'));
|
||||||
config_update_value ('description_size_text', get_parameter('description_size_text'));
|
config_update_value ('description_size_text', get_parameter('description_size_text'));
|
||||||
config_update_value ('item_title_size_text', get_parameter('item_title_size_text'));
|
config_update_value ('item_title_size_text', get_parameter('item_title_size_text'));
|
||||||
|
config_update_value ('gis_label', get_parameter ('gis_label'));
|
||||||
|
config_update_value ('gis_default_icon', get_parameter ('gis_default_icon'));
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
break;
|
break;
|
||||||
case 'enterprise/godmode/setup/setup_history':
|
case 'enterprise/godmode/setup/setup_history':
|
||||||
@ -271,13 +274,13 @@ function config_process_config () {
|
|||||||
|
|
||||||
/* Compatibility fix */
|
/* Compatibility fix */
|
||||||
foreach ($configs as $c) {
|
foreach ($configs as $c) {
|
||||||
$config[$c['token']] = $c['value'];
|
$config[$c['token']] = $c['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset ($config['language'])) {
|
if (!isset ($config['language'])) {
|
||||||
config_update_value ('language', 'en');
|
config_update_value ('language', 'en');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset ($config['homeurl']) && $config['homeurl'][0] != '/') {
|
if (isset ($config['homeurl']) && $config['homeurl'][0] != '/') {
|
||||||
$config['homeurl'] = '/'.$config['homeurl'];
|
$config['homeurl'] = '/'.$config['homeurl'];
|
||||||
}
|
}
|
||||||
@ -703,7 +706,15 @@ function config_process_config () {
|
|||||||
if (!isset($config['item_title_size_text'])) {
|
if (!isset($config['item_title_size_text'])) {
|
||||||
config_update_value ('item_title_size_text', 45);
|
config_update_value ('item_title_size_text', 45);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($config['gis_label'])) {
|
||||||
|
config_update_value ('gis_label', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($config['gis_default_icon'])) {
|
||||||
|
config_update_value ('gis_default_icon', "marker");
|
||||||
|
}
|
||||||
|
|
||||||
/* Finally, check if any value was overwritten in a form */
|
/* Finally, check if any value was overwritten in a form */
|
||||||
config_update_config();
|
config_update_config();
|
||||||
}
|
}
|
||||||
@ -713,7 +724,7 @@ function config_check () {
|
|||||||
|
|
||||||
// At this first version I'm passing errors using session variables, because the error management
|
// At this first version I'm passing errors using session variables, because the error management
|
||||||
// is done by an AJAX request. Better solutions could be implemented in the future :-)
|
// is done by an AJAX request. Better solutions could be implemented in the future :-)
|
||||||
|
|
||||||
// Check default password for "admin"
|
// Check default password for "admin"
|
||||||
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
||||||
if ($is_admin) {
|
if ($is_admin) {
|
||||||
|
@ -36,7 +36,6 @@ function gis_add_parent_lines() {
|
|||||||
js_refreshParentLines('" . __('Hierarchy of agents') . "');
|
js_refreshParentLines('" . __('Hierarchy of agents') . "');
|
||||||
});";
|
});";
|
||||||
echo "</script>";
|
echo "</script>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -358,6 +357,10 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null) {
|
|||||||
|
|
||||||
function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $width = 20,
|
function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $width = 20,
|
||||||
$height = 20, $point_id = '', $status = -1, $type_string = '', $idParent = 0) {
|
$height = 20, $point_id = '', $status = -1, $type_string = '', $idParent = 0) {
|
||||||
|
|
||||||
|
global $config;
|
||||||
|
if (!$config['gis_label'])
|
||||||
|
$pointName = '';
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (
|
$(document).ready (
|
||||||
@ -458,10 +461,18 @@ function gis_get_layers($idMap) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gis_get_agent_icon_map($idAgent, $state = false, $status = null) {
|
function gis_get_agent_icon_map($idAgent, $state = false, $status = null) {
|
||||||
$row = db_get_row_sql('SELECT id_grupo, icon_path FROM tagente WHERE id_agente = ' . $idAgent);
|
global $config;
|
||||||
|
|
||||||
|
$row = db_get_row_sql('SELECT id_grupo, icon_path
|
||||||
|
FROM tagente WHERE id_agente = ' . $idAgent);
|
||||||
|
|
||||||
if (($row['icon_path'] === null) || (strlen($row['icon_path']) == 0)) {
|
if (($row['icon_path'] === null) || (strlen($row['icon_path']) == 0)) {
|
||||||
$icon = "images/groups_small/" . groups_get_icon($row['id_grupo']);
|
if ($config['gis_default_icon'] != "") {
|
||||||
|
$icon = "images/gis_map/icons/" . $config['gis_default_icon'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$icon = "images/groups_small/" . groups_get_icon($row['id_grupo']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$icon = "images/gis_map/icons/" . $row['icon_path'];
|
$icon = "images/gis_map/icons/" . $row['icon_path'];
|
||||||
|
@ -122,13 +122,13 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
|||||||
var option = {
|
var option = {
|
||||||
controls: controlsList,
|
controls: controlsList,
|
||||||
projection: new OpenLayers.Projection("EPSG:900913"),
|
projection: new OpenLayers.Projection("EPSG:900913"),
|
||||||
displayProjection: new OpenLayers.Projection("EPSG:4326"),
|
displayProjection: new OpenLayers.Projection("EPSG:4326"),
|
||||||
units: "m",
|
units: "m",
|
||||||
numZoomLevels: 18,
|
numZoomLevels: 18,
|
||||||
maxResolution: 156543.0339,
|
maxResolution: 156543.0339,
|
||||||
maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508.34)
|
maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508.34)
|
||||||
};
|
};
|
||||||
|
|
||||||
map = new OpenLayers.Map(id_div, option);
|
map = new OpenLayers.Map(id_div, option);
|
||||||
|
|
||||||
var baseLayer = null;
|
var baseLayer = null;
|
||||||
@ -203,10 +203,10 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
|||||||
),
|
),
|
||||||
new OpenLayers.Size(objBaseLayers[baselayerIndex]['image_width'], objBaseLayers[baselayerIndex]['image_height']),
|
new OpenLayers.Size(objBaseLayers[baselayerIndex]['image_width'], objBaseLayers[baselayerIndex]['image_height']),
|
||||||
{projection: new OpenLayers.Projection("EPSG:4326"),
|
{projection: new OpenLayers.Projection("EPSG:4326"),
|
||||||
numZoomLevels: objBaseLayers[baselayerIndex]['num_zoom_levels']
|
numZoomLevels: objBaseLayers[baselayerIndex]['num_zoom_levels']
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
map.addLayer(baseLayer);
|
map.addLayer(baseLayer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
|||||||
|
|
||||||
var lonLat = new OpenLayers.LonLat(center_longitude, center_latitude)
|
var lonLat = new OpenLayers.LonLat(center_longitude, center_latitude)
|
||||||
.transform(map.displayProjection, map.getProjectionObject());
|
.transform(map.displayProjection, map.getProjectionObject());
|
||||||
|
|
||||||
map.setCenter (lonLat, initial_zoom);
|
map.setCenter (lonLat, initial_zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,10 +500,10 @@ function showHideLayer(name, action) {
|
|||||||
function js_addAgentPoint(layerName, pointName, lon, lat, id, type_string, statusAgent, idParent) {
|
function js_addAgentPoint(layerName, pointName, lon, lat, id, type_string, statusAgent, idParent) {
|
||||||
var point = new OpenLayers.Geometry.Point(lon, lat)
|
var point = new OpenLayers.Geometry.Point(lon, lat)
|
||||||
.transform(map.displayProjection, map.getProjectionObject());
|
.transform(map.displayProjection, map.getProjectionObject());
|
||||||
|
|
||||||
var layer = map.getLayersByName(layerName);
|
var layer = map.getLayersByName(layerName);
|
||||||
layer = layer[0];
|
layer = layer[0];
|
||||||
|
|
||||||
feature = new OpenLayers.Feature.Vector(point,{id_parent: idParent, status: statusAgent, nombre: pointName, id: id, type: type_string, long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject()) });
|
feature = new OpenLayers.Feature.Vector(point,{id_parent: idParent, status: statusAgent, nombre: pointName, id: id, type: type_string, long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject()) });
|
||||||
|
|
||||||
if (isHideFeatureByStatus(statusAgent)) {
|
if (isHideFeatureByStatus(statusAgent)) {
|
||||||
|
@ -31,7 +31,7 @@ class ViewAgents {
|
|||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->system = $system;
|
$this->system = $system;
|
||||||
$this->filterText = $this->system->getRequest('filter_text', '');
|
$this->filterText = $this->system->getRequest('filter_text', '');
|
||||||
$this->filterGroup = $this->system->getRequest('filter_group', 0);;
|
$this->filterGroup = $this->system->getRequest('filter_group', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function showForm() {
|
private function showForm() {
|
||||||
@ -48,7 +48,7 @@ class ViewAgents {
|
|||||||
public function show() {
|
public function show() {
|
||||||
$this->showForm();
|
$this->showForm();
|
||||||
|
|
||||||
// Show only selected groups
|
// Show only selected groups
|
||||||
if ($this->filterGroup > 0) {
|
if ($this->filterGroup > 0) {
|
||||||
$groups = $this->filterGroup;
|
$groups = $this->filterGroup;
|
||||||
$agent_names = agents_get_group_agents ($this->filterGroup, array('string' => $this->filterText), "upper");
|
$agent_names = agents_get_group_agents ($this->filterGroup, array('string' => $this->filterText), "upper");
|
||||||
@ -286,12 +286,30 @@ class ViewAgent {
|
|||||||
|
|
||||||
if ($module["id_tipo_modulo"] == 24) { // log4x
|
if ($module["id_tipo_modulo"] == 24) { // log4x
|
||||||
switch($module["datos"]) {
|
switch($module["datos"]) {
|
||||||
case 10: $salida = "TRACE"; $style="font-weight:bold; color:darkgreen;"; break;
|
case 10:
|
||||||
case 20: $salida = "DEBUG"; $style="font-weight:bold; color:darkgreen;"; break;
|
$salida = "TRACE";
|
||||||
case 30: $salida = "INFO"; $style="font-weight:bold; color:darkgreen;"; break;
|
$style="font-weight:bold; color:darkgreen;";
|
||||||
case 40: $salida = "WARN"; $style="font-weight:bold; color:darkorange;"; break;
|
break;
|
||||||
case 50: $salida = "ERROR"; $style="font-weight:bold; color:red;"; break;
|
case 20:
|
||||||
case 60: $salida = "FATAL"; $style="font-weight:bold; color:red;"; break;
|
$salida = "DEBUG";
|
||||||
|
$style="font-weight:bold; color:darkgreen;";
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
$salida = "INFO";
|
||||||
|
$style="font-weight:bold; color:darkgreen;";
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
$salida = "WARN";
|
||||||
|
$style="font-weight:bold; color:darkorange;";
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
$salida = "ERROR";
|
||||||
|
$style="font-weight:bold; color:red;";
|
||||||
|
break;
|
||||||
|
case 60:
|
||||||
|
$salida = "FATAL";
|
||||||
|
$style="font-weight:bold; color:red;";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$salida = "<span style='$style'>$salida</span>";
|
$salida = "<span style='$style'>$salida</span>";
|
||||||
}
|
}
|
||||||
@ -428,10 +446,10 @@ class viewGraph {
|
|||||||
|
|
||||||
$columns = array(
|
$columns = array(
|
||||||
|
|
||||||
//"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
|
//"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
|
||||||
"Sev" => array("severity", "format_data", "align" => "center", "width" => "70px"),
|
"Sev" => array("severity", "format_data", "align" => "center", "width" => "70px"),
|
||||||
"Message" => array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
|
"Message" => array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
|
||||||
"StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%")
|
"StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (preg_match ("/string/", $moduletype_name)) {
|
else if (preg_match ("/string/", $moduletype_name)) {
|
||||||
@ -439,9 +457,9 @@ class viewGraph {
|
|||||||
WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
||||||
|
|
||||||
$columns = array(
|
$columns = array(
|
||||||
//"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center"),
|
//"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center"),
|
||||||
"Data" => array("datos", "format_data", "align" => "center"),
|
"Data" => array("datos", "format_data", "align" => "center"),
|
||||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -450,8 +468,8 @@ class viewGraph {
|
|||||||
ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
||||||
|
|
||||||
$columns = array(
|
$columns = array(
|
||||||
"Data" => array("datos", "format_data", "align" => "center"),
|
"Data" => array("datos", "format_data", "align" => "center"),
|
||||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ if (is_ajax ()) {
|
|||||||
echo '';
|
echo '';
|
||||||
else
|
else
|
||||||
echo ui_print_truncate_text(strip_tags($event["user_comment"]));
|
echo ui_print_truncate_text(strip_tags($event["user_comment"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ $url = "index.php?sec=eventos&sec2=operation/events/events&search=" .
|
|||||||
if ($config["pure"] == 0) {
|
if ($config["pure"] == 0) {
|
||||||
$pss = get_user_info($config['id_user']);
|
$pss = get_user_info($config['id_user']);
|
||||||
$hashup = md5($config['id_user'] . $pss['password']);
|
$hashup = md5($config['id_user'] . $pss['password']);
|
||||||
|
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
$fullscreen['active'] = false;
|
$fullscreen['active'] = false;
|
||||||
$fullscreen['text'] = '<a href="'.$url.'&pure=1">' .
|
$fullscreen['text'] = '<a href="'.$url.'&pure=1">' .
|
||||||
@ -279,7 +279,7 @@ if ($config["pure"] == 0) {
|
|||||||
|
|
||||||
function openURLTagWindow(url) {
|
function openURLTagWindow(url) {
|
||||||
window.open(url, '','width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no');
|
window.open(url, '','width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no');
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
@ -617,15 +617,15 @@ $(document).ready( function() {
|
|||||||
current_row_id = row_id_name + "-" + row_id_number;
|
current_row_id = row_id_name + "-" + row_id_number;
|
||||||
selected_row_id = row_id_name + "-" + row_id_number + "-0";
|
selected_row_id = row_id_name + "-" + row_id_number + "-0";
|
||||||
next_row_id = row_id_name + '-' + row_id_number_next;
|
next_row_id = row_id_name + '-' + row_id_number_next;
|
||||||
|
|
||||||
$("#"+previous_row_id).css('display', 'none');
|
$("#"+previous_row_id).css('display', 'none');
|
||||||
$("#"+current_row_id).css('display', 'none');
|
$("#"+current_row_id).css('display', 'none');
|
||||||
$("#"+selected_row_id).css('display', 'none');
|
$("#"+selected_row_id).css('display', 'none');
|
||||||
$("#"+next_row_id).css('display', 'none');
|
$("#"+next_row_id).css('display', 'none');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
} // Add comment
|
} // Add comment
|
||||||
else if (select_validate == 3){
|
else if (select_validate == 3){
|
||||||
// Get event comment
|
// Get event comment
|
||||||
|
@ -99,21 +99,21 @@ if (is_ajax()) {
|
|||||||
$values['tag'] = get_parameter('tag');
|
$values['tag'] = get_parameter('tag');
|
||||||
$values['filter_only_alert'] = get_parameter('filter_only_alert');
|
$values['filter_only_alert'] = get_parameter('filter_only_alert');
|
||||||
$values['id_group_filter'] = get_parameter('id_group_filter');
|
$values['id_group_filter'] = get_parameter('id_group_filter');
|
||||||
|
|
||||||
$result = db_process_sql_update('tevent_filter', $values, array('id_filter' => $id));
|
$result = db_process_sql_update('tevent_filter', $values, array('id_filter' => $id));
|
||||||
|
|
||||||
if ($result === false){
|
if ($result === false){
|
||||||
echo 'error';
|
echo 'error';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo 'ok';
|
echo 'ok';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($get_event_filters){
|
if ($get_event_filters) {
|
||||||
$event_filter = events_get_event_filter_select();
|
$event_filter = events_get_event_filter_select();
|
||||||
|
|
||||||
echo json_encode($event_filter);
|
echo json_encode($event_filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -433,12 +433,14 @@ if ($group_rep == 0) {
|
|||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM tevento
|
FROM tevento
|
||||||
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
|
WHERE 1=1 ".$sql_post."
|
||||||
|
ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM tevento
|
FROM tevento
|
||||||
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$pagination." OFFSET ".$offset;
|
WHERE 1=1 ".$sql_post."
|
||||||
|
ORDER BY utimestamp DESC LIMIT ".$pagination." OFFSET ".$offset;
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$set = array();
|
$set = array();
|
||||||
@ -446,7 +448,8 @@ if ($group_rep == 0) {
|
|||||||
$set['offset'] = $offset;
|
$set['offset'] = $offset;
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM tevento
|
FROM tevento
|
||||||
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC";
|
WHERE 1=1 ".$sql_post."
|
||||||
|
ORDER BY utimestamp DESC";
|
||||||
$sql = oracle_recode_query ($sql, $set);
|
$sql = oracle_recode_query ($sql, $set);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -455,8 +458,11 @@ else {
|
|||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
db_process_sql ('SET group_concat_max_len = 9999999');
|
db_process_sql ('SET group_concat_max_len = 9999999');
|
||||||
$sql = "SELECT *, MAX(id_evento) AS id_evento, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
||||||
|
MIN(estado) AS min_estado,
|
||||||
|
MAX(estado) AS max_estado,
|
||||||
|
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||||
FROM tevento
|
FROM tevento
|
||||||
WHERE 1=1 ".$sql_post."
|
WHERE 1=1 ".$sql_post."
|
||||||
GROUP BY evento, id_agentmodule
|
GROUP BY evento, id_agentmodule
|
||||||
|
@ -51,12 +51,9 @@ $tag = get_parameter("tag", "");
|
|||||||
$filter = array ();
|
$filter = array ();
|
||||||
if ($ev_group > 1)
|
if ($ev_group > 1)
|
||||||
$filter['id_grupo'] = $ev_group;
|
$filter['id_grupo'] = $ev_group;
|
||||||
/*if ($status == 1)
|
|
||||||
$filter['estado'] = 1;
|
|
||||||
if ($status == 0)
|
|
||||||
$filter['estado'] = 0; */
|
|
||||||
$filter_state = '';
|
$filter_state = '';
|
||||||
switch($status) {
|
switch ($status) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
@ -65,14 +62,14 @@ switch($status) {
|
|||||||
case 3:
|
case 3:
|
||||||
$filter_state = " AND (estado = 0 OR estado = 2)";
|
$filter_state = " AND (estado = 0 OR estado = 2)";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($search != "")
|
if ($search != "")
|
||||||
$filter[] = 'evento LIKE "%'.io_safe_input($search).'%"';
|
$filter[] = 'evento LIKE "%'.io_safe_input($search).'%"';
|
||||||
if (($event_type != "all") OR ($event_type != 0))
|
if (($event_type != "all") OR ($event_type != 0))
|
||||||
$filter['event_type'] = $event_type;
|
$filter['event_type'] = $event_type;
|
||||||
if ($severity != -1)
|
if ($severity != -1)
|
||||||
$filter[] = 'criticity >= '.$severity;
|
$filter[] = 'criticity >= '.$severity;
|
||||||
|
|
||||||
if ($id_agent == -2) {
|
if ($id_agent == -2) {
|
||||||
$text_agent = (string) get_parameter("text_agent", __("All"));
|
$text_agent = (string) get_parameter("text_agent", __("All"));
|
||||||
|
|
||||||
@ -103,14 +100,14 @@ else {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($id_agent != -1)
|
if ($id_agent != -1)
|
||||||
$filter['id_agente'] = $id_agent;
|
$filter['id_agente'] = $id_agent;
|
||||||
|
|
||||||
if ($id_event != -1)
|
if ($id_event != -1)
|
||||||
$filter['id_evento'] = $id_event;
|
$filter['id_evento'] = $id_event;
|
||||||
|
|
||||||
$timestamp_filter = '';
|
$timestamp_filter = '';
|
||||||
if ($event_view_hr > 0) {
|
if ($event_view_hr > 0) {
|
||||||
$unixtime = get_system_time () - ($event_view_hr * SECONDS_1HOUR); //Put hours in seconds
|
$unixtime = get_system_time () - ($event_view_hr * SECONDS_1HOUR); //Put hours in seconds
|
||||||
@ -138,7 +135,7 @@ echo chr (13);
|
|||||||
$fields = array ('id_grupo', 'id_agente', 'evento', 'estado', 'id_usuario',
|
$fields = array ('id_grupo', 'id_agente', 'evento', 'estado', 'id_usuario',
|
||||||
'event_type', 'criticity', 'timestamp');
|
'event_type', 'criticity', 'timestamp');
|
||||||
|
|
||||||
$sql = db_get_all_rows_filter ('tevento', $filter, $fields, 'AND', true, true);
|
$sql = db_get_all_rows_filter('tevento', $filter, $fields, 'AND', true, true);
|
||||||
|
|
||||||
// If filter is empty and there are others filters not empty append "WHERE" clause
|
// If filter is empty and there are others filters not empty append "WHERE" clause
|
||||||
if (empty($filter) and (!empty($filter_state) or !empty($timestamp_filter)))
|
if (empty($filter) and (!empty($filter_state) or !empty($timestamp_filter)))
|
||||||
@ -170,5 +167,4 @@ while ($event = db_get_all_row_by_steps_sql($new, $result, $sql)) {
|
|||||||
echo $event["criticity"];
|
echo $event["criticity"];
|
||||||
echo chr (13);
|
echo chr (13);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
@ -18,6 +18,8 @@ require_once ("include/config.php");
|
|||||||
|
|
||||||
check_login ();
|
check_login ();
|
||||||
|
|
||||||
|
global $config;
|
||||||
|
|
||||||
require_once ('include/functions_gis.php');
|
require_once ('include/functions_gis.php');
|
||||||
require_once ('include/functions_ui.php');
|
require_once ('include/functions_ui.php');
|
||||||
require_once ('include/functions_agents.php');
|
require_once ('include/functions_agents.php');
|
||||||
@ -30,7 +32,8 @@ switch ($opt) {
|
|||||||
$returnJSON['correct'] = 1;
|
$returnJSON['correct'] = 1;
|
||||||
$idConection = get_parameter('id_conection');
|
$idConection = get_parameter('id_conection');
|
||||||
|
|
||||||
$row = db_get_row_filter('tgis_map_connection', array('id_tmap_connection' => $idConection));
|
$row = db_get_row_filter('tgis_map_connection',
|
||||||
|
array('id_tmap_connection' => $idConection));
|
||||||
|
|
||||||
$returnJSON['content'] = $row;
|
$returnJSON['content'] = $row;
|
||||||
|
|
||||||
@ -113,6 +116,9 @@ switch ($opt) {
|
|||||||
foreach ($agentsGISStatus as $row) {
|
foreach ($agentsGISStatus as $row) {
|
||||||
$status = agents_get_status($row['tagente_id_agente']);
|
$status = agents_get_status($row['tagente_id_agente']);
|
||||||
|
|
||||||
|
if (!$config['gis_label'])
|
||||||
|
$row['nombre'] = '';
|
||||||
|
|
||||||
$agents[$row['tagente_id_agente']] = array(
|
$agents[$row['tagente_id_agente']] = array(
|
||||||
'icon_path' => gis_get_agent_icon_map($row['tagente_id_agente'], true, $status),
|
'icon_path' => gis_get_agent_icon_map($row['tagente_id_agente'], true, $status),
|
||||||
'name' => $row['nombre'],
|
'name' => $row['nombre'],
|
||||||
@ -158,19 +164,19 @@ switch ($opt) {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $agentDataGIS['stored_longitude'] . ', ' . $agentDataGIS['stored_latitude'] . ', ' . $agentDataGIS['stored_altitude'] . ') <br />';
|
$returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $agentDataGIS['stored_longitude'] . ', ' . $agentDataGIS['stored_latitude'] . ', ' . $agentDataGIS['stored_altitude'] . ') <br />';
|
||||||
}
|
}
|
||||||
$agent_ip_address = agents_get_address ($id_agente);
|
$agent_ip_address = agents_get_address ($id_agente);
|
||||||
if ($agent_ip_address || $agent_ip_address != '') {
|
if ($agent_ip_address || $agent_ip_address != '') {
|
||||||
$returnJSON['content'] .= __('IP Address').': '.agents_get_address ($id_agente).'<br />';
|
$returnJSON['content'] .= __('IP Address').': '.agents_get_address ($id_agente).'<br />';
|
||||||
}
|
}
|
||||||
$returnJSON['content'] .= __('OS').': ' . ui_print_os_icon($row['id_os'], true, true);
|
$returnJSON['content'] .= __('OS').': ' . ui_print_os_icon($row['id_os'], true, true);
|
||||||
|
|
||||||
$osversion_offset = strlen($row["os_version"]);
|
$osversion_offset = strlen($row["os_version"]);
|
||||||
if ($osversion_offset > 15) {
|
if ($osversion_offset > 15) {
|
||||||
$osversion_offset = $osversion_offset - 15;
|
$osversion_offset = $osversion_offset - 15;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$osversion_offset = 0;
|
$osversion_offset = 0;
|
||||||
}
|
}
|
||||||
$returnJSON['content'] .= ' ( <i><span title="'.$row["os_version"].'">'.substr($row["os_version"],$osversion_offset,15).'</span></i>)<br />';
|
$returnJSON['content'] .= ' ( <i><span title="'.$row["os_version"].'">'.substr($row["os_version"],$osversion_offset,15).'</span></i>)<br />';
|
||||||
$agent_description = $row['comentarios'];
|
$agent_description = $row['comentarios'];
|
||||||
@ -181,7 +187,7 @@ switch ($opt) {
|
|||||||
$returnJSON['content'] .= __('Agent Version').': '.$row["agent_version"].'<br />';
|
$returnJSON['content'] .= __('Agent Version').': '.$row["agent_version"].'<br />';
|
||||||
$returnJSON['content'] .= __('Last contact') . ": ";
|
$returnJSON['content'] .= __('Last contact') . ": ";
|
||||||
if ($row["ultimo_contacto_remoto"] == "01-01-1970 00:00:00") {
|
if ($row["ultimo_contacto_remoto"] == "01-01-1970 00:00:00") {
|
||||||
$returnJSON['content'] .=__('Never') ." <br />";
|
$returnJSON['content'] .=__('Never') ." <br />";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$returnJSON['content'] .= $row["ultimo_contacto_remoto"] ." <br />";
|
$returnJSON['content'] .= $row["ultimo_contacto_remoto"] ." <br />";
|
||||||
@ -189,13 +195,12 @@ switch ($opt) {
|
|||||||
$returnJSON['content'] .= __('Remote').': '. $row["ultimo_contacto"];
|
$returnJSON['content'] .= __('Remote').': '. $row["ultimo_contacto"];
|
||||||
|
|
||||||
echo json_encode($returnJSON);
|
echo json_encode($returnJSON);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'get_map_connection_data':
|
case 'get_map_connection_data':
|
||||||
$idConnection = get_parameter('id_connection');
|
$idConnection = get_parameter('id_connection');
|
||||||
|
|
||||||
$returnJSON = array();
|
$returnJSON = array();
|
||||||
|
|
||||||
$returnJSON['correct'] = 1;
|
$returnJSON['correct'] = 1;
|
||||||
|
|
||||||
$returnJSON['content'] = db_get_row_sql('SELECT * FROM tgis_map_connection WHERE id_tmap_connection = ' . $idConnection);
|
$returnJSON['content'] = db_get_row_sql('SELECT * FROM tgis_map_connection WHERE id_tmap_connection = ' . $idConnection);
|
||||||
|
@ -43,7 +43,7 @@ if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
|||||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR"));
|
$own_groups = array_keys(users_get_groups($config['id_user'], "IR"));
|
||||||
else
|
else
|
||||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
|
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
|
||||||
|
|
||||||
if ($maps !== false) {
|
if ($maps !== false) {
|
||||||
foreach ($maps as $map) {
|
foreach ($maps as $map) {
|
||||||
if ($rowPair)
|
if ($rowPair)
|
||||||
|
@ -98,14 +98,15 @@ else {
|
|||||||
if (check_acl ($config["id_user"], $map['group_id'], "IW"))
|
if (check_acl ($config["id_user"], $map['group_id'], "IW"))
|
||||||
$buttons [] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
|
$buttons [] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
|
||||||
|
|
||||||
$buttonsString = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3">' . html_print_image("images/bricks.png", true, array("class" => "top", "border" => '0')) . ' Agent - test_gis1</a></li></ul></div><div id="menu_tab"><ul class="mn"><li class="nomn"><a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&id_agente=3">' . html_print_image("images/setup.png", true, array("class" => "top", "title" => "Manage", "border" => "0", "width" => "16", "title" => "Manage")) . ' </a></li><li class="nomn_high"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3">' . html_print_image("images/monitor.png", true, array("class" => "top", "title" => "Main", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3&tab=data">' . html_print_image("images/lightbulb.png", true, array("class" => "top", "title" => "Data", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3&tab=alert">' . html_print_image("images/bell.png", true, array("class" => "top", "title" => "Alerts", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=3">' . html_print_image("images/images.png", true, array("class" => "top", "title" => "S.L.A.", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=2">' . html_print_image("images/agents_group.png", true, array("class" => "top", "title" => "Group", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente=3">' . html_print_image("images/page_white_text.png", true, array("class" => "top", "title" => "Inventory", "border" => "0", "width" => "16")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente=3">' . html_print_image("images/world.png", array("class" => "top", "title" => "GIS data", "border" => "0")) . ' </a>';
|
$buttonsString = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3">' .
|
||||||
|
html_print_image("images/bricks.png", true, array("class" => "top", "border" => '0')) . ' Agent - test_gis1</a></li></ul></div><div id="menu_tab"><ul class="mn"><li class="nomn"><a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&id_agente=3">' . html_print_image("images/setup.png", true, array("class" => "top", "title" => "Manage", "border" => "0", "width" => "16", "title" => "Manage")) . ' </a></li><li class="nomn_high"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3">' . html_print_image("images/monitor.png", true, array("class" => "top", "title" => "Main", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3&tab=data">' . html_print_image("images/lightbulb.png", true, array("class" => "top", "title" => "Data", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=3&tab=alert">' . html_print_image("images/bell.png", true, array("class" => "top", "title" => "Alerts", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=3">' . html_print_image("images/images.png", true, array("class" => "top", "title" => "S.L.A.", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=2">' . html_print_image("images/agents_group.png", true, array("class" => "top", "title" => "Group", "border" => "0")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente=3">' . html_print_image("images/page_white_text.png", true, array("class" => "top", "title" => "Inventory", "border" => "0", "width" => "16")) . ' </a></li><li class="nomn"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente=3">' . html_print_image("images/world.png", array("class" => "top", "title" => "GIS data", "border" => "0")) . ' </a>';
|
||||||
|
|
||||||
$times = array(
|
$times = array(
|
||||||
5 => __('5 seconds'),
|
5 => __('5 seconds'),
|
||||||
10 => __('10 seconds'),
|
10 => __('10 seconds'),
|
||||||
30 => __('30 seconds'),
|
30 => __('30 seconds'),
|
||||||
SECONDS_1MINUTE => __('1 minute'),
|
SECONDS_1MINUTE => __('1 minute'),
|
||||||
SECONDS_2MINUTE => __('2 minutes'),
|
SECONDS_2MINUTES => __('2 minutes'),
|
||||||
SECONDS_5MINUTES => __('5 minutes'),
|
SECONDS_5MINUTES => __('5 minutes'),
|
||||||
SECONDS_10MINUTES => __('10 minutes'),
|
SECONDS_10MINUTES => __('10 minutes'),
|
||||||
SECONDS_1HOUR => __('1 hour'),
|
SECONDS_1HOUR => __('1 hour'),
|
||||||
@ -178,10 +179,12 @@ if ($layers != false) {
|
|||||||
$timestampLastOperation = db_get_value_sql("SELECT UNIX_TIMESTAMP()");
|
$timestampLastOperation = db_get_value_sql("SELECT UNIX_TIMESTAMP()");
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$timestampLastOperation = db_get_value_sql("SELECT ceil(date_part('epoch', CURRENT_TIMESTAMP))");
|
$timestampLastOperation = db_get_value_sql(
|
||||||
|
"SELECT ceil(date_part('epoch', CURRENT_TIMESTAMP))");
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$timestampLastOperation = db_get_value_sql("SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (86400)) from dual");
|
$timestampLastOperation = db_get_value_sql(
|
||||||
|
"SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (86400)) FROM dual");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,8 @@ echo "<script type=\"text/javascript\">
|
|||||||
$('#add_note').slideDown('slow');
|
$('#add_note').slideDown('slow');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});</script>";
|
});
|
||||||
|
</script>";
|
||||||
|
|
||||||
if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["insert_form"]
|
if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["insert_form"]
|
||||||
ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
|
ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
|
||||||
@ -233,21 +234,31 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '<table cellpadding="4" cellspacing="4" class="databox" width="98%">';
|
echo '<table cellpadding="4" cellspacing="4" class="databox" width="98%">';
|
||||||
echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class="datos">';
|
echo '<tr>
|
||||||
|
<td class="datos"><b>'.__('Incident').'</b></td>
|
||||||
|
<td colspan="3" class="datos">';
|
||||||
|
|
||||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR
|
||||||
|
($usuario == $config["id_user"])) {
|
||||||
html_print_input_text ("titulo", $titulo,'', 70);
|
html_print_input_text ("titulo", $titulo,'', 70);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
|
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</td></tr>';
|
echo '</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
echo '<tr><td class="datos2"><b>'.__('Opened at').'</b></td><td class="datos2"><i>'.date ($config['date_format'], $inicio).'</i></td>';
|
echo '<tr>
|
||||||
echo '<td class="datos2"><b>'.__('Updated at').'</b><td class="datos2"><i>'.date ($config['date_format'], $actualizacion).'</i></td></tr>';
|
<td class="datos2"><b>'.__('Opened at').'</b></td>
|
||||||
|
<td class="datos2"><i>'.date ($config['date_format'], $inicio).'</i></td>
|
||||||
|
<td class="datos2"><b>'.__('Updated at').'</b></td>
|
||||||
|
<td class="datos2"><i>'.date ($config['date_format'], $actualizacion).'</i></td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
|
echo '<tr>
|
||||||
|
<td class="datos"><b>'.__('Owner').'</b></td>
|
||||||
|
<td class="datos">';
|
||||||
|
|
||||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||||
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
|
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
|
||||||
@ -255,7 +266,9 @@ if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $conf
|
|||||||
else {
|
else {
|
||||||
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
|
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
|
||||||
}
|
}
|
||||||
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
|
echo '</td>
|
||||||
|
<td class="datos"><b>'.__('Status').'</b></td>
|
||||||
|
<td class="datos">';
|
||||||
|
|
||||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||||
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
|
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
|
||||||
@ -263,9 +276,12 @@ if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $conf
|
|||||||
else {
|
else {
|
||||||
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
|
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
|
||||||
}
|
}
|
||||||
echo '</td></tr>';
|
echo '</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
echo '<tr><td class="datos2"><b>'.__('Source').'</b></td><td class="datos2">';
|
echo '<tr>
|
||||||
|
<td class="datos2"><b>'.__('Source').'</b></td>
|
||||||
|
<td class="datos2">';
|
||||||
|
|
||||||
$fields = array ();
|
$fields = array ();
|
||||||
$return = db_get_all_rows_sql ("SELECT origen FROM torigen ORDER BY origen");
|
$return = db_get_all_rows_sql ("SELECT origen FROM torigen ORDER BY origen");
|
||||||
|
@ -397,7 +397,6 @@ function show_data_section () {
|
|||||||
$("#dashboard").css("display", "none");
|
$("#dashboard").css("display", "none");
|
||||||
$("#visual_console").css("display", "none");
|
$("#visual_console").css("display", "none");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
</script>
|
|
@ -57,14 +57,14 @@ if (! check_acl ($config["id_user"], $id_group, "AR")) {
|
|||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
if (check_acl ($config["id_user"], $id_group, "AW")) {
|
if (check_acl ($config["id_user"], $id_group, "AW")) {
|
||||||
|
|
||||||
$hash = md5($config["dbpass"]. $id_layout. $config["id_user"]);
|
$hash = md5($config["dbpass"]. $id_layout. $config["id_user"]);
|
||||||
|
|
||||||
$options['public_link']['text'] = '<a href="'.$config["homeurl"].'/operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$id_layout.'&id_user='.$config["id_user"].'">'.
|
$options['public_link']['text'] = '<a href="'.$config["homeurl"].'/operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$id_layout.'&id_user='.$config["id_user"].'">'.
|
||||||
|
|
||||||
html_print_image ("images/camera.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>';
|
html_print_image ("images/camera.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>';
|
||||||
$options['public_link']['active'] = false;
|
$options['public_link']['active'] = false;
|
||||||
|
|
||||||
$options['setup']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=editor&action=edit&id_visual_console='.$id_layout.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
|
$options['setup']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&tab=editor&action=edit&id_visual_console='.$id_layout.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
|
||||||
$options['setup']['active'] = false;
|
$options['setup']['active'] = false;
|
||||||
}
|
}
|
||||||
@ -146,8 +146,11 @@ $(document).ready (function () {
|
|||||||
?>
|
?>
|
||||||
t = new Date();
|
t = new Date();
|
||||||
t.setTime (t.getTime() + <?php echo $config["refr"] * 1000; ?>);
|
t.setTime (t.getTime() + <?php echo $config["refr"] * 1000; ?>);
|
||||||
$("#countdown").countdown({until: t, format: 'MS', description: '<?php echo __('Until refresh'); ?>'});
|
$("#countdown").countdown({
|
||||||
|
until: t,
|
||||||
|
format: 'MS',
|
||||||
|
description: '<?php echo __('Until refresh'); ?>'
|
||||||
|
});
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user