From e61ecd3f7349089d27b42df06959533f8d66d6f2 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 6 Apr 2015 16:54:24 +0200 Subject: [PATCH 01/22] Added the new 'tperfil' columns to the function "get_acl_column" --- pandora_console/include/functions.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index c70d6868d3..3183b8e6f5 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1874,6 +1874,24 @@ function get_acl_column($access) { case "EM": return "event_management"; break; + case "MR": + return "map_view"; + break; + case "MW": + return "map_edit"; + break; + case "MM": + return "map_management"; + break; + case "VR": + return "vconsole_view"; + break; + case "VW": + return "vconsole_edit"; + break; + case "VM": + return "vconsole_management"; + break; default: return ""; break; From 9035eda57da41fd3b23ff8242f6744c2425f4c11 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 6 Apr 2015 18:51:24 +0200 Subject: [PATCH 02/22] Added the new access bits to the profiles list and editor --- .../godmode/users/configure_profile.php | 279 ++++++++++++++---- .../godmode/users/profile_list.php | 263 +++++++++++------ 2 files changed, 399 insertions(+), 143 deletions(-) diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index 622b01f009..39e2565bd7 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -64,24 +64,51 @@ $id_profile = (int) get_parameter ('id'); if ($id_profile || $new_profile) { if ($new_profile) { + // Name $name = ''; + + // Incidents $incident_view = 0; $incident_edit = 0; $incident_management = 0; + + // Agents $agent_view = 0; $agent_edit = 0; + $agent_disable = 0; + + // Alerts $alert_edit = 0; - $user_management = 0; - $db_management = 0; $alert_management = 0; + + // Users + $user_management = 0; + + // DB + $db_management = 0; + + // Pandora $pandora_management = 0; - $report_view = 0; - $report_edit = 0; - $report_management = 0; + + // Events $event_view = 0; $event_edit = 0; $event_management = 0; - $agent_disable = 0; + + // Reports + $report_view = 0; + $report_edit = 0; + $report_management = 0; + + // Network maps + $map_view = 0; + $map_edit = 0; + $map_management = 0; + + // Visual console + $vconsole_view = 0; + $vconsole_edit = 0; + $vconsole_management = 0; $page_title = __('Create profile'); } @@ -101,38 +128,91 @@ if ($id_profile || $new_profile) { exit; } + // Name $name = $profile["name"]; + + // Incidents $incident_view = (bool) $profile["incident_view"]; $incident_edit = (bool) $profile["incident_edit"]; $incident_management = (bool) $profile["incident_management"]; + + // Agents $agent_view = (bool) $profile["agent_view"]; $agent_edit = (bool) $profile["agent_edit"]; + $agent_disable = (bool) $profile["agent_disable"]; + + // Alerts $alert_edit = (bool) $profile["alert_edit"]; - $user_management = (bool) $profile["user_management"]; - $db_management = (bool) $profile["db_management"]; $alert_management = (bool) $profile["alert_management"]; + + // Users + $user_management = (bool) $profile["user_management"]; + + // DB + $db_management = (bool) $profile["db_management"]; + + // Pandora $pandora_management = (bool) $profile["pandora_management"]; - $report_view = (bool) $profile["report_view"]; - $report_edit = (bool) $profile["report_edit"]; - $report_management = (bool) $profile["report_management"]; + + // Events $event_view = (bool) $profile["event_view"]; $event_edit = (bool) $profile["event_edit"]; $event_management = (bool) $profile["event_management"]; - $agent_disable = (bool) $profile["agent_disable"]; + + // Reports + $report_view = (bool) $profile["report_view"]; + $report_edit = (bool) $profile["report_edit"]; + $report_management = (bool) $profile["report_management"]; + + // Network maps + $map_view = (bool) $profile["map_view"]; + $map_edit = (bool) $profile["map_edit"]; + $map_management = (bool) $profile["map_management"]; + + // Visual console + $vconsole_view = (bool) $profile["vconsole_view"]; + $vconsole_edit = (bool) $profile["vconsole_edit"]; + $vconsole_management = (bool) $profile["vconsole_management"]; $id_audit = db_pandora_audit("User management", "Edit profile ". $name); enterprise_include_once('include/functions_audit.php'); - $info = 'Name: ' . $name . ' Incident view: ' . $incident_view . - ' Incident edit: ' . $incident_edit . ' Incident management: ' . $incident_management . - ' Agent view: ' . $agent_view . ' Agent edit: ' . $agent_edit . - ' Alert edit: ' . $alert_edit . ' User management: ' . $user_management . - ' DB management: ' . $db_management . ' Alert management: ' . $alert_management . - ' Report view: ' . $report_view . ' Report edit: ' . $report_edit . - ' Report management: ' . $report_management . ' Event view: ' . $event_view . - ' Event edit: ' . $event_edit . ' Event management: ' . $event_management . - ' Agent disable: ' . $agent_disable . - ' Pandora Management: ' . $pandora_management; + + $info = 'Name: ' . $name . + + ' Incident view: ' . $incident_view . + ' Incident edit: ' . $incident_edit . + ' Incident management: ' . $incident_management . + + ' Agent view: ' . $agent_view . + ' Agent edit: ' . $agent_edit . + ' Agent disable: ' . $agent_disable . + + ' Alert edit: ' . $alert_edit . + ' Alert management: ' . $alert_management . + + ' User management: ' . $user_management . + + ' DB management: ' . $db_management . + + ' Event view: ' . $event_view . + ' Event edit: ' . $event_edit . + ' Event management: ' . $event_management . + + ' Report view: ' . $report_view . + ' Report edit: ' . $report_edit . + ' Report management: ' . $report_management . + + ' Network map view: ' . $map_view . + ' Network map edit: ' . $map_edit . + ' Network map management: ' . $map_management . + + ' Visual console view: ' . $vconsole_view . + ' Visual console edit: ' . $vconsole_edit . + ' Visual console management: ' . $vconsole_management . + + ' Pandora Management: ' . $pandora_management; + enterprise_hook('audit_pandora_enterprise', array($id_audit, $info)); @@ -141,7 +221,7 @@ if ($id_profile || $new_profile) { $table->width = '98%'; $table->class = 'databox'; - if (defined("METACONSOLE")){ + if (defined("METACONSOLE")) { $table->width = '100%'; $table->class = 'databox data'; if ($id_profile) @@ -156,42 +236,123 @@ if ($id_profile || $new_profile) { $table->style[0] = 'font-weight: bold'; $table->data = array (); - $table->data[0][0] = __('Profile name'); - $table->data[0][1] = html_print_input_text ('name', $name, '', 30, 60, true); - $table->data[1][0] = __('View incidents'); - $table->data[1][1] = html_print_checkbox ('incident_view', 1, $incident_view, true); - $table->data[2][0] = __('Edit incidents'); - $table->data[2][1] = html_print_checkbox ('incident_edit', 1, $incident_edit, true); - $table->data[3][0] = __('Manage incidents'); - $table->data[3][1] = html_print_checkbox ('incident_management', 1, $incident_management, true); - $table->data[4][0] = __('View agents'); - $table->data[4][1] = html_print_checkbox ('agent_view', 1, $agent_view, true); - $table->data[5][0] = __('Edit agents'); - $table->data[5][1] = html_print_checkbox ('agent_edit', 1, $agent_edit, true); - $table->data[6][0] = __('Disable agents'); - $table->data[6][1] = html_print_checkbox ('agent_disable', 1, $agent_disable, true); - $table->data[7][0] = __('Edit alerts'); - $table->data[7][1] = html_print_checkbox ('alert_edit', 1, $alert_edit, true); - $table->data[8][0] = __('Manage users'); - $table->data[8][1] = html_print_checkbox ('user_management', 1, $user_management, true); - $table->data[9][0] = __('Manage Database'); - $table->data[9][1] = html_print_checkbox ('db_management', 1, $db_management, true); - $table->data[10][0] = __('Manage alerts'); - $table->data[10][1] = html_print_checkbox ('alert_management', 1, $alert_management, true); - $table->data[11][0] = __('View reports'); - $table->data[11][1] = html_print_checkbox ('report_view', 1, $report_view, true); - $table->data[12][0] = __('Edit reports'); - $table->data[12][1] = html_print_checkbox ('report_edit', 1, $report_edit, true); - $table->data[13][0] = __('Manage reports'); - $table->data[13][1] = html_print_checkbox ('report_management', 1, $report_management, true); - $table->data[14][0] = __('View events'); - $table->data[14][1] = html_print_checkbox ('event_view', 1, $event_view, true); - $table->data[15][0] = __('Edit events'); - $table->data[15][1] = html_print_checkbox ('event_edit', 1, $event_edit, true); - $table->data[16][0] = __('Manage events'); - $table->data[16][1] = html_print_checkbox ('event_management', 1, $event_management, true); - $table->data[17][0] = __('Pandora management'); - $table->data[17][1] = html_print_checkbox ('pandora_management', 1, $pandora_management, true); + // Name + $row = array(); + $row['name'] = __('Profile name'); + $row['input'] = html_print_input_text ('name', $name, '', 30, 60, true); + $table->data['name'] = $row; + + // Incidents + $row = array(); + $row['name'] = __('View incidents'); + $row['input'] = html_print_checkbox ('incident_view', 1, $incident_view, true); + $table->data['IR'] = $row; + $row = array(); + $row['name'] = __('Edit incidents'); + $row['input'] = html_print_checkbox ('incident_edit', 1, $incident_edit, true); + $table->data['IW'] = $row; + $row = array(); + $row['name'] = __('Manage incidents'); + $row['input'] = html_print_checkbox ('incident_management', 1, $incident_management, true); + $table->data['IM'] = $row; + + // Agents + $row = array(); + $row['name'] = __('View agents'); + $row['input'] = html_print_checkbox ('agent_view', 1, $agent_view, true); + $table->data['AR'] = $row; + $row = array(); + $row['name'] = __('Edit agents'); + $row['input'] = html_print_checkbox ('agent_edit', 1, $agent_edit, true); + $table->data['AW'] = $row; + $row = array(); + $row['name'] = __('Disable agents'); + $row['input'] = html_print_checkbox ('agent_disable', 1, $agent_disable, true); + $table->data['AD'] = $row; + + // Alerts + $row = array(); + $row['name'] = __('Edit alerts'); + $row['input'] = html_print_checkbox ('alert_edit', 1, $alert_edit, true); + $table->data['LW'] = $row; + $row = array(); + $row['name'] = __('Manage alerts'); + $row['input'] = html_print_checkbox ('alert_management', 1, $alert_management, true); + $table->data['LM'] = $row; + + // Users + $row = array(); + $row['name'] = __('Manage users'); + $row['input'] = html_print_checkbox ('user_management', 1, $user_management, true); + $table->data['UM'] = $row; + + // DB + $row = array(); + $row['name'] = __('Manage database'); + $row['input'] = html_print_checkbox ('db_management', 1, $db_management, true); + $table->data['DM'] = $row; + + // Events + $row = array(); + $row['name'] = __('View events'); + $row['input'] = html_print_checkbox ('event_view', 1, $event_view, true); + $table->data['ER'] = $row; + $row = array(); + $row['name'] = __('Edit events'); + $row['input'] = html_print_checkbox ('event_edit', 1, $event_edit, true); + $table->data['EW'] = $row; + $row = array(); + $row['name'] = __('Manage events'); + $row['input'] = html_print_checkbox ('event_management', 1, $event_management, true); + $table->data['EM'] = $row; + + // Reports + $row = array(); + $row['name'] = __('View reports'); + $row['input'] = html_print_checkbox ('report_view', 1, $report_view, true); + $table->data['RR'] = $row; + $row = array(); + $row['name'] = __('Edit reports'); + $row['input'] = html_print_checkbox ('report_edit', 1, $report_edit, true); + $table->data['RW'] = $row; + $row = array(); + $row['name'] = __('Manage reports'); + $row['input'] = html_print_checkbox ('report_management', 1, $report_management, true); + $table->data['RM'] = $row; + + // Network maps + $row = array(); + $row['name'] = __('View network maps'); + $row['input'] = html_print_checkbox ('map_view', 1, $map_view, true); + $table->data['MR'] = $row; + $row = array(); + $row['name'] = __('Edit network maps'); + $row['input'] = html_print_checkbox ('map_edit', 1, $map_edit, true); + $table->data['MW'] = $row; + $row = array(); + $row['name'] = __('Manage network maps'); + $row['input'] = html_print_checkbox ('map_management', 1, $map_management, true); + $table->data['MM'] = $row; + + // Visual console + $row = array(); + $row['name'] = __('View visual console'); + $row['input'] = html_print_checkbox ('vconsole_view', 1, $vconsole_view, true); + $table->data['VR'] = $row; + $row = array(); + $row['name'] = __('Edit visual console'); + $row['input'] = html_print_checkbox ('vconsole_edit', 1, $vconsole_edit, true); + $table->data['VW'] = $row; + $row = array(); + $row['name'] = __('Manage visual console'); + $row['input'] = html_print_checkbox ('vconsole_management', 1, $vconsole_management, true); + $table->data['VM'] = $row; + + // Pandora + $row = array(); + $row['name'] = __('Pandora management'); + $row['input'] = html_print_checkbox ('pandora_management', 1, $pandora_management, true); + $table->data['PM'] = $row; echo '
'; diff --git a/pandora_console/godmode/users/profile_list.php b/pandora_console/godmode/users/profile_list.php index ef51daee39..94f30f6b1c 100644 --- a/pandora_console/godmode/users/profile_list.php +++ b/pandora_console/godmode/users/profile_list.php @@ -103,45 +103,78 @@ if ($delete_profile) { } // Store the variables when create or update -if($create_profile || $update_profile) { +if ($create_profile || $update_profile) { $name = get_parameter ("name"); + + // Incidents $incident_view = (bool) get_parameter ("incident_view"); $incident_edit = (bool) get_parameter ("incident_edit"); $incident_management = (bool) get_parameter ("incident_management"); + + // Agents $agent_view = (bool) get_parameter ("agent_view"); $agent_edit = (bool) get_parameter ("agent_edit"); + $agent_disable = (bool) get_parameter ("agent_disable"); + + // Alerts $alert_edit = (bool) get_parameter ("alert_edit"); - $user_management = (bool) get_parameter ("user_management"); - $db_management = (bool) get_parameter ("db_management"); $alert_management = (bool) get_parameter ("alert_management"); + + // Users + $user_management = (bool) get_parameter ("user_management"); + + // DB + $db_management = (bool) get_parameter ("db_management"); + + // Pandora $pandora_management = (bool) get_parameter ("pandora_management"); - $report_view = (bool) get_parameter ("report_view"); - $report_edit = (bool) get_parameter ("report_edit"); - $report_management = (bool) get_parameter ("report_management"); + + // Events $event_view = (bool) get_parameter ("event_view"); $event_edit = (bool) get_parameter ("event_edit"); $event_management = (bool) get_parameter ("event_management"); - $agent_disable = (bool) get_parameter ("agent_disable"); + + // Reports + $report_view = (bool) get_parameter ("report_view"); + $report_edit = (bool) get_parameter ("report_edit"); + $report_management = (bool) get_parameter ("report_management"); + + // Network maps + $map_view = (bool) get_parameter ("map_view"); + $map_edit = (bool) get_parameter ("map_edit"); + $map_management = (bool) get_parameter ("map_management"); + + // Visual console + $vconsole_view = (bool) get_parameter ("vconsole_view"); + $vconsole_edit = (bool) get_parameter ("vconsole_edit"); + $vconsole_management = (bool) get_parameter ("vconsole_management"); $values = array( - 'name' => $name, - 'incident_view' => $incident_view, - 'incident_edit' => $incident_edit, - 'incident_management' => $incident_management, - 'agent_view' => $agent_view, - 'agent_edit' => $agent_edit, - 'alert_edit' => $alert_edit, - 'user_management' => $user_management, - 'db_management' => $db_management, - 'alert_management' => $alert_management, - 'pandora_management' => $pandora_management, - 'report_view' => $report_view, - 'report_edit' => $report_edit, - 'report_management' => $report_management, - 'event_view' => $event_view, - 'event_edit' => $event_edit, - 'event_management' => $event_management, - 'agent_disable' => $agent_disable); + 'name' => $name, + 'incident_view' => $incident_view, + 'incident_edit' => $incident_edit, + 'incident_management' => $incident_management, + 'agent_view' => $agent_view, + 'agent_edit' => $agent_edit, + 'agent_disable' => $agent_disable, + 'alert_edit' => $alert_edit, + 'alert_management' => $alert_management, + 'user_management' => $user_management, + 'db_management' => $db_management, + 'event_view' => $event_view, + 'event_edit' => $event_edit, + 'event_management' => $event_management, + 'report_view' => $report_view, + 'report_edit' => $report_edit, + 'report_management' => $report_management, + 'map_view' => $map_view, + 'map_edit' => $map_edit, + 'map_management' => $map_management, + 'vconsole_view' => $vconsole_view, + 'vconsole_edit' => $vconsole_edit, + 'vconsole_management' => $vconsole_management, + 'pandora_management' => $pandora_management + ); } // Update profile @@ -149,16 +182,41 @@ if ($update_profile) { if ($name) { $ret = db_process_sql_update('tperfil', $values, array('id_perfil' => $id_profile)); if ($ret !== false) { - $info = 'Name: ' . $name . ' Incident view: ' . $incident_view . - ' Incident edit: ' . $incident_edit . ' Incident management: ' . $incident_management . - ' Agent view: ' . $agent_view . ' Agent edit: ' . $agent_edit . - ' Alert edit: ' . $alert_edit . ' User management: ' . $user_management . - ' DB management: ' . $db_management . ' Alert management: ' . $alert_management . - ' Report view: ' . $report_view . ' Report edit: ' . $report_edit . - ' Report management: ' . $report_management . ' Event view: ' . $event_view . - ' Event edit: ' . $event_edit . ' Event management: ' . $event_management . - ' Agent disable: ' . $agent_disable . - ' Pandora Management: ' . $pandora_management; + $info = 'Name: ' . $name . + + ' Incident view: ' . $incident_view . + ' Incident edit: ' . $incident_edit . + ' Incident management: ' . $incident_management . + + ' Agent view: ' . $agent_view . + ' Agent edit: ' . $agent_edit . + ' Agent disable: ' . $agent_disable . + + ' Alert edit: ' . $alert_edit . + ' Alert management: ' . $alert_management . + + ' User management: ' . $user_management . + + ' DB management: ' . $db_management . + + ' Event view: ' . $event_view . + ' Event edit: ' . $event_edit . + ' Event management: ' . $event_management . + + ' Report view: ' . $report_view . + ' Report edit: ' . $report_edit . + ' Report management: ' . $report_management . + + ' Network map view: ' . $map_view . + ' Network map edit: ' . $map_edit . + ' Network map management: ' . $map_management . + + ' Visual console view: ' . $vconsole_view . + ' Visual console edit: ' . $vconsole_edit . + ' Visual console management: ' . $vconsole_management . + + ' Pandora Management: ' . $pandora_management; + db_pandora_audit("User management", "Update profile ". $name, false, false, $info); @@ -182,16 +240,41 @@ if ($create_profile) { if ($ret !== false) { ui_print_success_message(__('Successfully created')); - $info = 'Name: ' . $name . ' Incident view: ' . $incident_view . - ' Incident edit: ' . $incident_edit . ' Incident management: ' . $incident_management . - ' Agent view: ' . $agent_view . ' Agent edit: ' . $agent_edit . - ' Alert edit: ' . $alert_edit . ' User management: ' . $user_management . - ' DB management: ' . $db_management . ' Alert management: ' . $alert_management . - ' Report view: ' . $report_view . ' Report edit: ' . $report_edit . - ' Report management: ' . $report_management . ' Event view: ' . $event_view . - ' Event edit: ' . $event_edit . ' Event management: ' . $event_management . - ' Agent disable: ' . $agent_disable . - ' Pandora Management: ' . $pandora_management; + $info = 'Name: ' . $name . + + ' Incident view: ' . $incident_view . + ' Incident edit: ' . $incident_edit . + ' Incident management: ' . $incident_management . + + ' Agent view: ' . $agent_view . + ' Agent edit: ' . $agent_edit . + ' Agent disable: ' . $agent_disable . + + ' Alert edit: ' . $alert_edit . + ' Alert management: ' . $alert_management . + + ' User management: ' . $user_management . + + ' DB management: ' . $db_management . + + ' Event view: ' . $event_view . + ' Event edit: ' . $event_edit . + ' Event management: ' . $event_management . + + ' Report view: ' . $report_view . + ' Report edit: ' . $report_edit . + ' Report management: ' . $report_management . + + ' Network map view: ' . $map_view . + ' Network map edit: ' . $map_edit . + ' Network map management: ' . $map_management . + + ' Visual console view: ' . $vconsole_view . + ' Visual console edit: ' . $vconsole_edit . + ' Visual console management: ' . $vconsole_management . + + ' Pandora Management: ' . $pandora_management; + db_pandora_audit("User management", "Created profile ". $name, false, false, $info); } @@ -217,26 +300,32 @@ $table->data = array (); $table->size = array (); $table->align = array (); -$table->head[0] = __('Profiles'); +$table->head['profiles'] = __('Profiles'); -$table->head[1] = "IR" . ui_print_help_tip (__('System incidents reading'), true); -$table->head[2] = "IW" . ui_print_help_tip (__('System incidents writing'), true); -$table->head[3] = "IM" . ui_print_help_tip (__('System incidents management'), true); -$table->head[4] = "AR" . ui_print_help_tip (__('Agents reading'), true); -$table->head[5] = "AW" . ui_print_help_tip (__('Agents management'), true); -$table->head[6] = "AD" . ui_print_help_tip (__('Agents disable'), true); -$table->head[7] = "LW" . ui_print_help_tip (__('Alerts editing'), true); -$table->head[8] = "UM" . ui_print_help_tip (__('Users management'), true); -$table->head[9] = "DM" . ui_print_help_tip (__('Database management'), true); -$table->head[10] = "LM" . ui_print_help_tip (__('Alerts management'), true); -$table->head[11] = "RR" . ui_print_help_tip (__('Reports reading'), true); -$table->head[12] = "RW" . ui_print_help_tip (__('Reports writing'), true); -$table->head[13] = "RM" . ui_print_help_tip (__('Reports management'), true); -$table->head[14] = "ER" . ui_print_help_tip (__('Events reading'), true); -$table->head[15] = "EW" . ui_print_help_tip (__('Events writing'), true); -$table->head[16] = "EM" . ui_print_help_tip (__('Events management'), true); -$table->head[17] = "PM" . ui_print_help_tip (__('Systems management'), true); -$table->head[18] = '' . __('Op.') . ''; +$table->head['IR'] = "IR" . ui_print_help_tip (__('System incidents reading'), true); +$table->head['IW'] = "IW" . ui_print_help_tip (__('System incidents writing'), true); +$table->head['IM'] = "IM" . ui_print_help_tip (__('System incidents management'), true); +$table->head['AR'] = "AR" . ui_print_help_tip (__('Agents reading'), true); +$table->head['AW'] = "AW" . ui_print_help_tip (__('Agents management'), true); +$table->head['AD'] = "AD" . ui_print_help_tip (__('Agents disable'), true); +$table->head['LW'] = "LW" . ui_print_help_tip (__('Alerts editing'), true); +$table->head['LM'] = "LM" . ui_print_help_tip (__('Alerts management'), true); +$table->head['UM'] = "UM" . ui_print_help_tip (__('Users management'), true); +$table->head['DM'] = "DM" . ui_print_help_tip (__('Database management'), true); +$table->head['ER'] = "ER" . ui_print_help_tip (__('Events reading'), true); +$table->head['EW'] = "EW" . ui_print_help_tip (__('Events writing'), true); +$table->head['EM'] = "EM" . ui_print_help_tip (__('Events management'), true); +$table->head['RR'] = "RR" . ui_print_help_tip (__('Reports reading'), true); +$table->head['RW'] = "RW" . ui_print_help_tip (__('Reports writing'), true); +$table->head['RM'] = "RM" . ui_print_help_tip (__('Reports management'), true); +$table->head['MR'] = "MR" . ui_print_help_tip (__('Network maps reading'), true); +$table->head['MW'] = "MW" . ui_print_help_tip (__('Network maps writing'), true); +$table->head['MM'] = "MM" . ui_print_help_tip (__('Network maps management'), true); +$table->head['VR'] = "VR" . ui_print_help_tip (__('Visual console reading'), true); +$table->head['VW'] = "VW" . ui_print_help_tip (__('Visual console writing'), true); +$table->head['VM'] = "VM" . ui_print_help_tip (__('Visual console management'), true); +$table->head['PM'] = "PM" . ui_print_help_tip (__('Systems management'), true); +$table->head['operations'] = '' . __('Op.') . ''; $table->align = array_fill (1, 11, "center"); $table->size = array_fill (1, 10, 40); @@ -249,26 +338,32 @@ if ($profiles === false) { $img = html_print_image ("images/ok.png", true, array ("border" => 0)); foreach ($profiles as $profile) { - $data[0] = ''.$profile["name"].''; - $data[1] = ($profile["incident_view"] ? $img : ''); - $data[2] = ($profile["incident_edit"] ? $img : ''); - $data[3] = ($profile["incident_management"] ? $img : ''); - $data[4] = ($profile["agent_view"] ? $img : ''); - $data[5] = ($profile["agent_edit"] ? $img : ''); - $data[6] = ($profile["agent_disable"] ? $img : ''); - $data[7] = ($profile["alert_edit"] ? $img : ''); - $data[8] = ($profile["user_management"] ? $img : ''); - $data[9] = ($profile["db_management"] ? $img : ''); - $data[10] = ($profile["alert_management"] ? $img : ''); - $data[11] = ($profile["report_view"] ? $img : ''); - $data[12] = ($profile["report_edit"] ? $img : ''); - $data[13] = ($profile["report_management"] ? $img : ''); - $data[14] = ($profile["event_view"] ? $img : ''); - $data[15] = ($profile["event_edit"] ? $img : ''); - $data[16] = ($profile["event_management"] ? $img : ''); - $data[17] = ($profile["pandora_management"] ? $img : ''); - $data[18] = ''. html_print_image('images/config.png', true, array('title' => __('Edit'))) .''; - $data[18] .= '  '. html_print_image("images/cross.png", true) . ''; + $data['profiles'] = ''.$profile["name"].''; + $data['IR'] = ($profile["incident_view"] ? $img : ''); + $data['IW'] = ($profile["incident_edit"] ? $img : ''); + $data['IM'] = ($profile["incident_management"] ? $img : ''); + $data['AR'] = ($profile["agent_view"] ? $img : ''); + $data['AW'] = ($profile["agent_edit"] ? $img : ''); + $data['AD'] = ($profile["agent_disable"] ? $img : ''); + $data['LW'] = ($profile["alert_edit"] ? $img : ''); + $data['LM'] = ($profile["alert_management"] ? $img : ''); + $data['UM'] = ($profile["user_management"] ? $img : ''); + $data['DM'] = ($profile["db_management"] ? $img : ''); + $data['ER'] = ($profile["event_view"] ? $img : ''); + $data['EW'] = ($profile["event_edit"] ? $img : ''); + $data['EM'] = ($profile["event_management"] ? $img : ''); + $data['RR'] = ($profile["report_view"] ? $img : ''); + $data['RW'] = ($profile["report_edit"] ? $img : ''); + $data['RM'] = ($profile["report_management"] ? $img : ''); + $data['MR'] = ($profile["map_view"] ? $img : ''); + $data['MW'] = ($profile["map_edit"] ? $img : ''); + $data['MM'] = ($profile["map_management"] ? $img : ''); + $data['VR'] = ($profile["vconsole_view"] ? $img : ''); + $data['VW'] = ($profile["vconsole_edit"] ? $img : ''); + $data['VM'] = ($profile["vconsole_management"] ? $img : ''); + $data['PM'] = ($profile["pandora_management"] ? $img : ''); + $data['operations'] = ''. html_print_image('images/config.png', true, array('title' => __('Edit'))) .''; + $data['operations'] .= '  '. html_print_image("images/cross.png", true) . ''; array_push ($table->data, $data); } From f005b00eb64d715ee6eca5d1ac795a56a1be068c Mon Sep 17 00:00:00 2001 From: hkosaka Date: Tue, 7 Apr 2015 13:08:50 +0900 Subject: [PATCH 03/22] Use -C to invoke tentacle_server when using SSL proxy mode (see also e8e59f3e3e98). --- pandora_agents/unix/pandora_agent | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a929d9d46c..c0421a3004 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -975,6 +975,8 @@ sub launch_tentacle_proxy () { #Execute tentacle server as a daemon my $new_process = "tentacle_server -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'}; + $new_process .= ' -C' if ($Conf{'server_ssl'} eq 'yes'); + log_message ('setup', 'Proxy mode enabled'); exec ($new_process); } From 5be63acffca3aaee911790d17690cd885d82d295 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Tue, 7 Apr 2015 16:26:20 +0200 Subject: [PATCH 04/22] Fixed html title when click graph in meta and nodo in status monitor, tiquet: #2077 --- pandora_console/operation/agentes/stat_win.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 9494b138c4..05f1c4dece 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -55,9 +55,10 @@ if (file_exists ('../../include/languages/'.$user_language.'.mo')) { } echo ''; - +$label = str_replace('%3D', '=', get_parameter('label', '')); +$label = base64_decode($label); $id = get_parameter('id'); -$label = base64_decode(get_parameter('label', '')); +//$label = rawurldecode(urldecode(base64_decode(get_parameter('label', '')))); ?> From f9936267e002e4fe8b50d7e9c9138d4709fdd458 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 7 Apr 2015 17:11:04 +0200 Subject: [PATCH 05/22] Fixed the separator (sometimes it is other) in the ajax call get_agent_modules_json_for_multiple_agents. (cherry picked from commit 6f71a01b0c4cabdb14e2953239b1330c12f5ec26) --- pandora_console/operation/agentes/ver_agente.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index b2e251dd8f..6f143e1bc1 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -246,7 +246,12 @@ if (is_ajax ()) { foreach ($idAgents as $idA) { if (empty($metaconsole_server_name)) { - $row = explode ('|', $idA); + if (strstr($idA, "|@_@|")) { + $row = explode ('|@_@|', $idA); + } + else { + $row = explode ('|', $idA); + } $server_name = $row[0]; $id_agent = $row [1]; } From da36f04a1ad6881e9170d25b0917356ea6d2d6a3 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 8 Apr 2015 00:01:10 +0200 Subject: [PATCH 06/22] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7ea6c6a468..1460b50e3f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150406 +Version: 6.0dev-150408 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 2668a6549e..5e6b09af11 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150406" +pandora_version="6.0dev-150408" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index c0421a3004..66c3672fc0 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150406'; +use constant AGENT_BUILD => '150408'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 3ce75006e2..2f7f2d4e33 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150406 +%define release 150408 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index ff7d533bcb..95b7ed9308 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150406 +%define release 150408 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 40c44ec39c..34d5b263d5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150406} +{150408} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 53235936bf..8f0ea58cd4 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150406)") +#define PANDORA_VERSION ("6.0dev(Build 150408)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 772c338377..e365c7e41b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150406))" + VALUE "ProductVersion", "(6.0dev(Build 150408))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f09a2fa329..fa85eec958 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150406 +Version: 6.0dev-150408 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 2578f7755b..a33b8a651b 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150406" +pandora_version="6.0dev-150408" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1ceaff3c3a..6c4302acac 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150406'; +$build_version = 'PC150408'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5ac0639d2e..576bafa132 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Wed, 8 Apr 2015 09:31:45 +0200 Subject: [PATCH 07/22] if user is strict user only see option all in select servers in filter eventlist, tiquet: #2074 --- pandora_console/operation/events/events_list.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 64ad196346..b049083d92 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -472,9 +472,13 @@ if (!$meta) { } else { $data[1] = __('Server') . $jump; - $data[1] .= html_print_select_from_sql( - 'SELECT id, server_name FROM tmetaconsole_setup', - 'server_id', $server_id, 'script', __('All'), '0', true); + if ($strict_user) + $data[1] .= html_print_select('','server_id', + $server_id, 'script', __('All'), '0', true); + else + $data[1] .= html_print_select_from_sql( + 'SELECT id, server_name FROM tmetaconsole_setup', + 'server_id', $server_id, 'script', __('All'), '0', true); } $table_advanced->data[] = $data; From 7e5bd7e22e15fe6a8d4154e8f1982d02bfc836e3 Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Mon, 6 Apr 2015 14:29:58 +0900 Subject: [PATCH 08/22] Enable to postpone planned downtime when in execution and its type is once Based on the contribution of Hiroki Shimizu --- .../agentes/planned_downtime.editor.php | 58 ++++++++++++------- .../godmode/agentes/planned_downtime.list.php | 6 ++ 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 44312abe7f..1c17f5d4b3 100755 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -159,6 +159,9 @@ if ($create_downtime || $update_downtime) { else if ($type_execution == 'once' && $datetime_from >= $datetime_to) { ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end date must be higher than the start date')); } + else if ($type_execution == 'once' && $datetime_to <= $now) { + ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end date must be higher than the current time')); + } else if ($type_execution == 'periodically' && (($type_periodicity == 'weekly' && $periodically_time_from >= $periodically_time_to) || ($type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to && $periodically_time_from >= $periodically_time_to))) { @@ -216,7 +219,6 @@ if ($create_downtime || $update_downtime) { 'description' => $description, 'date_from' => $datetime_from, 'date_to' => $datetime_to, - 'executed' => 0, 'id_group' => $id_group, 'only_alerts' => 0, 'monday' => $monday, @@ -307,18 +309,22 @@ if ($id_downtime > 0) { $type_downtime = $result['type_downtime']; $type_execution = $result['type_execution']; $type_periodicity = $result['type_periodicity']; + $executed = $result['executed']; if ($id_group == 0) $id_group = $result['id_group']; } +// when the planned down time is in execution, only action to postpone on once type is enabled and the other are disabled. +$disabled_in_execution = $executed ? 1 : 0; + $table->class = 'databox_color'; $table->width = '98%'; $table->data = array (); $table->data[0][0] = __('Name'); -$table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true); +$table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true, $disabled_in_execution); $table->data[1][0] = __('Group'); -$table->data[1][1] = html_print_select_groups(false, "AW", true, 'id_group', $id_group, '', '', 0, true); +$table->data[1][1] = html_print_select_groups(false, "AW", true, 'id_group', $id_group, '', '', 0, true, false, true, '', $disabled_in_execution); $table->data[2][0] = __('Description'); $table->data[2][1] = html_print_textarea ('description', 3, 35, $description, '', true); @@ -329,11 +335,12 @@ $table->data[3][1] = html_print_select(array('quiet' => __('Quiet'), 'disable_agents' => __('Disabled Agents'), 'disable_agents_alerts' => __('Disabled only Alerts')), 'type_downtime', $type_downtime, 'change_type_downtime()', '', 0, true, false, true, - ''); + '', $disabled_in_execution); $table->data[4][0] = __('Execution'); $table->data[4][1] = html_print_select(array('once' => __('Once'), 'periodically' => __('Periodically')), - 'type_execution', $type_execution, 'change_type_execution();', '', 0, true); + 'type_execution', $type_execution, 'change_type_execution();', '', 0, true, + false, true, '', $disabled_in_execution); $days = array_combine(range(1, 31), range(1, 31)); $table->data[5][0] = __('Configure the time') . " " . ui_print_help_icon ('planned_downtime_time', true);; @@ -345,9 +352,11 @@ $table->data[5][1] = " __('From:') . " ". - html_print_input_text ('once_date_from', $once_date_from, '', 10, 10, true) . + html_print_input_text_extended ('once_date_from', $once_date_from, '', 10, 10, true, + $disabled_in_execution, '', $disabled_in_execution ? "disabled=disabled" : '') . ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) . - html_print_input_text ('once_time_from', $once_time_from, '', 9, 9, true) . + html_print_input_text_extended ('once_time_from', $once_time_from, '', 9, 9, true, + $disabled_in_execution, '', $disabled_in_execution ? "disabled=disabled" : '') . ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) . " @@ -372,7 +381,8 @@ $table->data[5][1] = " 'weekly' => __('Weekly'), 'monthly' => __('Monthly')), 'type_periodicity', $type_periodicity, - 'change_type_periodicity();', '', 0, true) . + 'change_type_periodicity();', '', 0, true, + false, true, '', $disabled_in_execution) . " @@ -380,25 +390,25 @@ $table->data[5][1] = " @@ -407,12 +417,14 @@ $table->data[5][1] = " " . __('From day:') . " ". html_print_select($days, - 'periodically_day_from', $periodically_day_from, '', '', 0, true) . + 'periodically_day_from', $periodically_day_from, '', '', 0, true, + false, true, '', $disabled_in_execution) . " " . __('To day:') . " ". html_print_select($days, - 'periodically_day_to', $periodically_day_to, '', '', 0, true) . + 'periodically_day_to', $periodically_day_to, '', '', 0, true, + false, true, '', $disabled_in_execution) . " " . ui_print_help_tip(__('The end day must be higher than the start day'), true) . " @@ -423,7 +435,7 @@ $table->data[5][1] = " ". html_print_input_text ( 'periodically_time_from', - $periodically_time_from, '', 7, 7, true) . + $periodically_time_from, '', 7, 7, true, $disabled_in_execution) . ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'). ".
".__('The end time must be higher than the start time'), true) . " @@ -431,7 +443,7 @@ $table->data[5][1] = " ". html_print_input_text ( 'periodically_time_to', - $periodically_time_to, '', 7, 7, true) . + $periodically_time_to, '', 7, 7, true, $disabled_in_execution) . ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'). ".
".__('The end time must be higher than the start time'), true) . " @@ -498,7 +510,7 @@ if ($id_downtime > 0) { } $disabled_add_button = false; - if (empty($data)) { + if (empty($data) || $disabled_in_execution) { $disabled_add_button = true; } @@ -589,11 +601,13 @@ if ($id_downtime > 0) { if (($type_downtime != 'disable_agents_alerts') && ($type_downtime != 'disable_agents')) { - $data[5] = '' . + $href = $executed ? 'javascript:void(0);' : 'javascript:show_editor_module(' . $downtime["id_agente"] . ');'; + $data[5] = '' . html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Delete'))) . ""; } - $data[5] .= '' . html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))); } + elseif ($downtime["executed"] == 1 && $downtime['type_execution'] == 'once'){ + $data[8] = '' . + html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . ''; + $data[9]= "N/A"; + } else { $data[8]= "N/A"; $data[9]= "N/A"; From 57e8032b202b3bf9222deba0e30130ec56a982a6 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 8 Apr 2015 20:07:16 +0200 Subject: [PATCH 09/22] Added info about the new visual console and networkmap bits --- .../include/help/en/help_profile.php | 17 ++++++++++------- .../include/help/es/help_profile.php | 6 +++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/help/en/help_profile.php b/pandora_console/include/help/en/help_profile.php index 93dad11cea..3dc910b699 100644 --- a/pandora_console/include/help/en/help_profile.php +++ b/pandora_console/include/help/en/help_profile.php @@ -17,10 +17,9 @@ Tactical viewAR Network map viewAR Group viewAR -Visual console editionRW Create reportRW Create user custom-defined graphRW -View report, visual map and/or custom graphRR +View report or custom graphRR Apply report templateRR Create report templateRM Create incidentIW @@ -41,18 +40,18 @@ SNMP Console viewAR Validate trapsIW MessageIW -Cron jobs PM -Tree view AR -Update manager (Operation & Admin) PM +Cron jobs PM +Tree view AR +Update manager (Operation & Admin)PM Extension Module GroupAR Agent managementAW -Remote agent configuration management AW +Remote agent configuration managementAW Assign alerts to agentsLW Define, alter and delete alert templates, actions and commandsLM Group managementPM Create inventory modulesPM Module management (includes all suboptions)PM -Massive management operations AW +Massive management operationsAW Create agentAW Duplicate remote configurationsAW Downtime managementAW @@ -68,5 +67,9 @@ Search barAR Policy managementAW Disable agent/module/alertAD +View visual consoleVR +Visual console editionVW +View network mapMR +Network map editionMW diff --git a/pandora_console/include/help/es/help_profile.php b/pandora_console/include/help/es/help_profile.php index cead0cdfad..3221309b06 100644 --- a/pandora_console/include/help/es/help_profile.php +++ b/pandora_console/include/help/es/help_profile.php @@ -22,7 +22,7 @@ Crear un visual console RW Crear un informe RW Crear una grafica combinada RW -Ver informe, mapa, grafica, etc RR +Ver informe, grafica, etc RR Aplicar una plantilla de informeRR Crear una plantilla de informeRM Crear incidente IW @@ -70,6 +70,10 @@ Barra busqueda AR Gestión de PolíticasAW Desactivar agente/módulo/alertaAD +Ver visual consoleVR +Crear un vicual consoleVW +Ver mapa de redMR +Editar mapa de redMW From 9353bdcdcb485769791fb3e17f8e2775f4b00f88 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 9 Apr 2015 00:01:11 +0200 Subject: [PATCH 10/22] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 1460b50e3f..6af20ab4af 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150408 +Version: 6.0dev-150409 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 5e6b09af11..1e228ac2e5 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150408" +pandora_version="6.0dev-150409" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 66c3672fc0..6b3be49ddb 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150408'; +use constant AGENT_BUILD => '150409'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 2f7f2d4e33..316adac6e7 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150408 +%define release 150409 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 95b7ed9308..336df4fe5c 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150408 +%define release 150409 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 34d5b263d5..17e4c43977 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150408} +{150409} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8f0ea58cd4..3798131fd9 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150408)") +#define PANDORA_VERSION ("6.0dev(Build 150409)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e365c7e41b..fe8eb1c8dc 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150408))" + VALUE "ProductVersion", "(6.0dev(Build 150409))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index fa85eec958..c1a19db019 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150408 +Version: 6.0dev-150409 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index a33b8a651b..8cddc27284 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150408" +pandora_version="6.0dev-150409" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6c4302acac..0bcd684e9e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150408'; +$build_version = 'PC150409'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 576bafa132..44c0eaeac4 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Thu, 9 Apr 2015 20:17:39 +0900 Subject: [PATCH 11/22] Fixed codes to disable input datepicker. --- .../godmode/agentes/planned_downtime.editor.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 1c17f5d4b3..a80127a459 100755 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -352,11 +352,9 @@ $table->data[5][1] = " __('From:') . " ". - html_print_input_text_extended ('once_date_from', $once_date_from, '', 10, 10, true, - $disabled_in_execution, '', $disabled_in_execution ? "disabled=disabled" : '') . + html_print_input_text ('once_date_from', $once_date_from, '', 10, 10, true, $disabled_in_execution) . ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) . - html_print_input_text_extended ('once_time_from', $once_time_from, '', 9, 9, true, - $disabled_in_execution, '', $disabled_in_execution ? "disabled=disabled" : '') . + html_print_input_text ('once_time_from', $once_time_from, '', 9, 9, true, $disabled_in_execution) . ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) . " @@ -1008,5 +1006,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri } }); } + // Disable datepickers when it has readonly attribute + $('input.hasDatepicker[readonly]').disable(); }); From d28cd4c17251d84b7ab68a06071973eec7aa71cd Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 9 Apr 2015 14:00:37 +0200 Subject: [PATCH 12/22] Changes on the functionality and the ACL checks. Great improvements on the ACL management --- .../godmode/reporting/map_builder.php | 226 +++++++++++------- .../reporting/visual_console_builder.data.php | 20 +- .../visual_console_builder.editor.php | 18 +- .../visual_console_builder.elements.php | 18 +- .../reporting/visual_console_builder.php | 130 +++++++--- .../visual_console_builder.wizard.php | 18 +- .../ajax/visual_console_builder.ajax.php | 33 ++- .../mobile/operation/visualmap.php | 28 ++- .../mobile/operation/visualmaps.php | 2 +- 9 files changed, 346 insertions(+), 147 deletions(-) diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 794df41252..8b7fdb26d6 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -17,6 +17,18 @@ global $config; require_once ($config['homedir'] . '/include/functions_visual_map.php'); +// ACL for the general permission +$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); +$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); +$vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); + +if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { + db_pandora_audit("ACL Violation", + "Trying to access map builder"); + require ("general/noaccess.php"); + exit; +} + $pure = (int)get_parameter('pure', 0); $hack_metaconsole = ''; if (defined('METACONSOLE')) @@ -31,110 +43,139 @@ $copy_layout = (bool) get_parameter ('copy_layout'); $delete_layout = (bool) get_parameter ('delete_layout'); $refr = (int) get_parameter('refr'); -if ($delete_layout) { - db_process_sql_delete ('tlayout_data', array ('id_layout' => $id_layout)); - $result = db_process_sql_delete ('tlayout', array ('id' => $id_layout)); - if ($result) { - db_pandora_audit( "Visual console builder", "Delete visual console #$id_layout"); - ui_print_success_message(__('Successfully deleted')); - db_clean_cache(); +if ($delete_layout || $copy_layout) { + // Visual console required + if (empty($id_layout)) { + db_pandora_audit("ACL Violation", + "Trying to access map builder"); + require ("general/noaccess.php"); + exit; } - else { - db_pandora_audit( "Visual console builder", "Fail try to delete visual console #$id_layout"); - ui_print_error_message(__('Not deleted. Error deleting data')); + + $group_id = db_get_value("id_group", "tlayout", "id", $id_layout); + if ($group_id === false) { + db_pandora_audit("ACL Violation", + "Trying to access map builder"); + require ("general/noaccess.php"); + exit; } - $id_layout = 0; -} + + // ACL for the visual console + // $vconsole_read = check_acl ($config['id_user'], $group_id, "VR"); + $vconsole_write = check_acl ($config['id_user'], $group_id, "VW"); + $vconsole_manage = check_acl ($config['id_user'], $group_id, "VM"); -if ($copy_layout) { - // Number of inserts - $ninsert = (int) 0; + if (!$vconsole_write && !$vconsole_manage) { + db_pandora_audit("ACL Violation", + "Trying to access map builder"); + require ("general/noaccess.php"); + exit; + } - // Return from DB the source layout - $layout_src = db_get_all_rows_filter ("tlayout","id = " . $id_layout); - - // Name of dst - $name_dst = get_parameter ("name_dst", $layout_src[0]['name'] . " copy"); - - // Create the new Console - $idGroup = $layout_src[0]['id_group']; - $background = $layout_src[0]['background']; - $height = $layout_src[0]['height']; - $width = $layout_src[0]['width']; - $visualConsoleName = $name_dst; - - $values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background, 'height' => $height, 'width' => $width); - $result = db_process_sql_insert('tlayout', $values); - - $idNewVisualConsole = $result; - - if ($result) { - $ninsert = 1; + if ($delete_layout) { + db_process_sql_delete ('tlayout_data', array ('id_layout' => $id_layout)); + $result = db_process_sql_delete ('tlayout', array ('id' => $id_layout)); + if ($result) { + db_pandora_audit( "Visual console builder", "Delete visual console #$id_layout"); + ui_print_success_message(__('Successfully deleted')); + db_clean_cache(); + } + else { + db_pandora_audit( "Visual console builder", "Fail try to delete visual console #$id_layout"); + ui_print_error_message(__('Not deleted. Error deleting data')); + } + $id_layout = 0; + } + + if ($copy_layout) { + // Number of inserts + $ninsert = (int) 0; - // Return from DB the items of the source layout - $data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout); + // Return from DB the source layout + $layout_src = db_get_all_rows_filter ("tlayout","id = " . $id_layout); - if (!empty($data_layout_src)) { + // Name of dst + $name_dst = get_parameter ("name_dst", $layout_src[0]['name'] . " copy"); + + // Create the new Console + $idGroup = $layout_src[0]['id_group']; + $background = $layout_src[0]['background']; + $height = $layout_src[0]['height']; + $width = $layout_src[0]['width']; + $visualConsoleName = $name_dst; + + $values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background, 'height' => $height, 'width' => $width); + $result = db_process_sql_insert('tlayout', $values); + + $idNewVisualConsole = $result; + + if ($result) { + $ninsert = 1; - //By default the id parent 0 is always 0. - $id_relations = array(0 => 0); + // Return from DB the items of the source layout + $data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout); - for ($a=0; $a < count($data_layout_src); $a++) { + if (!empty($data_layout_src)) { - // Changing the source id by the new visual console id - $data_layout_src[$a]['id_layout'] = $idNewVisualConsole; + //By default the id parent 0 is always 0. + $id_relations = array(0 => 0); - $old_id = $data_layout_src[$a]['id']; - - // Unsetting the source's id - unset($data_layout_src[$a]['id']); - - // Configure the cloned Console - $result = db_process_sql_insert('tlayout_data', $data_layout_src[$a]); - - $id_relations[$old_id] = 0; - - if ($result !== false) { - $id_relations[$old_id] = $result; - } - - if ($result) - $ninsert++; - }// for each item of console - - $inserts = count($data_layout_src) + 1; - - // If the number of inserts is correct, the copy is completed - if ($ninsert == $inserts) { - - //Update the ids of parents - $items = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $idNewVisualConsole); - - foreach ($items as $item) { - $new_parent = $id_relations[$item['parent_item']]; + for ($a=0; $a < count($data_layout_src); $a++) { - db_process_sql_update('tlayout_data', - array('parent_item' => $new_parent), array('id' => $item['id'])); + // Changing the source id by the new visual console id + $data_layout_src[$a]['id_layout'] = $idNewVisualConsole; + + $old_id = $data_layout_src[$a]['id']; + + // Unsetting the source's id + unset($data_layout_src[$a]['id']); + + // Configure the cloned Console + $result = db_process_sql_insert('tlayout_data', $data_layout_src[$a]); + + $id_relations[$old_id] = 0; + + if ($result !== false) { + $id_relations[$old_id] = $result; + } + + if ($result) + $ninsert++; + }// for each item of console + + $inserts = count($data_layout_src) + 1; + + // If the number of inserts is correct, the copy is completed + if ($ninsert == $inserts) { + + //Update the ids of parents + $items = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $idNewVisualConsole); + + foreach ($items as $item) { + $new_parent = $id_relations[$item['parent_item']]; + + db_process_sql_update('tlayout_data', + array('parent_item' => $new_parent), array('id' => $item['id'])); + } + + + ui_print_success_message(__('Successfully copied')); + db_clean_cache(); } - - + else { + ui_print_error_message(__('Not copied. Error copying data')); + } + } + else { + // If the array is empty the copy is completed ui_print_success_message(__('Successfully copied')); db_clean_cache(); } - else { - ui_print_error_message(__('Not copied. Error copying data')); - } } else { - // If the array is empty the copy is completed - ui_print_success_message(__('Successfully copied')); - db_clean_cache(); + ui_print_error_message(__('Not copied. Error copying data')); } } - else { - ui_print_error_message(__('Not copied. Error copying data')); - } - } $table->width = '98%'; @@ -146,7 +187,7 @@ $table->head[2] = __('Items'); // Fix: IW was the old ACL for report editing, now is RW //Only for RW flag -if (check_acl ($config['id_user'], 0, "RW")) { +if ($vconsoles_write || $vconsoles_manage) { $table->head[3] = __('Copy'); $table->head[4] = __('Delete'); } @@ -159,9 +200,9 @@ $table->align[3] = 'center'; $table->align[4] = 'center'; // Only display maps of "All" group if user is administrator -// or has "RR" privileges, otherwise show only maps of user group +// or has "VR" privileges, otherwise show only maps of user group $own_info = get_user_info ($config['id_user']); -if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "RR")) +if ($own_info['is_admin'] || $vconsoles_read) $maps = visual_map_get_user_layouts (); else $maps = visual_map_get_user_layouts ($config['id_user'], false, false, false); @@ -171,6 +212,9 @@ if (!$maps) { } else { foreach ($maps as $map) { + // ACL for the visual console permission + $vconsole_write = check_acl ($config['id_user'], $map['id_group'], "VW"); + $vconsole_manage = check_acl ($config['id_user'], $map['id_group'], "VM"); $data = array (); @@ -187,7 +231,7 @@ else { $data[2] = db_get_sql ("SELECT COUNT(*) FROM tlayout_data WHERE id_layout = ".$map['id']); // Fix: IW was the old ACL for report editing, now is RW - if (check_acl ($config['id_user'], 0, "RW")) { + if ($vconsole_write || $vconsole_manage) { if (!defined('METACONSOLE')) { $data[3] = ''.html_print_image ("images/copy.png", true).''; @@ -212,9 +256,7 @@ else { echo '
'; } -// Fix: IW was the old ACL to check for report editing, now is RW -//Only for RW flag -if (check_acl ($config['id_user'], 0, "RW")) { +if ($vconsoles_write || $vconsoles_manage) { if (!defined('METACONSOLE')) echo ''; else { diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php index bc0c7027e9..c59ab17934 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.data.php +++ b/pandora_console/godmode/reporting/visual_console_builder.data.php @@ -17,7 +17,23 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], 0, "RW")) { +// Visual console required +if (empty($visualConsole)) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; +} + +// ACL for the existing visual console +// if (!isset($vconsole_read)) +// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); +if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); +if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); + +if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit("ACL Violation", "Trying to access report builder"); require ("general/noaccess.php"); @@ -85,7 +101,7 @@ $groups = users_get_groups ($config['id_user'], 'RW'); $own_info = get_user_info($config['id_user']); // Only display group "All" if user is administrator // or has "RW" privileges -if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "RW")) +if ($own_info['is_admin'] || $vconsole_write || $vconsole_manage) $display_all_group = true; else $display_all_group = false; diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index 0311119deb..fdc2e41b60 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -17,7 +17,23 @@ global $config; // Login check check_login (); -if (! check_acl ($config['id_user'], 0, "RW")) { +// Visual console required +if (empty($visualConsole)) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; +} + +// ACL for the existing visual console +// if (!isset($vconsole_read)) +// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); +if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); +if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); + +if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit("ACL Violation", "Trying to access report builder"); require ("general/noaccess.php"); diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 0c1fc9b95c..0809aee4b8 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -17,7 +17,23 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], 0, "RW")) { +// Visual console required +if (empty($visualConsole)) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; +} + +// ACL for the existing visual console +// if (!isset($vconsole_read)) +// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); +if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); +if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); + +if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit("ACL Violation", "Trying to access report builder"); require ("general/noaccess.php"); diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index c7d9760690..449ba31136 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -18,25 +18,65 @@ global $statusProcessInDB; check_login (); -if (! check_acl ($config['id_user'], 0, "RW")) { +require_once ($config['homedir'] . '/include/functions_visual_map.php'); +require_once($config['homedir'] . "/include/functions_agents.php"); +enterprise_include_once('include/functions_visual_map.php'); + +// Retrieve the visual console id +set_unless_defined ($idVisualConsole, 0); // Set default +$idVisualConsole = get_parameter('id_visual_console', $idVisualConsole); + +// Visual console creation tab and actions +if ($activeTab == "data" && ($action == "new" || $action == "save")) { + $visualConsole = null; + + // General ACL + //$vconsole_read = check_acl ($config['id_user'], 0, "VR"); + $vconsole_write = check_acl ($config['id_user'], 0, "VW"); + $vconsole_manage = check_acl ($config['id_user'], 0, "VM"); +} +// Retrieving the visual console data +else if (!empty($idVisualConsole)) { + + // Load the visual console data + $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); + + // The visual console should exist. + if (empty($visualConsole)) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + return; + } + + // The default group id is 0 + set_unless_defined ($visualConsole['id_group'], 0); + + // ACL for the existing visual console + //$vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); + $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); + $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); +} +// The visual console should exist. +// The only exception is the visual console creation. +else { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + return; +} + +// This section is only to manage the visual console +if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit("ACL Violation", "Trying to access report builder"); require ("general/noaccess.php"); exit; } -require_once ($config['homedir'] . '/include/functions_visual_map.php'); -require_once($config['homedir'] . "/include/functions_agents.php"); -enterprise_include_once('include/functions_visual_map.php'); -$pure = (int)get_parameter('pure', 0); - -if (!empty($idVisualConsole)) { - $idVisualConsole = get_parameter('id_visual_console', $idVisualConsole); -} -else { - $idVisualConsole = get_parameter('id_visual_console', 0); -} +$pure = (int) get_parameter ('pure', 0); +$refr = (int) get_parameter ('refr', $config['vc_refr']); $id_layout = 0; @@ -53,8 +93,6 @@ $action = get_parameterBetweenListValues($action_name_parameter, $activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data'); -$refr = (int) get_parameter ('refr', $config['vc_refr']); - //Save/Update data in DB global $statusProcessInDB; @@ -71,16 +109,30 @@ switch ($activeTab) { case 'update': case 'save': - $idGroup = get_parameter('id_group'); - $background = get_parameter('background'); - $visualConsoleName = get_parameter('name'); + $idGroup = (int) get_parameter('id_group'); + $background = (string) get_parameter('background'); + $visualConsoleName = (string) get_parameter('name'); - $values = array('name' => $visualConsoleName, - 'id_group' => $idGroup, 'background' => $background); + // ACL for the new visual console + //$vconsole_read_new = check_acl ($config['id_user'], $idGroup, "VR"); + $vconsole_write_new = check_acl ($config['id_user'], $idGroup, "VW"); + $vconsole_manage_new = check_acl ($config['id_user'], $idGroup, "VM"); + + // The user should have permissions on the new group + if (!$vconsole_write_new && !$vconsole_manage_new) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; + } + + $values = array( + 'name' => $visualConsoleName, + 'id_group' => $idGroup, + 'background' => $background + ); // If the background is changed the size is reseted - $visualConsole = db_get_row_filter('tlayout', - array('id' => $idVisualConsole)); $background_now = $visualConsole['background']; if ($background_now != $background && $background) { $sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background); @@ -93,10 +145,18 @@ switch ($activeTab) { $result = false; if ($values['name'] != "" && $values['background']) $result = db_process_sql_update('tlayout', $values, array('id' => $idVisualConsole)); - if ($result !== false && $values['background']) { + if ($result !== false) { db_pandora_audit( "Visual console builder", "Update visual console #$idVisualConsole"); $action = 'edit'; $statusProcessInDB = array('flag' => true, 'message' => ui_print_success_message(__('Successfully update.'), '', true)); + + // Return the updated visual console + $visualConsole = db_get_row_filter('tlayout', + array('id' => $idVisualConsole)); + // Update the ACL + //$vconsole_read = $vconsole_read_new; + $vconsole_write = $vconsole_write_new; + $vconsole_manage = $vconsole_manage_new; } else { db_pandora_audit( "Visual console builder", "Fail update visual console #$idVisualConsole"); @@ -116,6 +176,14 @@ switch ($activeTab) { $action = 'edit'; $statusProcessInDB = array('flag' => true, 'message' => ui_print_success_message(__('Successfully created.'), '', true)); + + // Return the updated visual console + $visualConsole = db_get_row_filter('tlayout', + array('id' => $idVisualConsole)); + // Update the ACL + //$vconsole_read = $vconsole_read_new; + $vconsole_write = $vconsole_write_new; + $vconsole_manage = $vconsole_manage_new; } else { db_pandora_audit( "Visual console builder", "Fail try to create visual console"); @@ -125,13 +193,9 @@ switch ($activeTab) { } break; } - $visualConsole = db_get_row_filter('tlayout', - array('id' => $idVisualConsole)); break; case 'edit': - $visualConsole = db_get_row_filter('tlayout', - array('id' => $idVisualConsole)); $visualConsoleName = $visualConsole['name']; $idGroup = $visualConsole['id_group']; $background = $visualConsole['background']; @@ -147,13 +211,11 @@ switch ($activeTab) { json_encode(array()))); $delete_items = json_decode($delete_items_json, true); - $id_visual_console = (int)get_parameter( - 'id_visual_console', 0); if (!empty($delete_items)) { $result = (bool)db_process_sql_delete( 'tlayout_data', - array('id_layout' => $id_visual_console, + array('id_layout' => $idVisualConsole, 'id' => $delete_items)); } @@ -187,6 +249,10 @@ switch ($activeTab) { 'height' => $height), array('id' => $idVisualConsole)); + // Return the updated visual console + $visualConsole = db_get_row_filter('tlayout', + array('id' => $idVisualConsole)); + //Update elements in visual map $idsElements = db_get_all_rows_filter('tlayout_data', array('id_layout' => $idVisualConsole), array('id')); @@ -246,12 +312,10 @@ switch ($activeTab) { } break; } - $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); $visualConsoleName = $visualConsole['name']; $action = 'edit'; break; case 'wizard': - $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); $visualConsoleName = $visualConsole['name']; $background = $visualConsole['background']; switch ($action) { @@ -430,7 +494,6 @@ switch ($activeTab) { } break; case 'wizard_services': - $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); $visualConsoleName = $visualConsole['name']; switch ($action) { case 'update': @@ -453,9 +516,6 @@ switch ($activeTab) { case 'new': case 'update': case 'edit': - $visualConsole = db_get_row_filter('tlayout', - array('id' => $idVisualConsole)); - $visualConsoleName = $visualConsole['name']; $action = 'edit'; break; diff --git a/pandora_console/godmode/reporting/visual_console_builder.wizard.php b/pandora_console/godmode/reporting/visual_console_builder.wizard.php index 0487f70d27..0a2fcc94f4 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.wizard.php +++ b/pandora_console/godmode/reporting/visual_console_builder.wizard.php @@ -17,7 +17,23 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], 0, "RW")) { +// Visual console required +if (empty($visualConsole)) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; +} + +// ACL for the existing visual console +// if (!isset($vconsole_read)) +// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); +if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); +if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); + +if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit("ACL Violation", "Trying to access report builder"); require ("general/noaccess.php"); diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 5de0da1f0e..151247cb83 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -17,14 +17,41 @@ global $config; check_login (); -// Fix: IW was the old ACL to check for report editing, now is RW -if (! check_acl ($config['id_user'], 0, "RW")) { +$id_visual_console = get_parameter('id_visual_console', null); + +// WARNING: CHECK THE ENTIRE FUNCTIONALITY + +// Visual console id required +if (empty($id_visual_console)) { db_pandora_audit("ACL Violation", "Trying to access report builder"); require ("general/noaccess.php"); exit; } +// Get the group id for the ACL checks +$group_id = db_get_value('id_group', 'tlayout', 'id', $id_visual_console); +if ($group_id === false) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; +} + +// ACL for the existing visual console +// if (!isset($vconsole_read)) +// $vconsole_read = check_acl ($config['id_user'], $group_id, "VR"); +if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], $group_id, "VW"); +if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], $group_id, "VM"); + +if (!$vconsole_write && !$vconsole_manage) { + db_pandora_audit("ACL Violation", + "Trying to access report builder"); + require ("general/noaccess.php"); + exit; +} //Fix ajax to avoid include the file, 'functions_graph.php'. $ajax = true; @@ -39,8 +66,6 @@ enterprise_include_once('include/functions_visual_map.php'); $action = get_parameter('action'); $type = get_parameter('type'); -$id_visual_console = get_parameter('id_visual_console', null); - $id_element = get_parameter('id_element', null); $image = get_parameter('image', null); diff --git a/pandora_console/mobile/operation/visualmap.php b/pandora_console/mobile/operation/visualmap.php index def96a3c81..e7c2617fd7 100644 --- a/pandora_console/mobile/operation/visualmap.php +++ b/pandora_console/mobile/operation/visualmap.php @@ -16,12 +16,16 @@ require_once ('../include/functions_visual_map.php'); class Visualmap { private $correct_acl = false; - private $acl = "RR"; + private $acl = "VR"; private $id = 0; - private $visual_map = null; + private $visualmap = null; function __construct() { + + } + + private function checkVisualmapACL($groupID = 0) { $system = System::getInstance(); if ($system->checkACL($this->acl)) { @@ -39,17 +43,21 @@ class Visualmap { } public function show() { + $this->getFilters(); + + $this->visualmap = db_get_row('tlayout', + 'id', $this->id); + + if (empty($this->visualmap)) { + $this->show_fail_acl(); + } + + $this->checkVisualmapACL($this->visualmap['id_group']); if (!$this->correct_acl) { $this->show_fail_acl(); } - else { - $this->getFilters(); - - $this->visualmap = db_get_row('tlayout', - 'id', $this->id); - - $this->show_visualmap(); - } + + $this->show_visualmap(); } private function show_fail_acl() { diff --git a/pandora_console/mobile/operation/visualmaps.php b/pandora_console/mobile/operation/visualmaps.php index e08e6f34dd..f2f608a5d0 100644 --- a/pandora_console/mobile/operation/visualmaps.php +++ b/pandora_console/mobile/operation/visualmaps.php @@ -18,7 +18,7 @@ ob_get_clean(); //Fixed unused javascript code. class Visualmaps { private $correct_acl = false; - private $acl = "RR"; + private $acl = "VR"; private $default = true; private $default_filters = array(); From ae8789db9eff1cb3113ad162b01c013d52e17bec Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 9 Apr 2015 14:05:23 +0200 Subject: [PATCH 13/22] Changes and improvements on the ACL checks --- .../operation/agentes/networkmap.dinamic.php | 29 +- .../operation/agentes/networkmap.groups.php | 29 +- .../operation/agentes/networkmap.php | 463 +++++++++++------- .../operation/agentes/networkmap.topology.php | 29 +- .../operation/agentes/networkmap_list.php | 62 ++- .../operation/visual_console/render_view.php | 26 +- 6 files changed, 413 insertions(+), 225 deletions(-) diff --git a/pandora_console/operation/agentes/networkmap.dinamic.php b/pandora_console/operation/agentes/networkmap.dinamic.php index a51d659a48..edc5823803 100755 --- a/pandora_console/operation/agentes/networkmap.dinamic.php +++ b/pandora_console/operation/agentes/networkmap.dinamic.php @@ -19,7 +19,34 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], $store_group, "AR")) { +// Networkmap id required +if (!isset($id_networkmap)) { + db_pandora_audit("ACL Violation", + "Trying to access node graph builder"); + require ("general/noaccess.php"); + exit; +} + +// Get the group for ACL +if (!isset($store_group)) { + $store_group = db_get_value("store_group", "tnetwork_map", "id_networkmap", $id_networkmap); + if ($store_group === false) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } +} + +// ACL for the networkmap permission +if (!isset($networkmap_read)) + $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); +if (!isset($networkmap_write)) + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); +if (!isset($networkmap_manage)) + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + +if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) { db_pandora_audit("ACL Violation", "Trying to access node graph builder"); include ("general/noaccess.php"); diff --git a/pandora_console/operation/agentes/networkmap.groups.php b/pandora_console/operation/agentes/networkmap.groups.php index d21830cd02..b6004367c8 100644 --- a/pandora_console/operation/agentes/networkmap.groups.php +++ b/pandora_console/operation/agentes/networkmap.groups.php @@ -19,7 +19,34 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], $store_group, "AR")) { +// Networkmap id required +if (!isset($id_networkmap)) { + db_pandora_audit("ACL Violation", + "Trying to access node graph builder"); + require ("general/noaccess.php"); + exit; +} + +// Get the group for ACL +if (!isset($store_group)) { + $store_group = db_get_value("store_group", "tnetwork_map", "id_networkmap", $id_networkmap); + if ($store_group === false) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } +} + +// ACL for the networkmap permission +if (!isset($networkmap_read)) + $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); +if (!isset($networkmap_write)) + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); +if (!isset($networkmap_manage)) + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + +if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) { db_pandora_audit("ACL Violation", "Trying to access node graph builder"); include ("general/noaccess.php"); diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 8b9de395c0..3cc7512e0c 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -19,13 +19,6 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], 0, "AR")) { - db_pandora_audit("ACL Violation", - "Trying to access node graph builder"); - include ("general/noaccess.php"); - exit; -} - require_once ('include/functions_networkmap.php'); require_once ('include/functions_clippy.php'); @@ -42,16 +35,54 @@ $update_networkmap = get_parameter ('update_networkmap', 0); $recenter_networkmap = get_parameter ('recenter_networkmap', 0); $hidden_options = get_parameter ('hidden_options', 1); -if ($delete_networkmap) { - $result = networkmap_delete_networkmap($id_networkmap); - $message = ui_print_result_message ($result, - __('Network map deleted successfully'), - __('Could not delete network map'), '', true); +// ACL checks // +// New networkmap. +if ($add_networkmap) { + // ACL for the new network map + // $networkmap_read = check_acl ($config['id_user'], 0, "MR"); + $networkmap_write = check_acl ($config['id_user'], 0, "MW"); + $networkmap_manage = check_acl ($config['id_user'], 0, "MM"); + + if (!$networkmap_write && !$networkmap_manage) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } +} +// The networkmap exist. Should have id and store goup. +else { + // Networkmap id required + if (empty($id_networkmap)) { + db_pandora_audit("ACL Violation", + "Trying to access node graph builder"); + require ("general/noaccess.php"); + exit; + } + // Get the group for ACL + $store_group = db_get_value("store_group", "tnetwork_map", "id_networkmap", $id_networkmap); + if ($store_group === false) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } - $id_networkmap = 0; + // ACL for the general permission + $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + + if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) { + db_pandora_audit("ACL Violation", + "Trying to access node graph builder"); + include ("general/noaccess.php"); + exit; + } } +// Create if ($add_networkmap) { // Load variables $layout = 'radial'; @@ -100,81 +131,126 @@ if ($add_networkmap) { 'l2_network' => $l2_network ); $id_networkmap = networkmap_create_networkmap($values); - + $message = ui_print_result_message ($id_networkmap, __('Network map created successfully'), __('Could not create network map'), '', true); -} - -if ($save_networkmap || $update_networkmap) { - // Load variables - $layout = (string) get_parameter ('layout', 'radial'); - $depth = (string) get_parameter ('depth', 'all'); - $nooverlap = (bool) get_parameter ('nooverlap', 0); - $modwithalerts = (int) get_parameter ('modwithalerts', 0); - $hidepolicymodules = (int) get_parameter ('hidepolicymodules', 0); - $zoom = (float) get_parameter ('zoom', 1); - $ranksep = (float) get_parameter ('ranksep', 2.5); - $simple = (int) get_parameter ('simple', 0); - $regen = (int) get_parameter ('regen', 0); - $show_snmp_modules = (int) get_parameter ('show_snmp_modules', 0); - $font_size = (int) get_parameter ('font_size', 12); - $text_filter = get_parameter ('text_filter', ''); - $dont_show_subgroups = (bool)get_parameter ('dont_show_subgroups', 0); - $store_group = (int) get_parameter ('store_group', 0); - $group = (int) get_parameter ('group', 0); - $module_group = (int) get_parameter ('module_group', 0); - $center = (int) get_parameter ('center', 0); - $name = (string) get_parameter ('name', $activeTab); - $l2_network = (int) get_parameter ('l2_network', 0); - if ($save_networkmap) { - $result = networkmap_update_networkmap($id_networkmap, - array('name' => $name, - 'type' => $activeTab, - 'layout' => $layout, - 'nooverlap' => $nooverlap, - 'simple' => $simple, - 'regenerate' => $regen, - 'font_size' => $font_size, - 'store_group' => $store_group, - 'id_group' => $group, - 'id_module_group' => $module_group, - 'depth' => $depth, - 'only_modules_with_alerts' => $modwithalerts, - 'hide_policy_modules' => $hidepolicymodules, - 'zoom' => $zoom, - 'distance_nodes' => $ranksep, - 'text_filter' => $text_filter, - 'dont_show_subgroups' => $dont_show_subgroups, - 'center' => $center, - 'show_snmp_modules' => (int)$show_snmp_modules, - 'l2_network' => (int)$l2_network)); - + // Exit when the networkmap was not created + if ($id_networkmap === false) { + return; + } +} +// Action in existing networkmap +else if ($delete_networkmap || $save_networkmap || $update_networkmap) { + + // ACL for the network map + // if (!isset($networkmap_read)) + // $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); + if (!isset($networkmap_write)) + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); + if (!isset($networkmap_manage)) + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + + if (!$networkmap_write && !$networkmap_manage) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } + + // Actions // + + // Not used now. The new behaviour is delete the map posting to the list. + if ($delete_networkmap) { + $result = networkmap_delete_networkmap($id_networkmap); $message = ui_print_result_message ($result, - __('Network map saved successfully'), - __('Could not save network map'), '', true); + __('Network map deleted successfully'), + __('Could not delete network map'), '', true); + + return; } -} - -$networkmaps = networkmap_get_networkmaps('','', true, $strict_user); - -$nomaps = false; -if ($networkmaps === false) { - $nomaps = true; -} - -// If the map id is not defined, we set the first id of the active type -if (!$nomaps && $id_networkmap == 0) { - $networkmaps_of_type = networkmap_get_networkmaps('', $activeTab); - if ($networkmaps_of_type !== false) { - $id_networkmap = reset(array_keys($networkmaps_of_type)); - } -} - -if (!$update_networkmap && !$save_networkmap && $id_networkmap != 0) { - $networkmap_data = networkmap_get_networkmap($id_networkmap); + // Save updates the db data, update only updates the view. + if ($save_networkmap || $update_networkmap) { + // Load variables + $layout = (string) get_parameter ('layout', 'radial'); + $depth = (string) get_parameter ('depth', 'all'); + $nooverlap = (bool) get_parameter ('nooverlap', 0); + $modwithalerts = (int) get_parameter ('modwithalerts', 0); + $hidepolicymodules = (int) get_parameter ('hidepolicymodules', 0); + $zoom = (float) get_parameter ('zoom', 1); + $ranksep = (float) get_parameter ('ranksep', 2.5); + $simple = (int) get_parameter ('simple', 0); + $regen = (int) get_parameter ('regen', 0); + $show_snmp_modules = (int) get_parameter ('show_snmp_modules', 0); + $font_size = (int) get_parameter ('font_size', 12); + $text_filter = get_parameter ('text_filter', ''); + $dont_show_subgroups = (bool)get_parameter ('dont_show_subgroups', 0); + $store_group = (int) get_parameter ('store_group', 0); + $group = (int) get_parameter ('group', 0); + $module_group = (int) get_parameter ('module_group', 0); + $center = (int) get_parameter ('center', 0); + $name = (string) get_parameter ('name', $activeTab); + $l2_network = (int) get_parameter ('l2_network', 0); + + if ($save_networkmap) { + // ACL for the new network map + $networkmap_read_new = check_acl ($config['id_user'], $store_group, "MR"); + $networkmap_write_new = check_acl ($config['id_user'], $store_group, "MW"); + $networkmap_manage_new = check_acl ($config['id_user'], $store_group, "MM"); + + if (!$networkmap_write_new && !$networkmap_manage_new) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } + + $result = networkmap_update_networkmap($id_networkmap, + array('name' => $name, + 'type' => $activeTab, + 'layout' => $layout, + 'nooverlap' => $nooverlap, + 'simple' => $simple, + 'regenerate' => $regen, + 'font_size' => $font_size, + 'store_group' => $store_group, + 'id_group' => $group, + 'id_module_group' => $module_group, + 'depth' => $depth, + 'only_modules_with_alerts' => $modwithalerts, + 'hide_policy_modules' => $hidepolicymodules, + 'zoom' => $zoom, + 'distance_nodes' => $ranksep, + 'text_filter' => $text_filter, + 'dont_show_subgroups' => $dont_show_subgroups, + 'center' => $center, + 'show_snmp_modules' => (int)$show_snmp_modules, + 'l2_network' => (int)$l2_network)); + + $message = ui_print_result_message ($result, + __('Network map saved successfully'), + __('Could not save network map'), '', true); + + if ($result) { + // Save the new ACL permisison + $networkmap_read = $networkmap_read_new; + $networkmap_write = $networkmap_write_new; + $networkmap_manage = $networkmap_manage_new; + } + } + } +} + +if (!$update_networkmap && !$save_networkmap) { + $networkmap_data = networkmap_get_networkmap($id_networkmap); + if (empty($networkmap_data)) { + ui_print_error_message(__('There was an error loading the network map')); + return; + } + + // Load variables $layout = $networkmap_data['layout']; $depth = $networkmap_data['depth']; $nooverlap = (bool)$networkmap_data['nooverlap']; @@ -202,107 +278,128 @@ if ($recenter_networkmap) { } /* Main code */ + +$qs = http_build_query(array( + "sec" => "network", + "sec2" => "operation/agentes/networkmap_list" + )); +$href = "index.php?$qs"; + +$buttons['list'] = array('active' => false, 'text' => "" . + html_print_image("images/list.png", true, array ("title" => __('List'))) .""); + if ($pure == 1) { - $buttons['screen'] = array('active' => false, - 'text' => '' . - html_print_image("images/normal_screen.png", true, array ('title' => __('Normal screen'))) .''); + $qs = http_build_query(array( + "sec" => "network", + "sec2" => "operation/agentes/networkmap", + "id_networkmap" => $id_networkmap, + "tab" => $activeTab + )); + $href = "index.php?$qs"; + + $buttons['screen'] = array('active' => false, 'text' => "" . + html_print_image("images/normal_screen.png", true, array ('title' => __('Normal screen'))) .""); } else { - $buttons['screen'] = array('active' => false, - 'text' => '' . - html_print_image("images/full_screen.png", true, array ('title' => __('Full screen'))) .''); -} -if (($config['enterprise_installed']) && (!$strict_user)) { - $buttons['policies'] = array('active' => $activeTab == 'policies', - 'text' => '' . - html_print_image("images/policies_mc.png", true, array ("title" => __('Policies view'))) .''); -} - -$buttons['groups'] = array('active' => $activeTab == 'groups', - 'text' => '' . - html_print_image("images/group.png", true, array ("title" => __('Groups view'))) .''); - -$buttons['topology'] = array('active' => $activeTab == 'topology', - 'text' => '' . - html_print_image("images/op_network.png", true, array ("title" => __('Topology view'))) .''); - -$buttons['dinamic'] = array('active' => $activeTab == 'dinamic', - 'text' => '' . - html_print_image("images/dynamic_network_icon.png", true, array ("title" => __('Dynamic view'))) .''); - -if (!$strict_user) { - $buttons['radial_dinamic'] = array('active' => $activeTab == 'radial_dynamic', - 'text' => '' . - html_print_image("images/radial_dynamic_network_icon.png", true, array ("title" => __('Radial dynamic view'))) .''); -} - -$combolist = ''; - -$combolist .= html_print_select($networkmaps, 'id_networkmap', $id_networkmap, 'onchange:this.form.submit()', __('No selected'), 0, true, false, false, '', false, 'margin-top:4px; margin-left:3px; width:150px;'); - -$combolist .= html_print_input_hidden('hidden_options',$hidden_options, true); - -$combolist .= ''; - -$buttons['combolist'] = $combolist; - -if (check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) { - $buttons['addmap'] = array('active' => $activeTab == false, - 'text' => '' . - html_print_image("images/add_mc.png", true, array ("title" => __('Add map'))) .''); + $qs = http_build_query(array( + "sec" => "network", + "sec2" => "operation/agentes/networkmap", + "id_networkmap" => $id_networkmap, + "tab" => $activeTab, + "pure" => 1 + )); + $href = "index.php?$qs"; - if (!$nomaps && $id_networkmap != 0) { - $buttons['deletemap'] = array('active' => $activeTab == false, - 'text' => '' . - html_print_image("images/delete_mc.png", true, array ("title" => __('Delete map'))) .''); - - $buttons['savemap'] = array('active' => $activeTab == false, - 'text' => '' . - html_print_image("images/save_mc.png", true, array ("title" => __('Save map'))) .''); - } + $buttons['screen'] = array('active' => false, 'text' => "" . + html_print_image("images/full_screen.png", true, array ('title' => __('Full screen'))) .""); } +if ($networkmap_write || $networkmap_manage) { + + $qs = http_build_query(array( + "sec" => "network", + "sec2" => "operation/agentes/networkmap_list", + "id_networkmap" => $id_networkmap, + "delete_networkmap" => 1 + )); + $href = "index.php?$qs"; + + $buttons['deletemap'] = array('active' => false, 'text' => "" . + html_print_image("images/delete_mc.png", true, array ("title" => __('Delete map'))) .""); + + $qs = http_build_query(array( + "sec" => "network", + "sec2" => "operation/agentes/networkmap", + "id_networkmap" => $id_networkmap, + "save_networkmap" => 1, + "tab" => $activeTab, + "name" => $name, + "store_group" => $store_group, + "group" => $group, + "layout" => $layout, + "nooverlap" => $nooverlap, + "simple" => $simple, + "regen" => $regen, + "zoom" => $zoom, + "ranksep" => $$ranksep, + "font_size" => $font_size, + "depth" => $depth, + "modwithalerts" => $modwithalerts, + "text_filter" => $text_filter, + "dont_show_subgroups" => $dont_show_subgroups, + "hidepolicymodules" => $hidepolicymodules, + "module_group" => $module_group, + "hidden_options" => (int)$hidden_options, + "show_snmp_modules" => (int)$show_snmp_modules, + "l2_network" => (int)$l2_network, + "pure" => $pure + )); + $href = "index.php?$qs"; + + $buttons['savemap'] = array('active' => false, 'text' => "" . + html_print_image("images/save_mc.png", true, array ("title" => __('Save map'))) .''); +} + +// Disabled. It's a waste of resources to check the ACL of every networkmap +// for only provide a shorthand feature. +// $combolist = '
'; + +// $networkmaps = networkmap_get_networkmaps('','', true, $strict_user); +// if (empty($networkmaps)) +// $networkmaps = array(); + +// $combolist .= html_print_select($networkmaps, 'id_networkmap', $id_networkmap, +// 'onchange:this.form.submit()', '', 0, true, false, false, +// '', false, 'margin-top:4px; margin-left:3px; width:150px;'); + +// $combolist .= html_print_input_hidden('hidden_options',$hidden_options, true); + +// $combolist .= '
'; + +// $buttons['combolist'] = $combolist; + $title = ''; +$icon = "images/op_network.png"; switch ($activeTab) { case 'topology': $title = __('Topology view'); + $icon = "images/op_network.png"; break; case 'groups': $title = __('Groups view'); + $icon = "images/group.png"; break; case 'policies': $title = __('Policies view'); + $icon = "images/policies_mc.png"; break; case 'dinamic': $title = __('Dynamic view'); + $icon = "images/dynamic_network_icon.png"; break; - case 'radial_dinamic': + case 'radial_dynamic': $title = __('Radial dynamic view'); + $icon = "images/radial_dynamic_network_icon.png"; break; } @@ -311,7 +408,7 @@ if (!empty($name)) { } ui_print_page_header (__('Network map') . " - " . $title, - "images/op_network.png", false, "network_map", false, $buttons); + $icon, false, "network_map", false, $buttons); if ((tags_has_user_acl_tags()) && (!$strict_user)) { ui_print_tags_warning(); @@ -321,12 +418,6 @@ if ($delete_networkmap || $add_networkmap || $save_networkmap) { echo $message; } -if ($id_networkmap == 0) { - echo "
" . - __('There are no defined maps in this view') . "
"; - return; -} - // CONFIGURATION FORM echo "
"; @@ -498,24 +589,22 @@ $options_form .= ''; ui_toggle($options_form, __('Map options'), '', $hidden_options); -if ($id_networkmap != 0) { - switch ($activeTab) { - case 'groups': - require_once('operation/agentes/networkmap.groups.php'); - break; - case 'policies': - require_once(ENTERPRISE_DIR . '/operation/policies/networkmap.policies.php'); - break; - case 'dinamic': - require_once('operation/agentes/networkmap.dinamic.php'); - break; - case 'radial_dynamic': - require_once('operation/agentes/networkmap.dinamic.php'); - break; - default: - case 'topology': - require_once('operation/agentes/networkmap.topology.php'); - break; - } +switch ($activeTab) { + case 'groups': + require_once('operation/agentes/networkmap.groups.php'); + break; + case 'policies': + require_once(ENTERPRISE_DIR . '/operation/policies/networkmap.policies.php'); + break; + case 'dinamic': + require_once('operation/agentes/networkmap.dinamic.php'); + break; + case 'radial_dynamic': + require_once('operation/agentes/networkmap.dinamic.php'); + break; + default: + case 'topology': + require_once('operation/agentes/networkmap.topology.php'); + break; } ?> diff --git a/pandora_console/operation/agentes/networkmap.topology.php b/pandora_console/operation/agentes/networkmap.topology.php index f9799e84a0..29048be445 100644 --- a/pandora_console/operation/agentes/networkmap.topology.php +++ b/pandora_console/operation/agentes/networkmap.topology.php @@ -19,7 +19,34 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], $store_group, "AR")) { +// Networkmap id required +if (!isset($id_networkmap)) { + db_pandora_audit("ACL Violation", + "Trying to access node graph builder"); + require ("general/noaccess.php"); + exit; +} + +// Get the group for ACL +if (!isset($store_group)) { + $store_group = db_get_value("store_group", "tnetwork_map", "id_networkmap", $id_networkmap); + if ($store_group === false) { + db_pandora_audit("ACL Violation", + "Trying to accessnode graph builder"); + require ("general/noaccess.php"); + exit; + } +} + +// ACL for the networkmap permission +if (!isset($networkmap_read)) + $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); +if (!isset($networkmap_write)) + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); +if (!isset($networkmap_manage)) + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + +if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) { db_pandora_audit("ACL Violation", "Trying to access node graph builder"); include ("general/noaccess.php"); diff --git a/pandora_console/operation/agentes/networkmap_list.php b/pandora_console/operation/agentes/networkmap_list.php index 2bb25c7211..ccd003e8c6 100644 --- a/pandora_console/operation/agentes/networkmap_list.php +++ b/pandora_console/operation/agentes/networkmap_list.php @@ -19,7 +19,12 @@ global $config; check_login (); -if (! check_acl ($config['id_user'], 0, "AR")) { +// ACL for the general permission +$networkmaps_read = check_acl ($config['id_user'], 0, "MR"); +$networkmaps_write = check_acl ($config['id_user'], 0, "MW"); +$networkmaps_manage = check_acl ($config['id_user'], 0, "MM"); + +if (!$networkmaps_read && !$networkmaps_write && !$networkmaps_manage) { db_pandora_audit("ACL Violation", "Trying to access Networkmap builder"); if (is_ajax()) { @@ -45,10 +50,15 @@ if (is_ajax()) { foreach ($ids_networkmap as $id) { $store_group = (int) db_get_value('store_group', 'tnetwork_map', 'id_networkmap',$id_networkmap); - if (check_acl ($config['id_user'], $store_group, "RM")) { + // ACL + // $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + + if ($networkmap_manage) { $results[$id] = (bool) networkmap_delete_networkmap($id); } - else if (check_acl ($config['id_user'], $store_group, "RW")) { + else if ($networkmap_write) { $results[$id] = (bool) networkmap_delete_user_networkmap($config['id_user'], $id); } } @@ -74,12 +84,16 @@ $id_networkmap = get_parameter ('id_networkmap', 0); $delete_networkmap = get_parameter ('delete_networkmap', 0); if ($delete_networkmap) { - if (is_user_admin ($config['id_user'])){ + + // ACL + // $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + + if ($networkmap_manage || is_user_admin ($config['id_user'])) { $result = networkmap_delete_networkmap($id_networkmap); } - elseif (check_acl ($config['id_user'], 0, "RM")) { - $result = networkmap_delete_networkmap($id_networkmap); - }elseif (check_acl ($config['id_user'], 0, "RW")) { + else if ($networkmap_write) { $result = networkmap_delete_user_networkmap($config['id_user'], $id_networkmap); } $message = ui_print_result_message ($result, @@ -138,14 +152,13 @@ $table->style[1] = 'text-align: center;'; $table->style[2] = 'text-align: center;'; $table->style[3] = 'text-align: center;'; $table->style[4] = 'text-align: center;'; -$table->style[5] = 'text-align: center;'; $table->size = array(); $table->size[0] = '80%'; $table->size[1] = '60px'; $table->size[2] = '30px'; -if (check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) { +if ($networkmaps_write || $networkmaps_manage) { $table->size[3] = '30px'; $table->size[4] = '30px'; } @@ -154,11 +167,10 @@ $table->head = array(); $table->head[0] = __('Name'); $table->head[1] = __('Type'); $table->head[2] = __('Group'); -if (check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) { - $table->head[3] = __('Edit'); - $table->head[4] = __('Delete'); +if ($networkmaps_write || $networkmaps_manage) { + $table->head[3] = __('Delete'); // Checkbox to select all the another checkboxes - $table->head[5] = html_print_checkbox('check_delete_all', 0, false, true); + $table->head[4] = html_print_checkbox('check_delete_all', 0, false, true); } $id_groups = array_keys(users_get_groups()); @@ -187,32 +199,36 @@ else { $table->data = array(); foreach ($network_maps as $network_map) { // ACL - if (!check_acl ($config['id_user'], $network_map['store_group'], "RR")) + $networkmap_read = check_acl ($config['id_user'], $store_group, "MR"); + $networkmap_write = check_acl ($config['id_user'], $store_group, "MW"); + $networkmap_manage = check_acl ($config['id_user'], $store_group, "MM"); + + // ACL + if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) continue; // If enterprise not loaded then skip this code - if ($network_map['type'] == 'policies' and (!defined('PANDORA_ENTERPRISE'))) + if ($network_map['type'] == 'policies' && !defined('PANDORA_ENTERPRISE')) continue; - if (($network_map['type'] == 'radial_dynamic' || $network_map['type'] == 'policies') && ($strict_user)) { + if (($network_map['type'] == 'radial_dynamic' || $network_map['type'] == 'policies') && $strict_user) { continue; } $data = array(); - $data[0] = '' . $network_map['name'] . ''; + $data[0] = '' . $network_map['name'] . ''; $data[1] = $network_map['type']; $data[2] = ui_print_group_icon ($network_map['store_group'], true); - if (check_acl ($config['id_user'], $network_map['store_group'], "RW") || check_acl ($config['id_user'], $network_map['store_group'], "RM")) { - $data[3] = '' . html_print_image("images/config.png", true) . ''; - $data[4] = '' . html_print_image('images/cross.png', true) . ''; + if ($networkmap_write || $networkmap_manage) { + $data[3] = '' . html_print_image('images/cross.png', true) . ''; // The value of the checkbox will be the networkmap id to recover it in js to perform the massive deletion - $data[5] = html_print_checkbox('check_delete', $network_map['id_networkmap'], false, true); + $data[4] = html_print_checkbox('check_delete', $network_map['id_networkmap'], false, true); } else { $data[3] = ''; $data[4] = ''; - $data[5] = ''; } $table->data[] = $data; @@ -222,7 +238,7 @@ else { } // Create networkmap form -if (check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) { +if ($networkmaps_write || $networkmaps_manage) { $table_manage = new StdClass(); $table_manage->width = "100%"; $table_manage->style = array(); diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index 048f2e5f85..e4ae5c1d82 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -74,7 +74,12 @@ $bheight = $layout["height"]; $pure_url = "&pure=" . $config["pure"]; -if (! check_acl ($config["id_user"], $id_group, "RR")) { +// ACL +$vconsole_read = check_acl ($config["id_user"], $id_group, "VR"); +$vconsole_write = check_acl ($config["id_user"], $id_group, "VW"); +$vconsole_manage = check_acl ($config["id_user"], $id_group, "VM"); + +if (! $vconsole_read) { db_pandora_audit("ACL Violation", "Trying to access visual console without group access"); require ("general/noaccess.php"); @@ -89,7 +94,7 @@ $options['consoles_list']['text'] = html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) . ''; -if (check_acl ($config["id_user"], $id_group, "RW")) { +if ($vconsole_write || $vconsole_manage) { $url_base = 'index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&action='; $hash = md5($config["dbpass"] . $id_layout . $config["id_user"]); @@ -123,7 +128,7 @@ if (check_acl ($config["id_user"], $id_group, "RW")) { $options['view']['text'] = '' . html_print_image ("images/operation.png", true, array ("title" => __('View'))) .''; $options['view']['active'] = true; -if (!defined('METACONSOLE')) { +if (! defined('METACONSOLE')) { if ($config["pure"] == 0) { $options['pure']['text'] = '' . html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode'))) . ""; @@ -138,18 +143,15 @@ if (!defined('METACONSOLE')) { $options = array('view' => $options['view'], 'pure' => $options['pure']); } $options['pure']['active'] = false; -} - -//Set the hidden value for the javascript -if (defined('METACONSOLE')) { - html_print_input_hidden('metaconsole', 1); -} -else { + + //Set the hidden value for the javascript html_print_input_hidden('metaconsole', 0); ui_print_page_header ($layout_name, "images/visual_console.png", false, '', false, $options); } - - +else { + //Set the hidden value for the javascript + html_print_input_hidden('metaconsole', 1); +} visual_map_print_visual_map ($id_layout); From d25c32b76dc17488dec01a297d187a9a1e7ea428 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 9 Apr 2015 15:03:26 +0200 Subject: [PATCH 14/22] Added some lost columns to check the ACL permissions --- pandora_console/include/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 3183b8e6f5..e8cdef04b1 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1770,7 +1770,9 @@ function check_acl($id_user, $id_group, $access, $id_agent = 0) { tperfil.report_view, tperfil.report_edit, tperfil.report_management, tperfil.event_view, tperfil.event_edit, tperfil.event_management, - tperfil.agent_disable + tperfil.agent_disable, + tperfil.map_view, tperfil.map_edit, tperfil.map_management, + tperfil.vconsole_view, tperfil.vconsole_edit, tperfil.vconsole_management FROM tusuario_perfil, tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil AND tusuario_perfil.id_usuario = '%s'", $id_user); @@ -1785,7 +1787,9 @@ function check_acl($id_user, $id_group, $access, $id_agent = 0) { tperfil.report_view, tperfil.report_edit, tperfil.report_management, tperfil.event_view, tperfil.event_edit, tperfil.event_management, - tperfil.agent_disable + tperfil.agent_disable, + tperfil.map_view, tperfil.map_edit, tperfil.map_management, + tperfil.vconsole_view, tperfil.vconsole_edit, tperfil.vconsole_management FROM tusuario_perfil, tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil AND tusuario_perfil.id_usuario = '%s' From 7286bd012f07b178da80bbad69e64e4ab1dc504b Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 10 Apr 2015 00:01:10 +0200 Subject: [PATCH 15/22] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6af20ab4af..da36775146 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150409 +Version: 6.0dev-150410 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 1e228ac2e5..c39540c0a4 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150409" +pandora_version="6.0dev-150410" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 6b3be49ddb..a372bfc0d6 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150409'; +use constant AGENT_BUILD => '150410'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 316adac6e7..53496f3beb 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150409 +%define release 150410 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 336df4fe5c..4a27a78cc7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150409 +%define release 150410 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 17e4c43977..c5a1c22158 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150409} +{150410} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3798131fd9..472cf2de3c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150409)") +#define PANDORA_VERSION ("6.0dev(Build 150410)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fe8eb1c8dc..8e749457da 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150409))" + VALUE "ProductVersion", "(6.0dev(Build 150410))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c1a19db019..78d05dcf59 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150409 +Version: 6.0dev-150410 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 8cddc27284..e5341e00ae 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150409" +pandora_version="6.0dev-150410" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 0bcd684e9e..18e8d47bb9 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150409'; +$build_version = 'PC150410'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 44c0eaeac4..0e0ad9c374 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Fri, 10 Apr 2015 12:34:19 +0200 Subject: [PATCH 16/22] ACL fixes --- .../reporting/visual_console_builder.data.php | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php index c59ab17934..f3bf4a0399 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.data.php +++ b/pandora_console/godmode/reporting/visual_console_builder.data.php @@ -17,21 +17,24 @@ global $config; check_login (); -// Visual console required -if (empty($visualConsole)) { - db_pandora_audit("ACL Violation", - "Trying to access report builder"); - require ("general/noaccess.php"); - exit; +if (empty($idVisualConsole)) { + // ACL for the a new visual console + // if (!isset($vconsole_read)) + // $vconsole_read = check_acl ($config['id_user'], 0, "VR"); + if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], 0, "VW"); + if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], 0, "VM"); +} +else { + // ACL for the existing visual console + // if (!isset($vconsole_read)) + // $vconsole_read = check_acl ($config['id_user'], $idGroup, "VR"); + if (!isset($vconsole_write)) + $vconsole_write = check_acl ($config['id_user'], $idGroup, "VW"); + if (!isset($vconsole_manage)) + $vconsole_manage = check_acl ($config['id_user'], $idGroup, "VM"); } - -// ACL for the existing visual console -// if (!isset($vconsole_read)) -// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); -if (!isset($vconsole_write)) - $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); -if (!isset($vconsole_manage)) - $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit("ACL Violation", From 10c94d51d9c72551cde4bb5b590cf4f15e905db0 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Fri, 10 Apr 2015 12:34:42 +0200 Subject: [PATCH 17/22] Error fixes --- .../godmode/reporting/map_builder.php | 2 +- .../reporting/visual_console_builder.php | 35 +++++++++---------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 8b7fdb26d6..c1b8d5eaa0 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -260,7 +260,7 @@ if ($vconsoles_write || $vconsoles_manage) { if (!defined('METACONSOLE')) echo '
'; else { - echo ''; + echo ''; } html_print_input_hidden ('edit_layout', 1); html_print_submit_button (__('Create'), '', false, 'class="sub next"'); diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 449ba31136..f3ab691db0 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -26,8 +26,21 @@ enterprise_include_once('include/functions_visual_map.php'); set_unless_defined ($idVisualConsole, 0); // Set default $idVisualConsole = get_parameter('id_visual_console', $idVisualConsole); +if (!defined('METACONSOLE')) { + $action_name_parameter = 'action'; +} +else { + $action_name_parameter = 'action2'; +} + +$action = get_parameterBetweenListValues($action_name_parameter, + array('new', 'save', 'edit', 'update', 'delete', 'multiple_delete'), + 'new'); + +$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data'); + // Visual console creation tab and actions -if ($activeTab == "data" && ($action == "new" || $action == "save")) { +if (empty($idVisualConsole)) { $visualConsole = null; // General ACL @@ -35,8 +48,8 @@ if ($activeTab == "data" && ($action == "new" || $action == "save")) { $vconsole_write = check_acl ($config['id_user'], 0, "VW"); $vconsole_manage = check_acl ($config['id_user'], 0, "VM"); } -// Retrieving the visual console data -else if (!empty($idVisualConsole)) { +// The visual console exists +else if ($activeTab != 'data' || ($activeTab == 'data' && $action != 'new')) { // Load the visual console data $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); @@ -57,8 +70,6 @@ else if (!empty($idVisualConsole)) { $vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW"); $vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM"); } -// The visual console should exist. -// The only exception is the visual console creation. else { db_pandora_audit("ACL Violation", "Trying to access report builder"); @@ -74,25 +85,11 @@ if (!$vconsole_write && !$vconsole_manage) { exit; } - $pure = (int) get_parameter ('pure', 0); $refr = (int) get_parameter ('refr', $config['vc_refr']); $id_layout = 0; -if (!defined('METACONSOLE')) { - $action_name_parameter = 'action'; -} -else { - $action_name_parameter = 'action2'; -} - -$action = get_parameterBetweenListValues($action_name_parameter, - array('new', 'save', 'edit', 'update', 'delete', 'multiple_delete'), - 'new'); - -$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data'); - //Save/Update data in DB global $statusProcessInDB; From ddfb4ed2c4154fdf581bad198c3aafc8b23c1d3a Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Fri, 10 Apr 2015 14:10:12 +0200 Subject: [PATCH 18/22] Fixed a visual error --- pandora_console/operation/agentes/networkmap_list.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandora_console/operation/agentes/networkmap_list.php b/pandora_console/operation/agentes/networkmap_list.php index ccd003e8c6..585440ec7c 100644 --- a/pandora_console/operation/agentes/networkmap_list.php +++ b/pandora_console/operation/agentes/networkmap_list.php @@ -226,10 +226,6 @@ else { // The value of the checkbox will be the networkmap id to recover it in js to perform the massive deletion $data[4] = html_print_checkbox('check_delete', $network_map['id_networkmap'], false, true); } - else { - $data[3] = ''; - $data[4] = ''; - } $table->data[] = $data; } From 7d7b6ef02f240b4359f3c03e8e4bd822d305c32a Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Fri, 10 Apr 2015 19:16:06 +0200 Subject: [PATCH 19/22] Updated the help info --- .../include/help/en/help_profile.php | 119 +++++++++--------- .../include/help/es/help_profile.php | 33 ++--- 2 files changed, 79 insertions(+), 73 deletions(-) diff --git a/pandora_console/include/help/en/help_profile.php b/pandora_console/include/help/en/help_profile.php index 3dc910b699..58327eb36a 100644 --- a/pandora_console/include/help/en/help_profile.php +++ b/pandora_console/include/help/en/help_profile.php @@ -10,66 +10,71 @@

