Exemplo n.º 1
0
function UfdbRequests($szDom, $szIp, $pipes, $CLASS, $ID)
{
    $sends = null;
    if ($szIp == "127.0.0.1") {
        return null;
    }
    $full = trim(ufdbgclient("http://{$szDom} {$szIp}/ - GET\n", $pipes));
    if ($GLOBALS["DEBUG"]) {
        WriteToSyslog("ufdbgclient:" . strlen($full) . " bytes...");
    }
    $t = time();
    if (strlen($full) > 3) {
        if (preg_match("#^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\$#", $GLOBALS["PDSNInUfdbWebsite"])) {
            $sends = "DATA\t{$szDom}\t{$CLASS}\tA\t10\t{$ID}\t{$GLOBALS["PDSNInUfdbWebsite"]}\n";
        } else {
            $sends = "DATA\t{$szDom}\t{$CLASS}\tCNAME\t10\t{$ID}\t{$GLOBALS["PDSNInUfdbWebsite"]}\n";
        }
    }
    return $sends;
}
Exemplo n.º 2
0
 $input = @explode(" ", $input);
 $UriRequested = $input[0];
 if ($GLOBALS["DEBUG"]) {
     WLOG("SCAN -> " . @implode("|", $input));
 }
 if (strpos(" {$UriRequested}", "cache_object://") > 0) {
     SetCache($KEY, "{$UriRequested}\n");
 }
 if (IsInCache($KEY)) {
     print "{$GLOBALS["CACHE"][$KEY]["URI"]}";
     flush();
 } else {
     $GLOBALS["ECHOED"] = false;
     $stop = false;
     if ($UfdbGuardEnabled == 1) {
         $UriRequested = trim(ufdbgclient($Source, $handleUfdbGuard, $pipes));
         if ($UriRequested == null) {
             $UriRequested = $input[0];
         }
         if ($GLOBALS["DEBUG"]) {
             WLOG("{$UriRequested} after ufdbguard...");
         }
         if (strpos($UriRequested, "exec.squidguard.php") > 0) {
             if ($GLOBALS["DEBUG"]) {
                 WLOG("BLOCK -> {$UriRequested} +CRLF");
             }
             SetCache($KEY, "{$UriRequested}\n");
             print $GLOBALS["CACHE"][$KEY]["URI"];
             //URL of my web server
             flush();
             $GLOBALS["ECHOED"] = true;