*/ /* esnic.whois 1.1 David Saez Padros */ /* * requires https support, please see: * * http://www.php.net/manual/en/ref.openssl.php * http://www.php.net/manual/en/wrappers.php * */ if (!defined('__ES_HANDLER__')) define('__ES_HANDLER__', 1); require_once('whois.parser.php'); class es_handler { function parse($data_str, $query) { $items = array( 'domain.name' => 'Dominio:', 'domain.created' => 'Fecha de registro:', 'domain.expires' => 'Fecha de caducidad:', 'domain.nserver.0' => 'DNS primaria:', 'domain.nserver.1' => 'DNS secundaria:', 'owner.name' => 'Registrante:', 'admin' => 'Contacto administrativo:', 'billing' => 'Contacto de cobro:', 'tech' => 'Contacto técnico:' ); $extra = array( 'e.:' => 'email', 't.:' => 'phone', 'f.:' => 'fax' ); $rawdata = array(); $data_ok = false; $final = false; while (list($key, $val) = each($data_str['rawdata'])) { if (substr($val,0,9)=='Dominio: ') $data_ok = true; else if (!$data_ok) continue; if (substr($val,0,4)=='DNS ') $final = true; if ($val=='' && $final) break; $rawdata[] = $val; } $r['regrinfo'] = get_blocks($rawdata, $items); if (isset($r['regrinfo']['admin'])) $items['admin'].=' '.$r['regrinfo']['admin']; if (isset($r['regrinfo']['billing'])) $items['billing'].=' '.$r['regrinfo']['billing']; if (isset($r['regrinfo']['tech'])) $items['tech'].=' '.$r['regrinfo']['tech']; $r['regrinfo'] = get_blocks($rawdata, $items); $r['rawdata'] = $rawdata; if (isset($r['regrinfo']['domain']['name'])) { $r['regrinfo']['admin'] = get_contact($r['regrinfo']['admin'], $extra); $r['regrinfo']['billing'] = get_contact($r['regrinfo']['billing'], $extra); $r['regrinfo']['tech'] = get_contact($r['regrinfo']['tech'], $extra); $r['regrinfo']['registered'] = 'yes'; } else { $r['regrinfo']['registered'] = 'no'; $r['rawdata'][] = 'Domain not found'; } $r['regyinfo'] = array( 'referrer' => 'http://www.nic.es', 'registrar' => 'ES-NIC' ); format_dates($r, 'ymd'); return $r; } } ?>