Вход Регистрация
Файл: _rootinc/nicru.inc.php
Строк: 998
<?
$nicruService
["ru"] = "domain_ru";                    $nicruTemplate["ru"] = "client_ru";
$nicruService["su"] = "domain_su";                    $nicruTemplate["su"] = "client_ru";
$nicruService["рф"] = "domain_rf";                    $nicruTemplate["рф"] = "domain_rf";
$nicruService["net"] = "domain_rrp";                    $nicruTemplate["net"] = "domain_rrp";
$nicruService["com"] = "domain_rrp";                    $nicruTemplate["com"] = "domain_rrp";
$nicruService["org"] = "domain_rrp";                    $nicruTemplate["org"] = "domain_rrp";
$nicruService["biz"] = "domain_rrp";                    $nicruTemplate["biz"] = "domain_rrp";
$nicruService["info"] = "domain_rrp";                    $nicruTemplate["info"] = "domain_rrp";
$nicruService["cc"] = "domain_epp_cc";                    $nicruTemplate["cc"] = "client_rrp";
$nicruService["tv"] = "domain_epp_tv";                    $nicruTemplate["tv"] = "client_rrp";
$nicruService["me"] = "domain_epp_me";                    $nicruTemplate["me"] = "client_rrp";
$nicruService["tel"] = "domain_epp_tel";                $nicruTemplate["tel"] = "client_rrp";
$nicruService["mobi"] = "domain_epp_mobi";                $nicruTemplate["mobi"] = "client_rrp";
$nicruService["name"] = "domain_epp_name";                $nicruTemplate["name"] = "client_rrp";
$nicruService["pro"] = "domain_epp_pro";                $nicruTemplate["pro"] = "client_rrp";
$nicruService["ag"] = "domain_epp_ag";                    $nicruTemplate["ag"] = "client_rrp";
$nicruService["bz"] = "domain_epp_bz";                    $nicruTemplate["bz"] = "client_rrp";
$nicruService["hn"] = "domain_epp_hn";                    $nicruTemplate["hn"] = "client_rrp";
$nicruService["lc"] = "domain_epp_lc";                    $nicruTemplate["lc"] = "client_rrp";
$nicruService["mn"] = "domain_epp_mn";                    $nicruTemplate["mn"] = "client_rrp";
$nicruService["sc"] = "domain_epp_sc";                    $nicruTemplate["sc"] = "client_rrp";
$nicruService["vc"] = "domain_epp_vc";                    $nicruTemplate["vc"] = "client_rrp";