The following list defines what ACL control allows in each feature at the console:

- -
FeatureACL Control + +
FeatureACL Control -
View agent data (all tabs)AR -
Tactical viewAR -
Network map viewAR -
Group viewAR -
Create reportRW -
Create user custom-defined graphRW -
View report or custom graphRR -
Apply report templateRR -
Create report templateRM -
Create incidentIW -
Read incidentIR -
Delete IncidentIW -
Become owner of another incidentIM -
Delete incident of another userIM -
View eventER -
Validate/Comment eventEW -
Delete eventEM -
Execute responseEW -
Create incident from event (Response)EW&IW -
Manage responsePM -
Manage filtersEW -
Customize event columnsPM -
Change owner/Re-open eventEM -
View userAR -
SNMP Console viewAR -
Validate trapsIW -
MessageIW -
Cron jobs PM -
Tree view AR -
Update manager (Operation & Admin)PM +
View the agent's data (all tabs)AR +
Tactical ViewAR +
Group ViewAR +
Visual console editingRW +
Creating reportsRW +
Creating user-defined graphsRW +
Viewing reports, visual maps and custom graphsRR +
Applying report templatesRR +
Creating report templatesRM +
Creating incidentsIW +
Reading incidentsIR +
Deleting incidentsIW +
Becoming the owner of another user's incidentsIM +
Deleting another user's incidentsIM +
Viewing eventsER +
Validating and commenting eventsEW +
Deleting eventsEM +
Executing responsesEW +
Creating incidents from events (response)EW&IW +
Managing responsesPM +
Managing filtersEW +
Customizing event columnsPM +
Changing owners / reopen eventEM +
Viewing usersAR +
SNMP Console viewingAR +
Validating trapsIW +
MessagesIW +
Cron jobs PM +
Tree view AR +
Update Manager (operation and administration) PM
Extension Module GroupAR -
Agent managementAW -
Remote agent configuration managementAW -
Assign alerts to agentsLW -
Define, alter and delete alert templates, actions and commandsLM -
Group managementPM -
Create inventory modulesPM -
Module management (includes all suboptions)PM -
Massive management operationsAW -
Create agentAW -
Duplicate remote configurationsAW -
Downtime managementAW -
Alert managementLW -
User managementUM -
SNMP Console management (alerts and MIB load)PM -
Profile managementPM -
Server managementPM -
System auditPM +
Agent ManagementAW +
Remote Agent Configuration Management AW +
Assigning alerts to agentsLW +
Defining, altering and deleting alert templates, actions and commandsLM +
Group ManagementPM +
Creating inventory modulesPM +
Module Management (includes all suboptions)PM +
Massive Management Operations AW +
Creating agentsAW +
Duplicating remote configurationsAW +
Downtime ManagementAW +
Alert ManagementLW +
User ManagementUM +
SNMP Console Management (alerts and MIB loading)PM +
Profile ManagementPM +
Server ManagementPM +
System AuditPM
SetupPM -
Database maintanceDM -
Administrator extension menuPM -
Search barAR -
Policy managementAW -
Disable agent/module/alertAD -
View visual consoleVR +
Database MaintenanceDM +
Administrator Extension MenuPM +
Search BarAR +
Policy ManagementAW +
Disabling agents / modules / alertsAD +
Alerts validationLM&AR or AW&LW +
Network-map viewMR +
Network-map editionMW +
Deletion of owned network-mapMW +
Deletion of any network-mapMM +
Visual console viewVR
Visual console editionVW -
View network mapMR -
Network map editionMW +
Deletion of owned visual consoleVW +
Deletion of any visual consoleVM
diff --git a/pandora_console/include/help/es/help_profile.php b/pandora_console/include/help/es/help_profile.php index 3221309b06..88d035914c 100644 --- a/pandora_console/include/help/es/help_profile.php +++ b/pandora_console/include/help/es/help_profile.php @@ -13,16 +13,16 @@
- -
OperacionBit de acceso + +
OperaciónBit de acceso +
Ver datos agente (todas las vistas) AR
Vista táctica AR -
Vista mapas de red AR
Vista de grupos AR
Crear un visual console RW
Crear un informe RW -
Crear una grafica combinada RW -
Ver informe, grafica, etc RR +
Crear una gráfica combinada RW +
Ver informe, gráfica, etc RR
Aplicar una plantilla de informeRR
Crear una plantilla de informeRM
Crear incidente IW @@ -34,7 +34,7 @@
Validar/Comentar evento EW
Borrar evento EM
Ejecutar respuestasEW -
Crear incidencia a traves del evento (Respuesta) EW&IW +
Crear incidencia a través del evento (Respuesta) EW&IW
Gestionar respuestasPM
Gestionar filtrosEW
Personalizar columnas de eventosPM @@ -47,13 +47,13 @@
Tree view AR
Update manager (Operación y Administración) PM
Extension Module GroupAR -
Vista de gestion agente AW +
Vista de gestión agente AW
Edición del agente y de su .conf AW
Asignación de alertas ya creadas LW
Definir, modificar plantillas, comandos y acciones LM
Gestión de grupos PM -
Crear modulos de inventario PM -
Gestionar modulos (Incluidas todas las subopciones)PM +
Crear módulos de inventario PM +
Gestionar módulos (Incluidas todas las subopciones)PM
Operaciones masivas AW
Crear agente AW
Duplicar configuración remotaAW @@ -63,17 +63,18 @@
Gestión de consola SNMPPM
Gestión de perfilesPM
Gestión de servidoresPM -
Auditoría del sistema (edicion y visualizacion)PM +
Auditoría del sistema (edición y visualización)PM
Setup (todas las solapas inferiores incl) PM
Mantenimiento de la BBDD DM -
Extensiones administracion PM -
Barra busqueda AR +
Extensiones administración PM +
Barra búsqueda AR
Gestión de PolíticasAW
Desactivar agente/módulo/alertaAD -
Ver visual consoleVR -
Crear un vicual consoleVW -
Ver mapa de redMR -
Editar mapa de redMW +
Validar alertasLM&AR o AW&LW +
Vista de mapas de redMR +
Edición de mapas de redMW +
Borrado de mapas de red propiosMW +
Borrado de cualquier mapa de redMM
From ec514cd27e2dfd765fa9bdebb2175b26a2c24da8 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 11 Apr 2015 00:01:12 +0200 Subject: [PATCH 20/22] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index da36775146..1999626029 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150410 +Version: 6.0dev-150411 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index c39540c0a4..0596403640 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150410" +pandora_version="6.0dev-150411" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a372bfc0d6..04ed477038 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150410'; +use constant AGENT_BUILD => '150411'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 53496f3beb..acabe7f3e3 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150410 +%define release 150411 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 4a27a78cc7..ffca62d51b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150410 +%define release 150411 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c5a1c22158..86764a4fe4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150410} +{150411} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 472cf2de3c..cb252e88f6 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150410)") +#define PANDORA_VERSION ("6.0dev(Build 150411)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8e749457da..c801708616 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150410))" + VALUE "ProductVersion", "(6.0dev(Build 150411))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 78d05dcf59..e150d5ab44 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150410 +Version: 6.0dev-150411 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index e5341e00ae..47d0db7746 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150410" +pandora_version="6.0dev-150411" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 18e8d47bb9..92873982e5 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150410'; +$build_version = 'PC150411'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 0e0ad9c374..405a800396 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Sun, 12 Apr 2015 00:01:09 +0200 Subject: [PATCH 21/22] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 1999626029..d30dbe9c89 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150411 +Version: 6.0dev-150412 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 0596403640..eb1afc2044 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150411" +pandora_version="6.0dev-150412" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 04ed477038..418cba30d5 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150411'; +use constant AGENT_BUILD => '150412'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index acabe7f3e3..feb00205f4 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150411 +%define release 150412 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index ffca62d51b..11b412e884 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150411 +%define release 150412 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 86764a4fe4..b3725e791d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150411} +{150412} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index cb252e88f6..d497098ada 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150411)") +#define PANDORA_VERSION ("6.0dev(Build 150412)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c801708616..7dc87c672a 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150411))" + VALUE "ProductVersion", "(6.0dev(Build 150412))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e150d5ab44..1778d822c4 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150411 +Version: 6.0dev-150412 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 47d0db7746..ae24ef48c7 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150411" +pandora_version="6.0dev-150412" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 92873982e5..f9b713192e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150411'; +$build_version = 'PC150412'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 405a800396..9ed4893957 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Mon, 13 Apr 2015 00:01:09 +0200 Subject: [PATCH 22/22] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d30dbe9c89..d47d3b9ad6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150412 +Version: 6.0dev-150413 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index eb1afc2044..258af354ac 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150412" +pandora_version="6.0dev-150413" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 418cba30d5..b6c3c4846f 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150412'; +use constant AGENT_BUILD => '150413'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index feb00205f4..613338637a 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150412 +%define release 150413 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 11b412e884..d6d4eb4959 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150412 +%define release 150413 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b3725e791d..3f13f891aa 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150412} +{150413} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d497098ada..83960cdd3b 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.0dev(Build 150412)") +#define PANDORA_VERSION ("6.0dev(Build 150413)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7dc87c672a..c09822074b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150412))" + VALUE "ProductVersion", "(6.0dev(Build 150413))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 1778d822c4..4cd77e55aa 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150412 +Version: 6.0dev-150413 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index ae24ef48c7..1a4aacc89f 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150412" +pandora_version="6.0dev-150413" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f9b713192e..61e2905e02 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150412'; +$build_version = 'PC150413'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9ed4893957..c0920e36b5 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@