Вход Регистрация
Файл: billing/_rootinc/todaynic/Domain_class.inc.php
Строк: 777
<?

class TodaynicDomain extends XMLClient{
    public 
$domaintype;

    public function 
TodaynicDomain($vcpserver,$vcpuser,$vcppassword)
    {
        
$this->serverURL=$vcpserver;
        
$this->VCP=$vcpuser;
        
$this->VCPPassword=$vcppassword;
        
$this->domainSuffix["com"]="dotcom";
        
$this->domainSuffix["net"]="dotcom";
        
$this->domainSuffix["org"]="dotorg";
        
$this->domainSuffix["name"]="dotname";
        
$this->domainSuffix["cn"]="dotcn";
        
$this->domainSuffix["biz"]="dotbiz";
        
$this->domainSuffix["info"]="dotinfo";
        
$this->domainSuffix["ws"]="dotws";
        
$this->domainSuffix["cc"]="dotcc";
        
$this->domainSuffix["tv"]="dottv";
        
$this->domainSuffix["tm"]="dottm";
        
$this->domainSuffix["vc"]="dotrrp";
        
$this->domainSuffix["la"]="dotrrp";
        
$this->domainSuffix["ЦР№ъ"]="dotch";
        
$this->domainSuffix["НшВз"]="dotch";
        
$this->domainSuffix["№«Лѕ"]="dotch";
        
$this->domainSuffix["ЦР‡ш"]="dotch";
        
$this->domainSuffix["ѕWЅj"]="dotch";
        
$this->domainSuffix["№«Лѕ"]="dotch";
        
$this->domainSuffix["xn--fiqs8s"]="dotch";
        
$this->domainSuffix["xn--io0a7i"]="dotch";
        
$this->domainSuffix["xn--55qx5d"]="dotch";
    }

       public function 
createDomain($domainI,$Regist,$Admin,$Tech,$Billing)
    {
        
$this->setDomainsuffix($domainI['domainname']);
        
$sendxml="<action>".$this->domaintype.":createDomain</action>
            <domain:name>
$domainI[domainname]</domain:name>
                  <domain:period>
$domainI[domainperiod]</domain:period>
                  <domain:registrant>
                        <registrant:name>
$Regist[name]</registrant:name>
                        <registrant:cnname>
$Regist[cnname] </registrant:cnname>
                        <registrant:org>
$Regist[org]</registrant:org>
                        <registrant:cnorg>
$Regist[cnorg] </registrant:cnorg>
                        <registrant:cc>
$Regist[cc]</registrant:cc>
                        <registrant:sp>
$Regist[sp]</registrant:sp>
                        <registrant:pc>
$Regist[pc]</registrant:pc>
                        <registrant:city>
$Regist[city]</registrant:city>
                        <registrant:street>
$Regist[street]</registrant:street>
                        <registrant:street1>
$Regist[street1]</registrant:street1>
                        <registrant:voice>
$Regist[voice]</registrant:voice>
                        <registrant:fax>
$Regist[fax]</registrant:fax>
                        <registrant:email>
$Regist[email]</registrant:email>
                        <registrant:mobile>
$Regist[mob]</registrant:mobile>
                </domain:registrant>
                <domain:contact type="
admin">
                        <contact:name>
$Admin[name]</contact:name>
                        <contact:cnname>
$Admin[cnname]</contact:cnname>
                        <contact:org>
$Admin[org]</contact:org>
                        <contact:cnorg>
$Admin[cnorg]</contact:cnorg>
                        <contact:cc>
$Admin[cc]</contact:cc>
                        <contact:sp>
$Admin[sp]</contact:sp>
                        <contact:pc>
$Admin[pc]</contact:pc>
                        <contact:city>
$Admin[city]</contact:city>
                        <contact:street>
$Admin[street]</contact:street>
                        <contact:street1>
$Admin[street1]</contact:street1>
                        <contact:voice>
$Admin[voice]</contact:voice>
                        <contact:fax>
$Admin[fax]</contact:fax>
                        <contact:email>
$Admin[email]</contact:email>
                        <contact:mobile>
$Admin[mob]</contact:mobile>
                </domain:contact>
                <domain:contact type="
tech">
                        <contact:name>
$Tech[name]</contact:name>
                        <contact:cnname>
$Tech[cnname]</contact:cnname>
                        <contact:org>
$Tech[org]</contact:org>
                        <contact:cnorg>
$Tech[cnorg]</contact:cnorg>
                        <contact:cc>
$Tech[cc]</contact:cc>
                        <contact:sp>
$Tech[sp]</contact:sp>
                        <contact:pc>
$Tech[pc]</contact:pc>
                        <contact:city>
$Tech[city]</contact:city>
                        <contact:street>
$Tech[street]</contact:street>
                        <contact:street1>
$Tech[street1]</contact:street1>
                        <contact:voice>
$Tech[voice]</contact:voice>
                        <contact:fax>
$Tech[fax]</contact:fax>
                        <contact:email>
$Tech[email]</contact:email>
                        <contact:mobile>
$Tech[mob]</contact:mobile>
                </domain:contact>
                <domain:contact type="
billing">
                        <contact:name>
$Billing[name]</contact:name>
                        <contact:cnname>
$Billing[cnname]</contact:cnname>
                        <contact:org>
$Billing[org]</contact:org>
                        <contact:cnorg>
$Billing[cnorg]</contact:cnorg>
                        <contact:cc>
$Billing[cc]</contact:cc>
                        <contact:sp>
$Billing[sp]</contact:sp>
                        <contact:pc>
$Billing[pc]</contact:pc>
                        <contact:city>
$Billing[city]</contact:city>
                        <contact:street>
$Billing[street]</contact:street>
                        <contact:street1>
$Billing[street1]</contact:street1>
                        <contact:voice>
$Billing[voice]</contact:voice>
                        <contact:fax>
$Billing[fax]</contact:fax>
                        <contact:email>
$Billing[email]</contact:email>
                        <contact:mobile>
$Billing[mob]</contact:mobile>
                </domain:contact>
                <domain:ns>
$domainI[ns1]</domain:ns>
                <domain:ns>
$domainI[ns2]</domain:ns>";

        if (
$domain[ns3]) { $sendxml $sendxml."                <domain:ns>$domainI[ns3]</domain:ns>"; }
        if (
$domain[ns4]) { $sendxml $sendxml."                <domain:ns>$domainI[ns4]</domain:ns>"; }

        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
#        if(strpos($this->responseXML,'code="2000"'))$this->resoveDomain($domainI['domainname']);
        
return $this->responseXML;
    }

