'.notifications_print_ball( $notifications_numbers['notifications'], $notifications_numbers['last_id'] ).'
'; // ======= Servers List =============================================== $servers_list = '
'; $servers = []; $servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver'); if ($servers['all'] != 0) { $servers['up'] = (int) servers_check_status(); $servers['down'] = ($servers['all'] - $servers['up']); if ($servers['up'] == 0) { // All Servers down or no servers at all. $servers_check_img = html_print_image('images/header_down_gray.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]); } else if ($servers['down'] != 0) { // Some servers down. $servers_check_img = html_print_image('images/header_warning_gray.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]); } else { // All servers up. $servers_check_img = html_print_image('images/header_ready_gray.png', true, ['alt' => 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]); } unset($servers); // Since this is the header, we don't like to trickle down variables. $servers_check_img_link = ''; $servers_check_img_link .= $servers_check_img; $servers_check_img_link .= ''; }; $servers_list .= $servers_check_img_link.'
'; // ======= Alerts =============================================== $check_minor_release_available = false; $pandora_management = check_acl($config['id_user'], 0, 'PM'); $check_minor_release_available = db_check_minor_relase_available(); if ($check_minor_release_available) { if (users_is_admin($config['id_user'])) { if ($config['language'] == 'es') { set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. '.__('Sobre actualización de revisión menor').'', 'Revisión/es menor/es disponible/s'); } else { set_pandora_error_for_header('There are one or more minor releases waiting for update. '.__('About minor release update').'', 'minor release/s available'); } } } // Chat messages. $header_chat = "
'; // Search $acl_head_search = true; if ($config['acl_enterprise'] == 1 && !users_is_admin()) { $acl_head_search = db_get_sql( "SELECT sec FROM tusuario INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')" ); } if ($acl_head_search) { // Search bar $search_bar = '
'; if (!isset($config['search_keywords'])) { $search_bar .= ''; } else { if (strlen($config['search_keywords']) == 0) { $search_bar .= ''; } else { $search_bar .= ''; } } $search_bar .= ''; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; $search_bar .= ""; $search_bar .= '
'; $header_searchbar = ''; } // ======= Autorefresh code ============================= $autorefresh_txt = ''; $autorefresh_additional = ''; $ignored_params = [ 'agent_config' => false, 'code' => false, ]; if (!isset($_GET['sec2'])) { $_GET['sec2'] = ''; } if (!isset($_GET['refr'])) { $_GET['refr'] = null; } $select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'"); $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { $do_refresh = true; if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { $do_refresh = false; } } if ($do_refresh) { $autorefresh_img = html_print_image('images/header_refresh_gray.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]); if ($_GET['refr']) { $autorefresh_txt .= ' ('.date('i:s', $config['refr']).')'; } $ignored_params['refr'] = ''; $values = get_refresh_time_array(); $autorefresh_additional = ''; unset($values); $autorefresh_link_open_img = ''; if ($_GET['refr']) { $autorefresh_link_open_txt = ''; } else { $autorefresh_link_open_txt = ''; } $autorefresh_link_close = ''; $display_counter = 'display:block'; } else { $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); $ignored_params['refr'] = false; $autorefresh_link_open_img = ''; $autorefresh_link_open_txt = ''; $autorefresh_link_close = ''; $display_counter = 'display:none'; } } else { $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); $ignored_params['refr'] = false; $autorefresh_link_open_img = ''; $autorefresh_link_open_txt = ''; $autorefresh_link_close = ''; $display_counter = 'display:none'; } $header_autorefresh = '
'.$autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close.'
'; $header_autorefresh_counter = '
'.$autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional.'
'; // Qr. if ($config['show_qr_code_header'] == 0) { $show_qr_code_header = 'display: none;'; } else { $show_qr_code_header = 'display: inline;'; } $header_qr = '
'; echo "'; ?> __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); } else { $header_user = html_print_image('images/header_user_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); } $header_user = '
'.$header_user.' ('.$config['id_user'].')
'; // Logout. $header_logout = '
'; $header_logout .= html_print_image('images/header_logout_gray.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]); $header_logout .= '
'; echo '
'.$header_autorefresh, $header_autorefresh_counter, $header_qr, $header_chat.'
'.$header_searchbar, $header_discovery, $servers_list.'
'.$header_user, $header_logout.'
'; ?>