$row) { $server_rows[$key]['server_name'] = $server['server_name']; } $rows = array_merge($rows, $server_rows); } metaconsole_restore_db(); } $countRows = count ($rows); //Empty Branch if ($countRows === 0) { echo ""; return; } //Branch with items $count = 0; echo "\n"; break; //also aknolegment as second subtree/branch case 'agent_group': case 'agent_module_group': case 'agent_os': case 'agent_policies': case 'agent_module': case 'agent_tag': $fatherType = str_replace('agent_', '', $type); if (defined ('METACONSOLE')) { $server = metaconsole_get_connection ($server_name); if (metaconsole_connect($server) != NOERR) { continue; } } $sql = treeview_getSecondBranchSQL ($fatherType, $id, $id_father); $rows = db_get_all_rows_sql($sql); if (empty($rows)) { $rows = array(); } $countRows = count ($rows); if ($countRows === 0) { echo ""; return; } $count = 0; echo "\n"; if (defined ('METACONSOLE')) { metaconsole_restore_db_force(); } break; } return; } //End of AJAX code. include_once($config['homedir'] . "/include/functions_groups.php"); include_once($config['homedir'] . "/include/functions_os.php"); include_once($config['homedir'] . "/include/functions_modules.php"); include_once($config['homedir'] . "/include/functions_servers.php"); include_once($config['homedir'] . "/include/functions_reporting.php"); include_once($config['homedir'] . "/include/functions_ui.php"); global $config; $pure = get_parameter('pure', 0); $enterpriseEnable = false; if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) { $enterpriseEnable = true; } ///////// INI MENU AND TABS ///////////// $img_style = array ("class" => "top", "width" => 16); $activeTab = get_parameter('sort_by','group'); $os_tab = array('text' => "" . html_print_image ("images/operating_system.png", true, array ("title" => __('OS'))) . "", 'active' => $activeTab == "os"); $group_tab = array('text' => "" . html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "", 'active' => $activeTab == "group"); $module_group_tab = array('text' => "" . html_print_image ("images/module_group.png", true, array ("title" => __('Module groups'))) . "", 'active' => $activeTab == "module_group"); if ($enterpriseEnable) { $policies_tab = array('text' => "" . html_print_image ("images/policies_mc.png", true, array ("title" => __('Policies'))) . "", 'active' => $activeTab == "policies"); } else { $policies_tab = ''; } $module_tab = array('text' => "" . html_print_image ("images/brick.png", true, array ("title" => __('Modules'))) . "", 'active' => $activeTab == "module"); $tags_tab = array('text' => "" . html_print_image ("images/tag.png", true, array ("title" => __('Tags'))) . "", 'active' => $activeTab == "tag"); switch ($activeTab) { case 'group': $order = __('groups'); break; case 'module_group': $order = __('module groups'); break; case 'policies': $order = __('policies'); break; case 'module': $order = __('modules'); break; case 'os': $order = __('OS'); break; case 'tag': $order = __('tags'); break; } if (! defined ('METACONSOLE')) { $onheader = array('tag' => $tags_tab, 'os' => $os_tab, 'group' => $group_tab, 'module_group' => $module_group_tab, 'policies' => $policies_tab, 'module' => $module_tab); ui_print_page_header (__('Tree view')." - ".__('Sort the agents by ') .$order, "images/extensions.png", false, "", false, $onheader); } else { ui_meta_add_breadcrumb(array('link' => 'index.php?sec=monitoring&sec2=operation/tree', 'text' => __('Tree View'))); ui_meta_print_page_header($nav_bar); $img_style = array ("class" => "top", "width" => 16); $activeTab = get_parameter('tab','group'); // Check if the loaded tab is allowed or not $allowed_tabs = array('group'); if ($config['enable_tags_tree']) { $allowed_tabs[] = 'tag'; } if (!in_array($activeTab, $allowed_tabs)) { db_pandora_audit("HACK Attempt", "Trying to access to not allowed tab on tree view"); include ("general/noaccess.php"); exit; } // End of tab check $group_tab = array('text' => "" . html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "", 'active' => $activeTab == "group"); $subsections['group'] = $group_tab; if($config['enable_tags_tree']) { $tags_tab = array('text' => "" . html_print_image ("images/tag.png", true, array ("title" => __('Tags'))) . "", 'active' => $activeTab == "tag"); $subsections['tag'] = $tags_tab; } switch ($activeTab) { case 'group': $subsection = __('Groups'); $tab = 'group'; break; case 'tag': $subsection = __('Tags'); $tab = 'tag'; break; } ui_meta_print_header(__("Tree view"), $subsection, $subsections); } if(tags_has_user_acl_tags()) { ui_print_tags_warning(); } echo "
"; if (! defined ('METACONSOLE')) { echo '"; echo "
"; echo "
"; echo "
"; ///////// END MENU AND TABS ///////////// echo "
"; ui_require_javascript_file('pandora_modules'); treeview_printTree($activeTab); enterprise_hook('close_meta_frame'); ui_require_jquery_file ("ui-timepicker-addon"); ui_require_javascript_file("i18n/jquery-ui-timepicker-" . get_user_language()); ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/"); ?>