diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index a383de35c4..3d2db9994a 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -14,7 +14,7 @@ // Load global vars check_login(); -// Take some parameters (GET) +// Take some parameters (GET). $offset = (int) get_parameter('offset'); $group_id = (int) get_parameter('group_id'); $ag_group = get_parameter('ag_group_refresh', -1); @@ -47,10 +47,10 @@ require_once 'include/functions_users.php'; $search = get_parameter('search', ''); -// Prepare the tab system to the future +// Prepare the tab system to the future. $tab = 'view'; -// Setup tab +// Setup tab. $viewtab['text'] = ''.html_print_image('images/operation.png', true, ['title' => __('View')]).''; $viewtab['operation'] = true; @@ -59,10 +59,10 @@ $viewtab['active'] = false; $onheader = ['view' => $viewtab]; -// Header +// Header. ui_print_page_header(__('Agents defined in %s', get_product_name()), 'images/agent_mc.png', false, '', true, $onheader); -// Perform actions +// Perform actions. $agent_to_delete = (int) get_parameter('borrar_agente'); $enable_agent = (int) get_parameter('enable_agent'); $disable_agent = (int) get_parameter('disable_agent'); @@ -99,7 +99,7 @@ if ($agent_to_delete) { ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.')); if (enterprise_installed()) { - // Check if the remote config file still exist + // Check if the remote config file still exist. if (isset($config['remote_config'])) { enterprise_include_once('include/functions_config_agents.php'); if (enterprise_hook('config_agents_has_remote_configuration', [$id_agente])) { @@ -114,7 +114,7 @@ if ($enable_agent) { $alias = agents_get_alias($enable_agent); if ($result) { - // Update the agent from the metaconsole cache + // Update the agent from the metaconsole cache. enterprise_include_once('include/functions_agents.php'); $values = ['disabled' => 0]; enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]); @@ -136,7 +136,7 @@ if ($disable_agent) { $alias = agents_get_alias($disable_agent); if ($result) { - // Update the agent from the metaconsole cache + // Update the agent from the metaconsole cache. enterprise_include_once('include/functions_agents.php'); $values = ['disabled' => 1]; enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]); @@ -223,6 +223,10 @@ switch ($config['dbtype']) { case 'oracle': $order_collation = ''; break; + + default: + // Default. + break; } $selected = true; @@ -252,6 +256,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -274,6 +282,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -296,6 +308,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -318,6 +334,10 @@ switch ($sortField) { 'order' => 'DESC', ]; break; + + default: + // Default. + break; } break; @@ -378,7 +398,7 @@ if ($os != 0) { } $user_groups_to_sql = ''; -// Show only selected groups +// Show only selected groups. if ($ag_group > 0) { $ag_groups = []; $ag_groups = (array) $ag_group; @@ -388,7 +408,7 @@ if ($ag_group > 0) { $user_groups_to_sql = implode(',', $ag_groups); } else { - // Concatenate AW and AD permisions to get all the possible groups where the user can manage + // Concatenate AW and AD permisions to get all the possible groups where the user can manage. $user_groupsAW = users_get_groups($config['id_user'], 'AW'); $user_groupsAD = users_get_groups($config['id_user'], 'AD'); @@ -431,24 +451,25 @@ $sql = sprintf( $agents = db_get_all_rows_sql($sql); -// Delete rnum row generated by oracle_recode_query() function +// Delete rnum row generated by oracle_recode_query() function. if (($config['dbtype'] == 'oracle') && ($agents !== false)) { for ($i = 0; $i < count($agents); $i++) { unset($agents[$i]['rnum']); } } -// Prepare pagination +// Prepare pagination. ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); if ($agents !== false) { // Urls to sort the table. - // Agent name size and description for Chinese and Japanese languages are adjusted - $agent_font_size = '7'; - $description_font_size = '6.5'; - if ($config['language'] == 'ja' || $config['language'] == 'zh_CN' || $own_info['language'] == 'ja' || $own_info['language'] == 'zh_CN') { - $agent_font_size = '15'; - $description_font_size = '11'; + if ($config['language'] == 'ja' + || $config['language'] == 'zh_CN' + || $own_info['language'] == 'ja' + || $own_info['language'] == 'zh_CN' + ) { + // Adds a custom font size for Japanese and Chinese language. + $custom_font_size = 'custom_font_size'; } $url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled'; @@ -476,21 +497,21 @@ if ($agents !== false) { $rowPair = true; $iterator = 0; foreach ($agents as $agent) { - // Begin Update tagente.remote 0/1 with remote agent function return + // Begin Update tagente.remote 0/1 with remote agent function return. if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) { db_process_sql_update('tagente', ['remote' => 1], 'id_agente = '.$agent['id_agente'].''); } else { db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].''); } - // End Update tagente.remote 0/1 with remote agent function return + // End Update tagente.remote 0/1 with remote agent function return. $all_groups = agents_get_all_groups_agent($agent['id_agente'], $agent['id_grupo']); $check_aw = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW'); $check_ad = check_acl_one_of_groups($config['id_user'], $all_groups, 'AD'); $cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']); - // Do not show the agent if there is not enough permissions + // Do not show the agent if there is not enough permissions. if (!$check_aw && !$check_ad) { continue; } @@ -512,7 +533,7 @@ if ($agents !== false) { $rowPair = !$rowPair; $iterator++; - // Agent name + // Agent name. echo "