rewritte of .uk handler
This commit is contained in:
parent
35d4b8ff61
commit
518497bd1c
4 changed files with 20 additions and 60 deletions
|
@ -2,6 +2,7 @@
|
|||
- removed unused file denic.whois
|
||||
- added support for za.net and za.org, thanx
|
||||
to luca@clamav.net
|
||||
- rewritte of .uk handler
|
||||
|
||||
2005/07/22 David Saez <david@ols.es>
|
||||
- added CDIR to inetnum conversion for ip whois and
|
||||
|
|
|
@ -51,6 +51,7 @@ the following subkeys:
|
|||
expires -> expire date
|
||||
sponsor -> registry partner where the domain was
|
||||
registered
|
||||
referer -> sponsor's URL
|
||||
handle -> domain handle
|
||||
source -> who gives this information
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ function get_blocks ( $rawdata, $items )
|
|||
{
|
||||
|
||||
$r=array();
|
||||
$endtag="";
|
||||
$endtag='';
|
||||
|
||||
while (list($key,$val)=each($rawdata))
|
||||
{
|
||||
|
|
|
@ -38,74 +38,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
if(!defined("__UK_HANDLER__")) define("__UK_HANDLER__",1);
|
||||
|
||||
require_once('getdate.whois');
|
||||
require_once('generic3.whois');
|
||||
|
||||
class uk_handler extends Whois {
|
||||
|
||||
function parse ($data_str) {
|
||||
$items=array(
|
||||
"owner.organization" => "Registrant:",
|
||||
"owner.address" => "Registrant's Address:",
|
||||
"domain.name" => "Domain Name:",
|
||||
"domain.sponsor" => "Registrant's Agent:",
|
||||
"domain.created" => "Registered on:",
|
||||
"domain.changed" => "Last updated:",
|
||||
"domain.expires" => "Renewal Date:",
|
||||
"domain.status" => "Registration Status:"
|
||||
);
|
||||
function parse ($data_str) {
|
||||
|
||||
$r['rawdata']=$data_str['rawdata'];
|
||||
$items=array( 'owner.organization' => 'Registrant:',
|
||||
'owner.address' => "Registrant's Address:",
|
||||
'domain.created' => 'Registered on:',
|
||||
'domain.changed' => 'Last updated:',
|
||||
'domain.expires' => 'Renewal Date:',
|
||||
'domain.nserver' => 'Name servers listed in order:',
|
||||
'domain.sponsor' => "Registrant's Agent:"
|
||||
);
|
||||
|
||||
while (list($key, $val)=each($data_str["rawdata"])) {
|
||||
$val=trim($val);
|
||||
$r['rawdata']=$data_str['rawdata'];
|
||||
|
||||
if ($val!='') {
|
||||
if ($val=="Name servers listed in order:") {
|
||||
while (list($key, $val)=each($data_str["rawdata"])) {
|
||||
if (!($value=trim($val))) break;
|
||||
$r["regrinfo"]["domain"]["nserver"][]=$value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$r['regrinfo'] = get_blocks($data_str['rawdata'],$items);
|
||||
|
||||
reset($items);
|
||||
$r['regrinfo']['owner']['organization']=$r['regrinfo']['owner']['organization'][0];
|
||||
$r['regrinfo']['domain']['sponsor']=$r['regrinfo']['domain']['sponsor'][0];
|
||||
|
||||
while (list($field, $match)=each($items))
|
||||
if (strstr($val,$match)) {
|
||||
$v=trim(substr($val,strlen($match)));
|
||||
if ($v=="")
|
||||
{ $v=each($data_str["rawdata"]);
|
||||
$v=trim($v["value"]);
|
||||
}
|
||||
$parts=explode(".",$field);
|
||||
$var="\$r[\"regrinfo\"]";
|
||||
while (list($fn,$mn)=each($parts))
|
||||
$var=$var."[\"".$mn."\"]";
|
||||
unset($r['regrinfo']['domain']['nserver'][count($r['regrinfo']['domain']['nserver'])-1]);
|
||||
|
||||
eval($var."=\"".$v."\";");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$r['regyinfo']['referrer']='http://www.nic.uk';
|
||||
$r['regyinfo']['registrar']='Nominet UK';
|
||||
|
||||
if (!empty($r["regrinfo"]["domain"]["name"])) {
|
||||
$r["regrinfo"]["registered"] = "yes";
|
||||
|
||||
if (empty($r["regrinfo"]["domain"]["nserver"]))
|
||||
{
|
||||
if (strstr($r["regrinfo"]["domain"]["sponsor"],"DETAGGED"))
|
||||
$r["regrinfo"]["domain"]["status"]="detagged";
|
||||
else
|
||||
$r["regrinfo"]["domain"]["status"]="inactive";
|
||||
}
|
||||
}
|
||||
else
|
||||
$r["regrinfo"]["registered"] = "no";
|
||||
|
||||
format_dates($r,'dmy');
|
||||
return($r);
|
||||
$r=format_dates($r,'dmy');
|
||||
return $r;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue