handler update

This commit is contained in:
sparc 2006-12-19 08:12:33 +00:00
parent 3b92c96547
commit 13db6feb39
2 changed files with 44 additions and 24 deletions

View file

@ -37,29 +37,36 @@ class lt_handler
{
$translate = array(
'e-mail' => 'email',
'nic-hdl' => 'handle',
'person' => 'name'
'contact nic-hdl:' => 'handle',
'contact name:' => 'name'
);
$contacts = array(
'admin-c' => 'admin',
'tech-c' => 'tech',
'zone-c' => 'zone'
);
$items = array(
'admin' => 'Contact type: Admin',
'tech' => 'Contact type: Tech',
'zone' => 'Contact type: Zone',
'owner.name' => 'Registrar:',
'owner.email' => 'Registrar email:',
'domain.status' => 'Status:',
'domain.created' => 'Created:',
'domain.changed' => 'Last updated:',
'domain.nserver.' => 'NS:',
'' => '%'
);
$reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain', 'Ymd');
if (isset($reg['domain']['holder/descr']))
{
$owner = $reg['domain']['holder/descr'];
$reg['owner']['organization'] = $owner[0];
array_shift($owner);
$reg['owner']['address'] = $owner;
unset($reg['domain']['holder/descr']);
}
$r['regrinfo'] = get_blocks($data_str['rawdata'], $items);
if (isset($r['regrinfo']['admin']))
$r['regrinfo']['admin'] = get_contact($r['regrinfo']['admin'],$translate);
if (isset($r['regrinfo']['tech']))
$r['regrinfo']['tech'] = get_contact($r['regrinfo']['tech'],$translate);
if (isset($r['regrinfo']['zone']))
$r['regrinfo']['zone'] = get_contact($r['regrinfo']['zone'],$translate);
$r = format_dates($r,'ymd');
$r['regrinfo'] = $reg;
$r['regyinfo'] = array(
'referrer' => 'http://www.domreg.lt',
'registrar' => 'DOMREG.LT'

View file

@ -49,7 +49,7 @@ class nl_handler
'domain.sponsor' => 'Record maintained by:',
'owner' => 'Registrant:',
'admin' => 'Administrative contact:',
'tech' => 'Technical contact:',
'tech' => 'Technical contact(s):',
'zone' => 'Registrar:'
);
@ -64,15 +64,28 @@ class nl_handler
return $r;
}
$r['regrinfo']['tech'] = get_contact($r['regrinfo']['tech']);
$r['regrinfo']['owner'] = get_contact($r['regrinfo']['owner']);
$r['regrinfo']['admin'] = get_contact($r['regrinfo']['admin']);
$r['regrinfo']['zone'] = get_contact($r['regrinfo']['zone']);
$r['regrinfo']['tech'] = $this->get_contact($r['regrinfo']['tech']);
$r['regrinfo']['owner'] = $this->get_contact($r['regrinfo']['owner']);
$r['regrinfo']['admin'] = $this->get_contact($r['regrinfo']['admin']);
$r['regrinfo']['zone'] = $this->get_contact($r['regrinfo']['zone']);
$r['regrinfo']['registered'] = 'yes';
format_dates($r, 'dmy');
return ($r);
}
function get_contact($data)
{
$r = get_contact($data);
if (isset($r['name']) && preg_match('/^[A-Z0-9]+-[A-Z0-9]+$/',$r['name']))
{
$r['handle'] = $r['name'];
$r['name'] = array_shift ($r['address']);
}
return $r;
}
}
?>