Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: poxy

Parašė TaduXxX0· 2008 Bir. 13 16:06:02
#1

sveiki,gal kas žinote modą,kuris blokuotų žmones kurie yra su POXY? sis man neveikia:

class proxyfloodcheck {

var $timeout = 600;
var $maxconnects = 200;
var $count = 0;
var $proyx_online = "proxy_connects";

function floodcheck () {
$this->timestamp = time();
$this->ip = $this->ipCheck();
$this->new_proxy();
$this->delete_proxy();
$this->check_proxy();
}

function ipCheck() {
if(getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
}
elseif(getenv('HTTP_X_FORWARDED')) {
$ip = getenv('HTTP_X_FORWARDED');
}
else(getenv('HTTP_FORWARDED_FOR')) {
$ip = getenv('HTTP_FORWARDED_FOR');
}
return $ip;
}

function new_proxy() {
GLOBAL $ip, $path;
$path = $_SERVER['PHP_SELF'];
$ip = $this->ip;

IF(!empty($ip)) {
$insert = mysql_query("insert into $this->proyx_online(id, time, path, userip) values('', '$this->timestamp', '$path', '$this->ip')") or die("Proxy Query =".mysql_error());
}
}

function delete_proxy() {
$delete = mysql_query("delete from $this->proxy_online where $this->proxy_online.time < ($this->timestamp - $this->timeout)") or die("Proxy Query =".mysql_error());
}

function check_proxy() {
GLOBAL $maxconnects
$count = mysql_num_rows(mysql_query("select distinct $this->proxy_online.userip from $this->proxy_online"));

IF($count > $maxconnects) {
echo "Boo Badass $maxconnects You're pretty smart.<br>";
echo "<br>You're not allowed to use proxies, Please disable your proxies and revisit, Thanks $maxconnects Number of Online proxies= <br>";
exit;
}
}

}

floodcheck();



Redagavo TaduXxX0· 2008 Bir. 13 16:06:37