From 7e36a678e9d4e6ff6291bfb8f932d20879a1dce0 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 15 Nov 2021 18:54:28 +0100 Subject: [PATCH 1/2] Fix file erorrs and warns --- .../godmode/users/configure_profile.php | 101 ++++++++++-------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index a6bf49dcb1..ccc5f85466 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -1,17 +1,28 @@ [ @@ -79,46 +90,46 @@ if (!is_metaconsole()) { $new_profile = (bool) get_parameter('new_profile'); $id_profile = (int) get_parameter('id'); -// Edit profile +// Edit profile. if ($id_profile || $new_profile) { if ($new_profile) { - // Name + // Name. $name = ''; - // Agents + // Agents. $agent_view = 0; $agent_edit = 0; $agent_disable = 0; - // Alerts + // Alerts. $alert_edit = 0; $alert_management = 0; - // Users + // Users. $user_management = 0; - // DB + // DB. $db_management = 0; - // Pandora + // Pandora. $pandora_management = 0; - // Events + // Events. $event_view = 0; $event_edit = 0; $event_management = 0; - // Reports + // Reports. $report_view = 0; $report_edit = 0; $report_management = 0; - // Network maps + // Network maps. $map_view = 0; $map_edit = 0; $map_management = 0; - // Visual console + // Visual console. $vconsole_view = 0; $vconsole_edit = 0; $vconsole_management = 0; @@ -145,43 +156,43 @@ if ($id_profile || $new_profile) { exit; } - // Name + // Name. $name = $profile['name']; - // Agents + // Agents. $agent_view = (bool) $profile['agent_view']; $agent_edit = (bool) $profile['agent_edit']; $agent_disable = (bool) $profile['agent_disable']; - // Alerts + // Alerts. $alert_edit = (bool) $profile['alert_edit']; $alert_management = (bool) $profile['alert_management']; - // Users + // Users. $user_management = (bool) $profile['user_management']; - // DB + // DB. $db_management = (bool) $profile['db_management']; - // Pandora + // Pandora. $pandora_management = (bool) $profile['pandora_management']; - // Events + // Events. $event_view = (bool) $profile['event_view']; $event_edit = (bool) $profile['event_edit']; $event_management = (bool) $profile['event_management']; - // Reports + // Reports. $report_view = (bool) $profile['report_view']; $report_edit = (bool) $profile['report_edit']; $report_management = (bool) $profile['report_management']; - // Network maps + // Network maps. $map_view = (bool) $profile['map_view']; $map_edit = (bool) $profile['map_edit']; $map_management = (bool) $profile['map_management']; - // Visual console + // Visual console. $vconsole_view = (bool) $profile['vconsole_view']; $vconsole_edit = (bool) $profile['vconsole_edit']; $vconsole_management = (bool) $profile['vconsole_management']; @@ -249,14 +260,14 @@ if ($id_profile || $new_profile) { $table->style[0] = 'font-weight: bold'; $table->data = []; - // Name + // Name. $row = []; $row['name'] = __('Profile name'); $row['input'] = html_print_input_text('name', $name, '', 30, 60, true); $table->data['name'] = $row; $table->data[] = '
'; - // Agents + // Agents. $row = []; $row['name'] = __('View agents'); $row['input'] = html_print_checkbox('agent_view', 1, $agent_view, true); @@ -271,7 +282,7 @@ if ($id_profile || $new_profile) { $table->data['AW'] = $row; $table->data[] = '
'; - // Alerts + // Alerts. $row = []; $row['name'] = __('Edit alerts'); $row['input'] = html_print_checkbox('alert_edit', 1, $alert_edit, true); @@ -282,7 +293,7 @@ if ($id_profile || $new_profile) { $table->data['LM'] = $row; $table->data[] = '
'; - // Events + // Events. $row = []; $row['name'] = __('View events'); $row['input'] = html_print_checkbox('event_view', 1, $event_view, true); @@ -297,7 +308,7 @@ if ($id_profile || $new_profile) { $table->data['EM'] = $row; $table->data[] = '
'; - // Reports + // Reports. $row = []; $row['name'] = __('View reports'); $row['input'] = html_print_checkbox('report_view', 1, $report_view, true); @@ -312,7 +323,7 @@ if ($id_profile || $new_profile) { $table->data['RM'] = $row; $table->data[] = '
'; - // Network maps + // Network maps. $row = []; $row['name'] = __('View network maps'); $row['input'] = html_print_checkbox('map_view', 1, $map_view, true); @@ -327,7 +338,7 @@ if ($id_profile || $new_profile) { $table->data['MM'] = $row; $table->data[] = '
'; - // Visual console + // Visual console. $row = []; $row['name'] = __('View visual console'); $row['input'] = html_print_checkbox('vconsole_view', 1, $vconsole_view, true); @@ -347,7 +358,7 @@ if ($id_profile || $new_profile) { $disable_option = ''; } - // NCM + // NCM. $row = []; $row['name'] = __('View NCM data'); $row['input'] = html_print_checkbox('network_config_view', 1, $network_config_view, true); @@ -362,21 +373,21 @@ if ($id_profile || $new_profile) { $table->data['VM'] = $row; $table->data[] = '
'; - // Users + // Users. $row = []; $row['name'] = __('Manage users'); $row['input'] = html_print_checkbox('user_management', 1, $user_management, true, false, $disable_option); $table->data['UM'] = $row; $table->data[] = '
'; - // DB + // DB. $row = []; $row['name'] = __('Manage database'); $row['input'] = html_print_checkbox('db_management', 1, $db_management, true, false, $disable_option); $table->data['DM'] = $row; $table->data[] = '
'; - // Pandora + // Pandora. $row = []; $row['name'] = __('%s management', get_product_name()); $row['input'] = html_print_checkbox('pandora_management', 1, $pandora_management, true, false, $disable_option); From c47799a4f1fafe43b5a4f8b41123874f1ffd528c Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 15 Nov 2021 18:58:54 +0100 Subject: [PATCH 2/2] Fix missing visual console profile tokens --- pandora_console/godmode/users/configure_profile.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index ccc5f85466..467bd4703c 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -362,15 +362,15 @@ if ($id_profile || $new_profile) { $row = []; $row['name'] = __('View NCM data'); $row['input'] = html_print_checkbox('network_config_view', 1, $network_config_view, true); - $table->data['VR'] = $row; + $table->data['NR'] = $row; $row = []; $row['name'] = __('Operate NCM'); $row['input'] = html_print_checkbox('network_config_edit', 1, $network_config_edit, true, false, 'autoclick_profile_users(\'network_config_edit\', \'network_config_view\', \'false\')'); - $table->data['VW'] = $row; + $table->data['NW'] = $row; $row = []; $row['name'] = __('Manage NCM'); $row['input'] = html_print_checkbox('network_config_management', 1, $network_config_management, true, false, 'autoclick_profile_users(\'network_config_management\', \'network_config_view\', \'network_config_edit\')'); - $table->data['VM'] = $row; + $table->data['NM'] = $row; $table->data[] = '
'; // Users.