if ($uid != null) { fwrite(STDOUT, "OK user={$uid}\n"); continue; } $uid = trim(GetMacToUid($array["IPADDR"])); if ($uid == $array["IPADDR"]) { $uid = null; } if ($uid != null) { fwrite(STDOUT, "OK user={$uid}\n"); continue; } fwrite(STDOUT, "OK\n"); continue; } if (CheckQuota($array)) { fwrite(STDOUT, "OK\n"); } else { WLOG("ERR \"Out of quota\""); fwrite(STDOUT, "ERR message=\"Out Of Quota\"\n"); } } } CleanSessions(); $distanceInSeconds = round(abs(time() - $GLOBALS["STARTIME"])); $distanceInMinutes = round($distanceInSeconds / 60); WLOG("v1.0:" . basename(__FILE__) . " die after ({$distanceInSeconds}s/about {$distanceInMinutes}mn)"); if (isset($GLOBALS["F"])) { @fclose($GLOBALS["F"]); } function CleanSessions()
WLOG($url); } $array = parseURL($url); if ($GLOBALS["DEBUG_LEVEL"] > 1) { WLOG($url . " str:" . strlen($url) . " bytes LOGIN:{$array["LOGIN"]},IPADDR:{$array["IPADDR"]} MAC:{$array["MAC"]} HOST:{$array["HOST"]} RHOST:{$array["RHOST"]}"); } if ($array["IPADDR"] == "127.0.0.1") { if (trim($array["LOGIN"]) == null) { if ($GLOBALS["DEBUG_LEVEL"] > 1) { WLOG("127.0.0.1 return always true..."); } fwrite(STDOUT, "OK\n"); continue; } } if (!CheckQuota($array)) { if ($GLOBALS["DEBUG_LEVEL"] > 1) { WLOG("Out Of Quota"); } fwrite(STDOUT, "ERR message=\"Out Of Quota\"\n"); continue; } if ($GLOBALS["DEBUG_LEVEL"] > 1) { WLOG("OK"); } fwrite(STDOUT, "OK\n"); continue; } if ($GLOBALS["DEBUG_LEVEL"] > 1) { WLOG("..."); }