    public function 
renewDomain($domainI){
        
$this->setDomainsuffix($domainI['domainname']);
        
$sendxml="<action>".$this->domaintype.":renewDomain</action>
                    <domain:name>
$domainI[domainname]</domain:name>
                    <domain:exDate>
$domainI[curexpired]</domain:exDate>
                    <domain:period>
$domainI[domainperiod]</domain:period>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
checkDomain($domainI)
    {
        
$this->setDomainsuffix($domainI['domainname']);
        
$sendxml="<action>".$this->domaintype.":checkDomain</action>
                  <domain:name>
$domainI[domainname]</domain:name>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
checkNS($ns,$dot)
    {
        
$domain $ns.".".$dot;
        
$this->setDomainsuffix($domain);
        
$sendxml="<action>".$this->domaintype.":checkNS</action>
                    <host:name>
$domain</host:name>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
infoDomain($domain)
    {
        
$this->setDomainsuffix($domain);
        
$sendxml="<action>".$this->domaintype.":infoDomain</action>
                  <domain:name>
$domain</domain:name>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }


    public function 
modifyDomain($domainI){
        
$this->setDomainsuffix($domainI['domainname']);
        
$sendxml "<action>".$this->domaintype.":modifyDomain</action>
                <domain:name>
$domainI[domainname]</domain:name>
                <domain:newns>
$domainI[newns1]</domain:newns>
                <domain:newns>
$domainI[newns2]</domain:newns>";
        if (
$domainI[newns3]) { $sendxml $sendxml."                <domain:newns>$domainI[newns3]</domain:newns>"; }
        if (
$domainI[newns4]) { $sendxml $sendxml."                <domain:newns>$domainI[newns4]</domain:newns>"; }
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
createContact($domainstr,$contactI)
    {
            
$this->setDomainsuffix($domainstr);
            
$sendxml "<action>".$this->domaintype.":createContact</action>
                <domain:contact>
                    <contact:name>
$contactI[name]</contact:name>
                    <contact:cnname>
$contactI[cnname]</contact:cnname>
                    <contact:org>
$contactI[org]</contact:org>
                    <contact:cnorg>
$contactI[cnorg]</contact:cnorg>
                    <contact:cc>
$contactI[cc]</contact:cc>
                    <contact:sp>
$contactI[sp]</contact:sp>
                    <contact:pc>
$contactI[pc]</contact:pc>
                    <contact:city>
$contactI[city]</contact:city>
                    <contact:street>
$contactI[street]</contact:street>
                    <contact:street1>
$contactI[street1]</contact:street1>
                    <contact:voice>
$contactI[voice]</contact:voice>
                    <contact:fax>
$contactI[fax]</contact:fax>
                    <contact:email>
$contactI[email]</contact:email>
                    <contact:mobile>
$contactI[mob]</contact:mobile>
                </domain:contact>"
;
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
updateContact($contactI)
    {
        
$this->setDomainsuffix($contactI['domainname']);
        
$sendxml "<action>".$this->domaintype.":updateContact</action>
                <domain:name>
$contactI[domainname]</domain:name>
                <contact:id>
$contactI[id]</contact:id>
                <contact:type>
$contactI[type]</contact:type>
                <domain:contact>
                    <contact:name>
$contactI[name]</contact:name>
                    <contact:cnname>
$contactI[cnname]</contact:cnname>
                    <contact:org>
$contactI[org]</contact:org>
                    <contact:cnorg>
$contactI[cnorg]</contact:cnorg>
                    <contact:cc>
$contactI[cc]</contact:cc>
                    <contact:sp>
$contactI[sp]</contact:sp>
                    <contact:pc>
$contactI[pc]</contact:pc>
                    <contact:city>
$contactI[city]</contact:city>
                    <contact:street>
$contactI[street]</contact:street>
                    <contact:cnstreet>
$contactI[street1]</contact:cnstreet>
                    <contact:voice>
$contactI[voice]</contact:voice>
                    <contact:fax>
$contactI[fax]</contact:fax>
                    <contact:email>
$contactI[email]</contact:email>
                    <contact:mobile>
$contactI[mob]</contact:mobile>
                </domain:contact>"
;

        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
infoContact($contactI)
    {
        
$this->setDomainsuffix($contactI['domainname']);
        
$sendxml "<action>".$this->domaintype.":infoContact</action>
                <domain:name>
$contactI[domainname]</domain:name>
                <contact:id>
$contactI[id]</contact:id>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
createNS($ns$dot$ip)
    {
        
$domain $ns.".".$dot;
        
$this->domaintype=$this->domainSuffix[$dot];
        
$sendxml "<action>".$this->domaintype.":createNS</action>
                <host:name>
$domain</host:name>
                <host:ip>
$ip</host:ip>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }

    public function 
resoveDomain($domain_name)
    {
        
$this->setDomainsuffix($domain_name);
        
$sendxml "<action>".$this->domaintype.":resoveDomain</action>";
        
$sendxml .= "<domain:name>$domain_name</domain:name>";
        
$this->sendSCPData($this->serverURL,$sendxml);
        
$this->toPlain();
        return 
$this->responseXML;
    }
    
    public function 
updatepassword($domainI)
    {
        
$this->setDomainsuffix($domainI['domainname']);
        
$sendxml "<action>".$this->domaintype.":setLoginPassword</action>
                <domain:name>
$domainI[domainname]</domain:name>
                <domain:loginpassword>
$domainI[newpass]</domain:loginpassword>";
        if (
$domainI[newpass] &&(strlen($domainI[newpass])>12 || strlen($domainI[newpass])<6))
        {
            
$this->sendXML=$this->toSCPXML($sendxml);
            return 
"1";
        }
        else
        {
            
$this->sendSCPData($this->serverURL,$sendxml);
            
$this->toPlain();
            return 
$this->responseXML;
        }
    }

    public function 
setDomainsuffix($domain)
    {
        
$pos=strrpos($domain,".");
        if(
$pos>0)
        {
            
$suffix=substr($domain,$pos+1);
            
$suffix=rtrim(strtolower($suffix));
            
$this->domaintype=$this->domainSuffix[$suffix];
        }
    }

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