$nicruService["abkhazia.su"] = "domain_abkhazia_su";            $nicruTemplate["abkhazia.su"] = "client_ru";
$nicruService["adygeya.ru"] = "domain_adygeya_ru";            $nicruTemplate["adygeya.ru"] = "client_ru";
$nicruService["adygeya.su"] = "domain_adygeya_su";            $nicruTemplate["adygeya.su"] = "client_ru";
$nicruService["aktyubinsk.su"] = "domain_aktyubinsk_su";        $nicruTemplate["aktyubinsk.su"] = "client_ru";
$nicruService["arkhangelsk.su"] = "domain_arkhangelsk_su";        $nicruTemplate["arkhangelsk.su"] = "client_ru";
$nicruService["armenia.su"] = "domain_armenia_su";            $nicruTemplate["armenia.su"] = "client_ru";
$nicruService["ashgabad.su"] = "domain_ashgabad_su";            $nicruTemplate["ashgabad.su"] = "client_ru";
$nicruService["azerbaijan.su"] = "domain_azerbaijan_su";        $nicruTemplate["azerbaijan.su"] = "client_ru";
$nicruService["balashov.su"] = "domain_balashov_su";            $nicruTemplate["balashov.su"] = "client_ru";
$nicruService["bashkiria.ru"] = "domain_bashkiria_ru";            $nicruTemplate["bashkiria.ru"] = "client_ru";
$nicruService["bashkiria.su"] = "domain_bashkiria_su";            $nicruTemplate["bashkiria.su"] = "client_ru";
$nicruService["bir.ru"] = "domain_bir_ru";                $nicruTemplate["bir.ru"] = "client_ru";
$nicruService["bryansk.su"] = "domain_bryansk_su";            $nicruTemplate["bryansk.su"] = "client_ru";
$nicruService["cbg.ru"] = "domain_cbg_ru";                $nicruTemplate["cbg.ru"] = "client_ru";
$nicruService["chimkent.su"] = "domain_chimkent_su";            $nicruTemplate["chimkent.su"] = "client_ru";
$nicruService["com.ru"] = "domain_com_ru";                $nicruTemplate["com.ru"] = "client_ru";
$nicruService["dagestan.ru"] = "domain_dagestan_ru";            $nicruTemplate["dagestan.ru"] = "client_ru";
$nicruService["dagestan.su"] = "domain_dagestan_su";            $nicruTemplate["dagestan.su"] = "client_ru";
$nicruService["east-kazakhstan.su"] = "domain_east_kazakhstan_su";    $nicruTemplate["east-kazakhstan.su"] = "client_ru";
$nicruService["exnet.su"] = "domain_exnet_su";                $nicruTemplate["exnet.su"] = "client_ru";
$nicruService["georgia.su"] = "domain_georgia_su";            $nicruTemplate["georgia.su"] = "client_ru";
$nicruService["grozny.ru"] = "domain_grozny_ru";            $nicruTemplate["grozny.ru"] = "client_ru";
$nicruService["ivanovo.su"] = "domain_ivanovo_su";            $nicruTemplate["ivanovo.su"] = "client_ru";
$nicruService["kalmykia.ru"] = "domain_kalmykia_ru";            $nicruTemplate["kalmykia.ru"] = "client_ru";
$nicruService["kalmykia.su"] = "domain_kalmykia_su";            $nicruTemplate["kalmykia.su"] = "client_ru";
$nicruService["kaluga.su"] = "domain_kaluga_su";            $nicruTemplate["kaluga.su"] = "client_ru";
$nicruService["karacol.su"] = "domain_karacol_su";            $nicruTemplate["karacol.su"] = "client_ru";
$nicruService["karaganda.su"] = "domain_karaganda_su";            $nicruTemplate["karaganda.su"] = "client_ru";
$nicruService["karelia.su"] = "domain_karelia_su";            $nicruTemplate["karelia.su"] = "client_ru";
$nicruService["khakassia.su"] = "domain_khakassia_su";            $nicruTemplate["khakassia.su"] = "client_ru";
$nicruService["krasnodar.su"] = "domain_krasnodar_su";            $nicruTemplate["krasnodar.su"] = "client_ru";
$nicruService["kustanai.ru"] = "domain_kustanai_ru";            $nicruTemplate["kustanai.ru"] = "client_ru";
$nicruService["kustanai.su"] = "domain_kustanai_su";            $nicruTemplate["kustanai.su"] = "client_ru";
$nicruService["mangyshlak.su"] = "domain_mangyshlak_su";        $nicruTemplate["mangyshlak.su"] = "client_ru";
$nicruService["marine.ru"] = "domain_marine_ru";            $nicruTemplate["marine.ru"] = "client_ru";
$nicruService["mordovia.ru"] = "domain_mordovia_ru";            $nicruTemplate["mordovia.ru"] = "client_ru";
$nicruService["mordovia.su"] = "domain_mordovia_su";            $nicruTemplate["mordovia.su"] = "client_ru";
$nicruService["msk.ru"] = "domain_msk_ru";                $nicruTemplate["msk.ru"] = "client_ru";
$nicruService["msk.su"] = "domain_msk_su";                $nicruTemplate["msk.su"] = "client_ru";
$nicruService["murmansk.su"] = "domain_murmansk_su";            $nicruTemplate["murmansk.su"] = "client_ru";
$nicruService["mytis.ru"] = "domain_mytis_ru";                $nicruTemplate["mytis.ru"] = "client_ru";
$nicruService["nalchik.ru"] = "domain_nalchik_ru";            $nicruTemplate["nalchik.ru"] = "client_ru";
$nicruService["nalchik.su"] = "domain_nalchik_su";            $nicruTemplate["nalchik.su"] = "client_ru";
$nicruService["navoi.su"] = "domain_navoi_su";                $nicruTemplate["navoi.su"] = "client_ru";
$nicruService["net.ru"] = "domain_net_ru";                $nicruTemplate["net.ru"] = "client_ru";
$nicruService["north-kazakhstan.su"] = "domain_north_kazakhstan_su";    $nicruTemplate["north-kazakhstan.su"] = "client_ru";
$nicruService["nov.ru"] = "domain_nov_ru";                $nicruTemplate["nov.ru"] = "client_ru";
$nicruService["nov.su"] = "domain_nov_su";                $nicruTemplate["nov.su"] = "client_ru";
$nicruService["org.ru"] = "domain_org_ru";                $nicruTemplate["org.ru"] = "client_ru";
$nicruService["pokrovsk.su"] = "domain_pokrovsk_su";            $nicruTemplate["pokrovsk.su"] = "client_ru";
$nicruService["pp.ru"] = "domain_pp_ru";                $nicruTemplate["pp.ru"] = "client_ru";
$nicruService["pyatigorsk.ru"] = "domain_pyatigorsk_ru";        $nicruTemplate["pyatigorsk.ru"] = "client_ru";
$nicruService["ru.net"] = "domain_ru_net";                $nicruTemplate["ru.net"] = "client_ru";
$nicruService["sochi.su"] = "domain_sochi_su";                $nicruTemplate["sochi.su"] = "client_ru";
$nicruService["spb.ru"] = "domain_spb_ru";                $nicruTemplate["spb.ru"] = "client_ru";
$nicruService["spb.su"] = "domain_spb_su";                $nicruTemplate["spb.su"] = "client_ru";
$nicruService["termez.su"] = "domain_termez_su";            $nicruTemplate["termez.su"] = "client_ru";
$nicruService["togliatti.su"] = "domain_togliatti_su";            $nicruTemplate["togliatti.su"] = "client_ru";
$nicruService["troitsk.su"] = "domain_troitsk_su";            $nicruTemplate["troitsk.su"] = "client_ru";
$nicruService["tselinograd.su"] = "domain_tselinograd_su";        $nicruTemplate["tselinograd.su"] = "client_ru";
$nicruService["tula.su"] = "domain_tula_su";                $nicruTemplate["tula.su"] = "client_ru";
$nicruService["tuva.su"] = "domain_tuva_su";                $nicruTemplate["tuva.su"] = "client_ru";
$nicruService["vladikavkaz.ru"] = "domain_vladikavkaz_ru";        $nicruTemplate["vladikavkaz.ru"] = "client_ru";
$nicruService["vladikavkaz.su"] = "domain_vladikavkaz_su";        $nicruTemplate["vladikavkaz.su"] = "client_ru";
$nicruService["vladimir.ru"] = "domain_vladimir_ru";            $nicruTemplate["vladimir.ru"] = "client_ru";
$nicruService["vladimir.su"] = "domain_vladimir_su";            $nicruTemplate["vladimir.su"] = "client_ru";
$nicruService["vologda.su"] = "domain_vologda_su";            $nicruTemplate["vologda.su"] = "client_ru";

