'; echo '
'.__('Group').' | '; echo ''; html_print_select_groups(false, "AR", true, "ag_group", $ag_group, 'this.form.submit();', '', '0', false, false, false, 'w130', false, 'width:150px;'); echo " | "; echo "".__('Monitor status')." | "; $fields = array (); $fields[0] = __('Normal'); $fields[1] = __('Warning'); $fields[2] = __('Critical'); $fields[3] = __('Unknown'); $fields[4] = __('Not normal'); //default $fields[5] = __('Not init'); html_print_select ($fields, "status", $status, 'this.form.submit();', __('All'), -1, false, false, true, '', false, 'width: 125px;'); echo ' | '; echo ''.__('Module group').' | '; echo ''; html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name", 'modulegroup', $modulegroup, 'this.form.submit();',__('All'), 0, false, false, true, false, 'width: 100px;'); echo ' |
'.__('Module name').' | '; echo ''; $user_groups = implode (",", array_keys (users_get_groups ())); switch ($config["dbtype"]) { case "mysql": case "postgresql": $profiles = db_get_all_rows_sql('SELECT id_grupo FROM tusuario_perfil AS t1 INNER JOIN tperfil AS t2 ON t1.id_perfil = t2.id_perfil WHERE t2.agent_view = 1 AND t1.id_usuario = \'' . $config['id_user'] . '\';'); if ($profiles === false) $profiles = array(); $id_groups = array(); $flag_all_group = false; foreach ($profiles as $profile) { if ($profile['id_grupo'] == 0) { $flag_all_group = true; } $id_groups[] = $profile['id_grupo']; } //The check of is_admin $flag_is_admin = (bool)db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); $sql = ' SELECT distinct(nombre) FROM tagente_modulo WHERE nombre <> \'delete_pending\' ' . $subquery_enterprise . ' AND id_agente IN ( SELECT id_agente FROM tagente WHERE'; if ($flag_is_admin || $flag_all_group) { $sql .= ' 1 = 1 '; } else { if (empty($id_groups)) { $sql .= ' 1 = 0 '; } else { $sql .= ' id_grupo IN (' . implode(',', $id_groups) . ') '; } } $sql .= ')'; break; case "oracle": $profiles = db_get_all_rows_sql('SELECT id_grupo FROM tusuario_perfil t1 INNER JOIN tperfil t2 ON t1.id_perfil = t2.id_perfil WHERE t2.agent_view = 1 AND t1.id_usuario = \'' . $config['id_user'] . '\';'); if ($profiles === false) $profiles = array(); $id_groups = array(); $flag_all_group = false; foreach ($profiles as $profile) { if ($profile['id_grupo'] == 0) { $flag_all_group = true; } $id_groups[] = $profile['id_grupo']; } //The check of is_admin $flag_is_admin = (bool)db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); $sql = ' SELECT distinct dbms_lob.substr(nombre,4000,1) as nombre FROM tagente_modulo WHERE dbms_lob.substr(nombre,4000,1) <> \'delete_pending\' ' . $subquery_enterprise . ' AND id_agente IN ( SELECT id_agente FROM tagente WHERE'; if ($flag_is_admin || $flag_all_group) { $sql .= ' 1 = 1 '; } else { if (empty($id_groups)) { $sql .= ' 1 = 0 '; } else { $sql .= ' id_grupo IN (' . implode(',', $id_groups) . ') '; } } $sql .= ')'; break; } $modules = db_get_all_rows_sql($sql); html_print_select (index_array ($modules, 'nombre', 'nombre'), "ag_modulename", $ag_modulename, 'this.form.submit();', __('All'), '', false, false, true, '', false, 'width: 150px;'); echo ' | '.__('Search').' | '; echo ''; html_print_input_text ("ag_freestring", $ag_freestring, '', 20,30, false); echo ' | '; html_print_submit_button (__('Show'), "uptbutton", false, 'class="sub search"'); echo " | |