mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
Move ipwhois to functions_admin
git-svn-id: file:///svn/phpbb/trunk@4648 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -204,6 +204,49 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
|
|||||||
return $matches;
|
return $matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whois facility
|
||||||
|
function ipwhois($ip)
|
||||||
|
{
|
||||||
|
$ipwhois = '';
|
||||||
|
|
||||||
|
$match = array(
|
||||||
|
'#RIPE\.NET#is' => 'whois.ripe.net',
|
||||||
|
'#whois\.apnic\.net#is' => 'whois.apnic.net',
|
||||||
|
'#nic\.ad\.jp#is' => 'whois.nic.ad.jp',
|
||||||
|
'#whois\.registro\.br#is' => 'whois.registro.br'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (($fsk = @fsockopen('whois.arin.net', 43)))
|
||||||
|
{
|
||||||
|
fputs($fsk, "$ip\n");
|
||||||
|
while (!feof($fsk))
|
||||||
|
{
|
||||||
|
$ipwhois .= fgets($fsk, 1024);
|
||||||
|
}
|
||||||
|
@fclose($fsk);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (array_keys($match) as $server)
|
||||||
|
{
|
||||||
|
if (preg_match($server, $ipwhois))
|
||||||
|
{
|
||||||
|
$ipwhois = '';
|
||||||
|
if (($fsk = @fsockopen($match[$server], 43)))
|
||||||
|
{
|
||||||
|
fputs($fsk, "$ip\n");
|
||||||
|
while (!feof($fsk))
|
||||||
|
{
|
||||||
|
$ipwhois .= fgets($fsk, 1024);
|
||||||
|
}
|
||||||
|
@fclose($fsk);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ipwhois;
|
||||||
|
}
|
||||||
|
|
||||||
// Posts and topics manipulation
|
// Posts and topics manipulation
|
||||||
function move_topics($topic_ids, $forum_id, $auto_sync = TRUE)
|
function move_topics($topic_ids, $forum_id, $auto_sync = TRUE)
|
||||||
{
|
{
|
||||||
|
@@ -585,53 +585,6 @@ class mcp extends module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ipwhois($ip)
|
|
||||||
{
|
|
||||||
$ipwhois = '';
|
|
||||||
|
|
||||||
$match = array(
|
|
||||||
'#RIPE\.NET#is' => 'whois.ripe.net',
|
|
||||||
'#whois\.apnic\.net#is' => 'whois.apnic.net',
|
|
||||||
'#nic\.ad\.jp#is' => 'whois.nic.ad.jp',
|
|
||||||
'#whois\.registro\.br#is' => 'whois.registro.br'
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($fsk = @fsockopen('whois.arin.net', 43))
|
|
||||||
{
|
|
||||||
@fputs($fsk, "$ip\n");
|
|
||||||
while (!feof($fsk))
|
|
||||||
{
|
|
||||||
$ipwhois .= fgets($fsk, 1024);
|
|
||||||
}
|
|
||||||
fclose($fsk);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (array_keys($match) as $server)
|
|
||||||
{
|
|
||||||
if (preg_match($server, $ipwhois))
|
|
||||||
{
|
|
||||||
$ipwhois = '';
|
|
||||||
if (($fsk = fsockopen($match[$server], 43)))
|
|
||||||
{
|
|
||||||
@fputs($fsk, "$ip\n");
|
|
||||||
while (!feof($fsk))
|
|
||||||
{
|
|
||||||
$ipwhois .= fgets($fsk, 1024);
|
|
||||||
}
|
|
||||||
fclose($fsk);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ipwhois;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// FUNCTIONS
|
// FUNCTIONS
|
||||||
// ---------
|
// ---------
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user