http://custom.simplemachines.org/mods/index.php?mod=992very good system for files
It is needed to do determination of ip client which was connected and if this ip
not included in the list of present networks that to
forbid to begin to the swing and get files!!!
more detailed
http://ua-ix.com/eng.phtmlI insert a code somewhere, but for me does not turn out to do!!
$ip = getenv('REMOTE_ADDR');
here code
<?
// wget http://www.colocall.net/ua/?list -O ua-list.txt
function parse_net($ip)
{
sscanf ($ip, "%d.%d.%d.%d/%d", $one, $two, $three, $four, $mask);
$addr = $one*pow(2,24) + $two*pow(2,16) + $three*pow(2,8) + $four;
for ($i = 0; $i < round($mask); $i++) $bitmask += 1 << (31 - $i);
return array($addr, $addr+abs($bitmask));
}
function parse_ip($ip)
{
sscanf ($ip, "%d.%d.%d.%d", $one, $two, $three, $four);
return $one*pow(2,24) + $two*pow(2,16) + $three*pow(2,8) + $four;
}
function check_ip($ip)
{
$f=file('ua-list.txt');
$IP=parse_ip($ip);
foreach ($f as $net)
{
list($min,$max)=parse_net(trim($net));
if ($IP>=$min && $IP<$max) return true;
}
return false;
}
$ip=$_SERVER["argv"][1];
if (check_ip($ip)) echo "OK - host '$ip' in UA-IX\n";
else echo "FALSE - host '$ip' NOT in UA-IX\n";
?>
вот код download.php
http://2info.dp.ua/403/download.txt+ Downloads.english-utf8.php