1 && in_array ($ev_group, array_keys ($groups))) { //If a group is selected and it's in the groups allowed $sql_post = " AND id_grupo = $ev_group"; } elseif (dame_admin ($config["id_user"])) { //Do nothing if you're admin, you get full access $sql_post = ""; $groups[0] = __('System Events'); } else { //Otherwise select all groups the user has rights to. $sql_post = " AND id_grupo IN (".implode (",", array_keys ($groups)).")"; } if ($status == 1) { $sql_post .= " AND estado = 1"; } elseif ($status == 0) { $sql_post .= " AND estado = 0"; } if ($search != "") $sql_post .= " AND evento LIKE '%".$search."%'"; if ($event_type != "") $sql_post .= " AND event_type = '".$event_type."'"; if ($severity != -1) $sql_post .= " AND criticity >= ".$severity; if ($id_agent != -1) $sql_post .= " AND id_agente = ".$id_agent; if ($id_event != -1) $sql_post .= " AND id_evento = ".$id_event; if ($id_user_ack != 0) $sql_post .= " AND id_usuario == '".$id_user_ack."'"; if ($event_view_hr > 0) { $unixtime = get_system_time () - ($event_view_hr * 3600); //Put hours in seconds $sql_post .= " AND utimestamp > ".$unixtime; } $url = "index.php?sec=eventos&sec2=operation/events/events&search=".rawurlencode($search)."&event_type=".$event_type."&severity=".$severity."&status=".$status."&ev_group=".$ev_group."&refr=".$config["refr"]."&id_agent=".$id_agent."&id_event=".$id_event."&pagination=".$pagination."&group_rep=".$group_rep."&event_view_hr=".$event_view_hr."&id_user_ack=".$id_user_ack; echo "