$msg] ); } /** * Checks if target method is available to be called using AJAX. * * @param string $method Target method. * * @return boolean True allowed, false not. */ public function ajaxMethod($method) { global $config; // Check access. check_login(); return in_array($method, $this->AJAXMethods); } /** * Constructor. * * @param string $ajax_controller Controller. * * @return object * @throws Exception On error. */ public function __construct( $ajax_controller='include/ajax/order_interpreter' ) { global $config; $this->ajaxController = $ajax_controller; $this->pages_menu = [ [ 'name' => __('Tactical View'), 'icon' => ui_get_full_url( 'images/op_monitoring.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=view&sec2=operation/agentes/tactical' ), 'acl' => check_acl( $config['id_user'], 0, 'AR' ) || check_acl( $config['id_user'], 0, 'AW' ), ], [ 'name' => __('Agent Management'), 'icon' => ui_get_full_url( 'images/gm_resources.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente' ), 'acl' => check_acl( $config['id_user'], 0, 'AW' ) && check_acl( $config['id_user'], 0, 'AD' ), ], [ 'name' => __('General Setup'), 'icon' => ui_get_full_url( 'images/gm_setup.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=general&sec2=godmode/setup/setup§ion=general' ), 'acl' => check_acl( $config['id_user'], 0, 'PM' ) || is_user_admin( $config['id_user'] ), ], [ 'name' => __('Manage Policies'), 'icon' => ui_get_full_url( 'images/gm_configuration.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies' ), 'acl' => check_acl( $config['id_user'], 0, 'AW' ), ], [ 'name' => __('List Alerts'), 'icon' => ui_get_full_url( 'images/gm_alerts.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=galertas&sec2=godmode/alerts/alert_list' ), 'acl' => check_acl( $config['id_user'], 0, 'LW' ) || check_acl( $config['id_user'], 0, 'AD' ) || check_acl( $config['id_user'], 0, 'LM' ), ], [ 'name' => __('View Events'), 'icon' => ui_get_full_url( 'images/op_events.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=eventos&sec2=operation/events/events' ), 'acl' => check_acl( $config['id_user'], 0, 'ER' ) || check_acl( $config['id_user'], 0, 'EW' ) || check_acl( $config['id_user'], 0, 'EM' ), ], [ 'name' => __('Dashboard'), 'icon' => ui_get_full_url( 'images/op_reporting.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=reporting&sec2=operation/dashboard/dashboard' ), 'acl' => check_acl( $config['id_user'], 0, 'RR' ), ], [ 'name' => __('Visual Console'), 'icon' => ui_get_full_url( 'images/op_network.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=network&sec2=godmode/reporting/map_builder' ), 'acl' => check_acl( $config['id_user'], 0, 'VR' ), ], [ 'name' => __('Manage Servers'), 'icon' => ui_get_full_url( 'images/gm_servers.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=gservers&sec2=godmode/servers/modificar_server' ), 'acl' => check_acl( $config['id_user'], 0, 'AW' ), ], [ 'name' => __('Edit User'), 'icon' => ui_get_full_url( 'images/gm_users.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=workspace&sec2=operation/users/user_edit' ), 'acl' => true, ], [ 'name' => __('Tree View'), 'icon' => ui_get_full_url( 'images/op_monitoring.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=view&sec2=operation/tree' ), 'acl' => true, ], [ 'name' => __('Network Component'), 'icon' => ui_get_full_url( 'images/gm_configuration.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' ), 'acl' => check_acl( $config['id_user'], 0, 'PM' ), ], [ 'name' => __('Task List'), 'icon' => ui_get_full_url( 'images/gm_discovery.menu.png' ), 'url' => ui_get_full_url( 'index.php?sec=discovery&sec2=godmode/servers/discovery&wiz=tasklist' ), 'acl' => check_acl( $config['id_user'], 0, 'AR' ) || check_acl( $config['id_user'], 0, 'AW' ) || check_acl( $config['id_user'], 0, 'AM' ) || check_acl( $config['id_user'], 0, 'RR' ) || check_acl( $config['id_user'], 0, 'RW' ) || check_acl( $config['id_user'], 0, 'RM' ) || check_acl( $config['id_user'], 0, 'PM' ), ], [ 'name' => __('Update Manager'), 'icon' => ui_get_full_url( 'images/um_messages.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup' ), 'acl' => check_acl( $config['id_user'], 0, 'PM' ) && is_user_admin($config['id_user']), ], [ 'name' => __('Manage Agent Groups'), 'icon' => ui_get_full_url( 'images/gm_users.menu_gray.png' ), 'url' => ui_get_full_url( 'index.php?sec=gagente&sec2=godmode/groups/group_list&tab=groups' ), 'acl' => check_acl( $config['id_user'], 0, 'PM' ), ], ]; } /** * Method to print order interpreted on header search input. * * @return void */ public function getResult() { global $config; // Take value from input search. $text = get_parameter('text', ''); $enterprise = (bool) get_parameter('enterprise', false); $iterator = 0; $more_results = 0; if ($text !== '') { echo '
'; echo ''; if ($iterator > 10) { echo '
+ '.$more_results.' '.__('results found').'
'; } if ($iterator === 0) { echo __('No results found'); } echo '
'; } } /** * Determines if the element must be shown or not. * * @param boolean $isEnterprise Define if the console is Enterprise. * @param string $url Url of the element for select. * * @return boolean */ private function canShowItem(bool $isEnterprise, string $url) { $canShow = false; $hasEnterpriseLocation = strpos($url, '&sec2=enterprise') !== false; if (($isEnterprise === false && $hasEnterpriseLocation === false) || $isEnterprise === true) { $canShow = true; } return $canShow; } /** * Load JS content. * function to create JS actions. * * @return string HTML code for javascript functionality. */ public function loadJS() { ob_start(); ?>