コード例 #1
0
 } else {
     if (isset($filter_host) && $filter_host != "" && $filter_host != "undefined") {
         array_push($sql_filter, " (host IN (" . getSyslogHostFromCentreon($filter_host) . ")) ");
     } else {
         if ($is_admin) {
             array_push($sql_filter, " (host IN (" . getFullSyslogHostFromCentreon($collector, $aclHostString) . ")) ");
         } else {
             array_push($sql_filter, " (host IN (" . getAllSyslogHostFromCentreon($collector, $aclHostString) . ")) ");
         }
     }
 }
 if (isset($filter_facility)) {
     if (strcmp($filter_Ffacility, "") == 0 || strcmp($filter_Ffacility, "eq") == 0) {
         array_push($sql_filter, " (facility = '" . htmlentities($filter_facility, ENT_QUOTES) . "') ");
     } else {
         $list_facilities = getListOfFacilities($filter_facility, $filter_Ffacility);
         $list = "";
         $listKeys = array_keys($list_facilities);
         foreach ($list_facilities as $key => $value) {
             if (strcmp($list, "") != 0) {
                 $list .= ",";
             }
             $list .= "'" . $key . "'";
         }
         array_push($sql_filter, " (facility IN (" . $list . ")) ");
     }
 }
 if (isset($filter_severity)) {
     if (strcmp($filter_Fseverity, "") == 0 || strcmp($filter_Fseverity, "eq") == 0) {
         array_push($sql_filter, " (priority = '" . htmlentities($filter_severity, ENT_QUOTES) . "') ");
     } else {
コード例 #2
0
} else {
    if (isset($_GET['host']) && $_GET['host'] != "" && $_GET['host'] != "undefined") {
        array_push($sql_filter, " (host IN (" . getSyslogHostFromCentreon($_GET['host']) . ")) ");
    } else {
        if ($is_admin) {
            array_push($sql_filter, " (host IN (" . getFullSyslogHostFromCentreon($collector_id, $aclHostString) . ")) ");
        } else {
            array_push($sql_filter, " (host IN (" . getAllSyslogHostFromCentreon($collector_id, $aclHostString) . ")) ");
        }
    }
}
if (isset($_GET['facility']) && $_GET['facility'] != "" && $_GET['facility'] != "undefined") {
    if (strcmp($Ffacility_selected, "") == 0 || strcmp($Ffacility_selected, "eq") == 0) {
        array_push($sql_filter, " (facility = '" . htmlentities($_GET['facility'], ENT_QUOTES) . "') ");
    } else {
        $list_facilities = getListOfFacilities($_GET['facility'], $Ffacility_selected);
        $list = "";
        $listKeys = array_keys($list_facilities);
        foreach ($list_facilities as $key => $value) {
            if (strcmp($list, "") != 0) {
                $list .= ",";
            }
            $list .= "'" . $key . "'";
        }
        array_push($sql_filter, " (facility IN (" . $list . ")) ");
    }
}
if (isset($_GET['severity']) && $_GET['severity'] != "" && $_GET['severity'] != "undefined") {
    if (strcmp($Fseverity_selected, "") == 0 || strcmp($Fseverity_selected, "eq") == 0) {
        array_push($sql_filter, " (priority = '" . htmlentities($_GET['severity'], ENT_QUOTES) . "') ");
    } else {
コード例 #3
0
}
/*
 * Get filters
 */
$sql_filter = array();
if (isset($_GET['program']) && $_GET['program'] != "") {
    array_push($sql_filter, " (program = '" . htmlentities($_GET['program'], ENT_QUOTES) . "')  ");
}
if (isset($_GET['host']) && $_GET['host'] != "") {
    array_push($sql_filter, " (host = '" . htmlentities($_GET['host'], ENT_QUOTES) . "')  ");
}
if (isset($_GET['facility']) && $_GET['facility'] != "") {
    if (strcmp($_GET['Ffacility'], "") == 0 || strcmp($_GET['Ffacility'], "eq") == 0) {
        array_push($sql_filter, " (facility = '" . htmlentities($_GET['facility'], ENT_QUOTES) . "')  ");
    } else {
        $list_facilities = getListOfFacilities($_GET['facility'], $_GET['Ffacility']);
        $list = "";
        $listKeys = array_keys($list_facilities);
        foreach ($list_facilities as $key => $value) {
            if (strcmp($list, "") != 0) {
                $list .= ",";
            }
            $list .= "'" . $key . "'";
        }
        array_push($sql_filter, " (facility IN (" . $list . "))  ");
    }
}
if (isset($_GET['severity']) && $_GET['severity'] != "") {
    if (strcmp($_GET['Fseverity'], "") == 0 || strcmp($_GET['Fseverity'], "eq") == 0) {
        array_push($sql_filter, " (priority = '" . htmlentities($_GET['severity'], ENT_QUOTES) . "')  ");
    } else {