class 
NICRU
{
    public 
$url null;
    public 
$user null;
    public 
$password null;
    public 
$error null;

    public function 
init($url,$user,$password)
    {
        
$this->url=$url;
        
$this->user=$user."/NIC-REG/ADM";
        
$this->password=$password;
    }

    public function 
send($request)
    {
        
$request iconv("utf-8","KOI8-R//IGNORE",htmlDecode("SimpleRequest=".$request));

        
$fp curl_init(); 
        
curl_setopt($fpCURLOPT_URL$this->url);
        
curl_setopt($fpCURL_HTTP_VERSION_1_11);
        
curl_setopt($fpCURLOPT_POST1);
        
curl_setopt($fpCURLOPT_POSTFIELDS$request);
        
curl_setopt($fpCURLOPT_SSL_VERIFYPEER0);
        
curl_setopt($fpCURLOPT_SSL_VERIFYHOST0);
        
curl_setopt($fpCURLOPT_RETURNTRANSFER,1);
        
curl_setopt($fpCURLOPT_TIMEOUT120);

        
$result curl_exec($fp);

        
curl_close($fp);  

        
$result iconv("koi8-r","utf-8",$result);

        return 
$this->parseResult($result);
    }

    public function 
parseResult($result)
    {
        
$results mb_split("n",$result);

        
$resArray null;
        
$nserver 0;
        while (list(
$index,$res) = each($results)) {
            
$res=trim($res);

            if (
preg_match("/^State:s+(d{3})s+(.*)$/ui",$res,$arr)) {
                
$resArray["state:code"] = $arr[1];
                
$resArray["state:msg"] = $arr[2];
                if (
$arr[1] == "402") {
                    
$tmp mb_split("[errors]",$result);
                    
$tmp[1]=preg_replace("/n/ui","",$tmp[1]);
                    
$resArray["state:error"] = "(".$tmp[1].")";
                }
            } else if (
preg_match("/^([^:]+):s*([^:]+)$/ui",$res,$arr)) {
                
$newIndex $arr[1];
                if (
$newIndex == "nserver") {$nserver++; $newIndex $newIndex.$nserver; }
                
$newValue $arr[2];
                
$resArray[$newIndex] = $newValue;
            }
        }
        return 
$resArray;
    }

    public function 
spl($val,$rowname) {
        
$max_passport_string_length 40;
        if (
mb_strlen($val) > $max_passport_string_length) {
            
$pass = @mb_split(" ",$val);

            
$i=0;
            
$passport=array();
            while (list(
$k,$v) = @each($pass)) {
                if (
mb_strlen($passport[$i]." ".$v) <= $max_passport_string_length) { $passport[$i] = $passport[$i]." ".$v; }
                else {
$i++; $passport[$i] = $passport[$i]." ".$v; }
            }

            
$passport_q "";
            for (
$i=0$i count($passport); $i++) {
                
$passport_q $passport_q.$rowname.":".$passport[$i]."n";
            }
        } else {
            
$passport_q $rowname.":".$val."n";
        }

        return 
$passport_q;
    }

    public function 
regAnketaPerson($pw,$tech_pw,$person,$person_r,$country,$passport,$birth_date,$p_addr,$phone,$fax,$email,$mnt)
    {
        
$passport $this->spl($passport,"passport");
        
$p_addr $this->spl($p_addr,"p-addr");

$req "lang:ru
request:contract
operation:create
login:"
.$this->user."
password:"
.$this->password."
request-id:"
.microtime()."

[contract]
contract-type:PRS
password:"
.$pw."
tech-password:"
.$tech_pw."
person:"
.$person."
person-r:"
.$person_r."
country:"
.strtoupper($country)."
currency-id:RUR
"
.$passport."birth-date:".$birth_date."
"
.$p_addr."phone:".urlencode($phone)."
fax-no:"
.urlencode($fax)."
e-mail:"
.$email."
mnt-nfy:"
.$mnt."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["login"];
        } else {
            
$this->error "regAnketaPerson: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
regAnketaOrg($pw,$tech_pw,$org,$org_r,$code,$kpp,$country,$address_r,$p_addr,$d_addr,$phone,$fax,$email,$mnt)
    {
$req "lang:ru
request:contract
operation:create
login:"
.$this->user."
password:"
.$this->password."
request-id:"
.microtime()."

[contract]
contract-type:ORG
password:"
.$pw."
tech-password:"
.$tech_pw."
org:"
.$org."
org-r:"
.$org_r."
code:"
.$code."
kpp:"
.$kpp."
country:"
.strtoupper($country)."
currency-id:RUR
address-r:"
.$address_r."
p-addr:"
.$p_addr."
d-addr:"
.$d_addr."
phone:"
.urlencode($phone)."
fax-no:"
.urlencode($fax)."
e-mail:"
.$email."
mnt-nfy:"
.$mnt."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["login"];
        } else {
            
$this->error "regAnketaOrg: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
transferRuDomain($anketaId,$service,$template,$domain)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

$req "lang:ru
request:order
operation:create
login:"
.$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request-id:"
.microtime()."

[order-item]
service:"
.$service."
template:"
.$template."
action:pickup
domain:"
.$domain."
"
;
        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["order_id"];
        } else {
            
$this->error "transferRuDomain: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
regRuDomain($anketaId,$service,$template,$domain,$ns1,$ns2,$ns3,$ns4,$ns1ip,$ns2ip,$ns3ip,$ns4ip,$descr,$private_person,$email,$phone,$fax)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

        if (
$ns1ip) { $ns1 .= $ns1ip"; }
        if (
$ns2ip) { $ns2 .= $ns2ip"; }
        if (
$ns3ip) { $ns3 .= $ns3ip"; }
        if (
$ns4ip) { $ns4 .= $ns4ip"; }

$req "lang:ru
request:order
operation:create
login:"
.$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request-id:"
.microtime()."

[order-item]
service:"
.$service."
template:"
.$template."
action:new
domain:"
.$domain."
descr:"
.$descr."
private-person:"
.$private_person."
e-mail:"
.$email."
phone:"
.urlencode($phone)."
fax-no:"
.urlencode($fax)."
nserver:"
.$ns1."
nserver:"
.$ns2."
nserver:"
.$ns3."
nserver:"
.$ns4."
type:CORPORATE
"
;
        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["order_id"];
        } else {
            
$this->error "regRuDomain: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
regContact($anketaId,$org,$name,$country,$region,$city,$street,$zip,$phone,$fax,$email)
    {
$req "login:".$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request:contact
operation:create
lang:ru 
request-id:"
.microtime()."

[contact]
status:registrant
org:"
.$org."
name:"
.$name."
country:"
.strtoupper($country)."
region:"
.$region."
city:"
.$city."
street:"
.$street."
zipcode:"
.$zip."
phone:"
.urlencode($phone)."
fax:"
.urlencode($fax)."
email:"
.$email."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["nic-hdl"];
        } else {
            
$this->error "regContact: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
regDomain($anketaId,$contactId,$service,$template,$domain,$period,$ns1,$ns2,$ns3,$ns4,$ns1ip,$ns2ip,$ns3ip,$ns4ip)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

        if (
$ns1ip) { $ns1 .= $ns1ip"; }
        if (
$ns2ip) { $ns2 .= $ns2ip"; }
        if (
$ns3ip) { $ns3 .= $ns3ip"; }
        if (
$ns4ip) { $ns4 .= $ns4ip"; }

$req "login:".$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request:order
operation:create
lang:ru
request-id:"
.microtime()."

[order-item]
action:new
service:"
.$service."
period:"
.$period."
template:"
.$template."
domain:"
.$domain."
nserver:"
.$ns1."
nserver:"
.$ns2."
nserver:"
.$ns3."
nserver:"
.$ns4."
admin-c:"
.$contactId."
bill-c:"
.$contactId."
tech-c:"
.$contactId."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["order_id"];
        } else {
            
$this->error "regDomain: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }

    }

    public function 
transferDomain($anketaId,$contactId,$service,$template,$domain,$ns1,$ns2,$ns3,$ns4,$ns1ip,$ns2ip,$ns3ip,$ns4ip)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

        if (
$ns1ip) { $ns1 .= $ns1ip"; }
        if (
$ns2ip) { $ns2 .= $ns2ip"; }
        if (
$ns3ip) { $ns3 .= $ns3ip"; }
        if (
$ns4ip) { $ns4 .= $ns4ip"; }

$req "login:".$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request:order
operation:create
lang:ru
request-id:"
.microtime()."

[order-item]
action:new
service:"
.$service."
template:"
.$template."
domain:"
.$domain."
nserver:"
.$ns1."
nserver:"
.$ns2."
nserver:"
.$ns3."
nserver:"
.$ns4."
admin-c:"
.$contactId."
bill-c:"
.$contactId."
tech-c:"
.$contactId."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["order_id"];
        } else {
            
$this->error "transferDomain: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }

    }

    public function 
renewDomain($anketaId,$service,$domain,$period)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

$req "lang:ru
request:order
operation:create
login:"
.$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request-id:"
.microtime()."

[order-item]
action:prolong
template:prolong
service:"
.$service."
domain:"
.$domain."
prolong:"
.$period."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
true;
        } else {
            
$this->error "renewDomain: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
getNS($domain)
    {
        
$d = new domain($domain);
        
$result $d->info();
    
        if (!
$d->last_error) {
            
$result1 mb_split("n"$result);
            while (list(
$index,$res) = each($result1)) {
                if (
preg_match("/nserver/ui",$res)) {
                    
preg_match("/nserver:s*(.*)/iu",$res,$arr);
                    
$resultarray[]=$arr[1];
                } else if (
preg_match("/Name Server/ui",$res)) {
                    
preg_match("/Name Server:s*(.*)/iu",$res,$arr);
                    
$resultarray[]=$arr[1];
                }
            }
            return 
$resultarray;
        } else {
            
$this->error "getNS: $d->last_error";;
            return 
false;
        }
    }

    public function 
updateNS($anketaId,$contactId,$service,$template,$domain,$ns1,$ns2,$ns3,$ns4,$ns1ip,$ns2ip,$ns3ip,$ns4ip)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

        if (
$ns1ip) { $ns1 .= $ns1ip"; }
        if (
$ns2ip) { $ns2 .= $ns2ip"; }
        if (
$ns3ip) { $ns3 .= $ns3ip"; }
        if (
$ns4ip) { $ns4 .= $ns4ip"; }

$req "login:".$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request:order
operation:create
lang:ru
request-id:"
.microtime()."

[order-item]
action:update
service:"
.$service."
template:"
.$template."
domain:"
.$domain."
nserver:"
.$ns1."
nserver:"
.$ns2."
nserver:"
.$ns3."
nserver:"
.$ns4."
admin-c:"
.$contactId."
bill-c:"
.$contactId."
tech-c:"
.$contactId."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["order_id"];
        } else {
            
$this->error "updateNS: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }

    public function 
updateRuNS($anketaId,$service,$template,$domain,$descr,$private_person,$ns1,$ns2,$ns3,$ns4,$ns1ip,$ns2ip,$ns3ip,$ns4ip)
    {
        if (
preg_match("/[а-яёЁїЇіІєЄӘәҒғҚқҢңӨөҮүҰұҺһ]/ui",$domain)) {
            
$idna = new idna_convert();
            
$domain $idna->encode($domain);
        }

        if (
$ns1ip) { $ns1 .= $ns1ip"; }
        if (
$ns2ip) { $ns2 .= $ns2ip"; }
        if (
$ns3ip) { $ns3 .= $ns3ip"; }
        if (
$ns4ip) { $ns4 .= $ns4ip"; }

$req "lang:ru
request:order
operation:create
login:"
.$this->user."
password:"
.$this->password."
subject-contract:"
.$anketaId."
request-id:"
.microtime()."

[order-item]
service:"
.$service."
template:"
.$template."
action:update
domain:"
.$domain."
descr:"
.$descr."
private-person:"
.$private_person."
e-mail:"
.$email."
phone:"
.urlencode($phone)."
fax-no:"
.urlencode($fax)."
nserver:"
.$ns1."
nserver:"
.$ns2."
nserver:"
.$ns3."
nserver:"
.$ns4."
"
;

        
$result $this->send($req);

        if (
$result["state:code"] == "200") {
            return 
$result["order_id"];
        } else {
            
$this->error "updateRuNS: ".$result["state:code"]." ".$result["state:msg"]." ".$result["state:error"];
            return 
false;
        }
    }


    public function 
updateRuPrivateWhois($anketaId,$service,$template,$domain,$descr,$private_person)
    {
        
$ns $this->getNS($domain);

        if (
is_array($ns)) {
            
$result $this->updateRuNS($anketaId,$service,$template,$domain,$descr,$private_person,$ns[0],$ns[1],$ns[2],$ns[3],'','','','');

            if (
$result) {
                return 
true;
            } else {
                return 
false;
            }
        }
    }

}
?>
Онлайн: 1
Реклама