예제 #1
0
function test1($conn, $domainname)
{
    $domain = new Metaregistrar\EPP\eppDomain($domainname);
    if (checkdomain($conn, $domain)) {
        $registrant = createcontact($conn, '*****@*****.**', '+46.123412340', 'Hostmistress', 'Not a Real Company', 'longwayhome', '76543', 'Kiruna', 'NL');
        $adminc = createcontact($conn, '*****@*****.**', '+46.123412340', 'Hostmistress', 'Not a Real Company', 'longwayhome', '76543', 'Kiruna', 'NL');
        createdomain($conn, $domainname, $registrant, $adminc, $adminc, null, null);
        /* Check and/or create host objects */
        echo $domainname . " is registered, update domain with host objects\n";
        $hostnames[] = 'ns1.' . $domainname;
        $hostnames[] = 'ns2.' . $domainname;
        checkandcreatehosts($conn, $hostnames);
        updatedomainaddhost($conn, $domainname, $hostnames);
    } else {
        #$hostnames[] = 'ns1.'.$domainname;
        #$hostnames[] = 'ns2.'.$domainname;
        #updatedomainaddhost($conn,$domainname,$hostnames);
        echo "Test 1 completed, info domain:\n";
        infodomain($conn, $domainname);
    }
}
try {
    // Please enter your own settings file here under before using this example
    if ($conn = eppConnection::create('')) {
        $conn->enableLaunchphase('claims');
        // Connect and login to the EPP server
        if ($conn->login()) {
            $contactid = '';
            $techcontact = $contactid;
            $billingcontact = $contactid;
            $nameservers = array('ns1.metaregistrar.nl', 'ns2.metaregistrar.nl');
            echo "Registering {$domainname}\n";
            $claim = checkdomainclaim($conn, $domainname);
            if ($claim) {
                createclaimeddomain($conn, $domainname, $claim, $contactid, $contactid, $techcontact, $billingcontact, $nameservers);
            } else {
                createdomain($conn, $domainname, $contactid, $contactid, $techcontact, $billingcontact, $nameservers);
            }
            $conn->logout();
        }
    }
} catch (eppException $e) {
    echo "ERROR: " . $e->getMessage() . "\n\n";
}
/**
 * @param eppConnection $conn
 * @param string $domainname
 * @return array|null
 * @throws eppException
 * @throws tmchException
 */
function checkdomainclaim($conn, $domainname)
    echo "Usage: createlaunchdomain.php <domainname>\n";
    echo "Please enter the domain name to be created\n\n";
    die;
}
$domainname = $argv[1];
echo "Registering {$domainname}\n";
try {
    // Please enter your own settings file here under before using this example
    if ($conn = eppConnection::create('')) {
        // Connect to the EPP server
        if ($conn->login()) {
            $contactid = 'mrg54b6560e01ddf';
            $techcontact = $contactid;
            $billingcontact = $contactid;
            if ($contactid) {
                createdomain($conn, $domainname, $contactid, $contactid, $techcontact, $billingcontact, array('ns1.metaregistrar.nl', 'ns2.metaregistrar.nl'));
            }
            $conn->logout();
        }
    }
} catch (eppException $e) {
    echo "ERROR: " . $e->getMessage() . "\n\n";
}
/**
 * @param $conn eppConnection
 * @param $domainname string
 * @param $registrant string
 * @param $admincontact string
 * @param $techcontact string
 * @param $billingcontact string
 * @param $nameservers array
예제 #4
0
$conn = new Metaregistrar\EPP\metaregEppConnection();
$conn->setConnectionDetails('');
// Connect to the EPP server
if ($conn->login()) {
    //if (!checkhosts($conn, array('ns1.metaregistrar.nl'))) {
    //    createhost($conn, 'ns1.metaregistrar.nl');
    //}
    //if (!checkhosts($conn, array('ns5.metaregistrar.nl'))) {
    //    createhost($conn, 'ns2.metaregistrar.nl');
    //}
    //$nameservers = array('ns1.metaregistrar.nl','ns2.metaregistrar.nl');
    //$contactid = createcontact($conn,'*****@*****.**','+31.61234567890','Person name',null,'Address 1','12345','City','NL');
    $nameservers = null;
    $contactid = 'PAU000001-MIJND';
    if ($contactid) {
        createdomain($conn, $domainname, $contactid, $contactid, $contactid, $contactid, $nameservers);
    }
    $conn->logout();
}
function checkcontact($conn, $contactid)
{
    /* @var $conn Metaregistrar\EPP\eppConnection */
    try {
        $contactinfo = new Metaregistrar\EPP\eppContactHandle($contactid);
        $check = new Metaregistrar\EPP\eppCheckRequest($contactinfo);
        if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppCheckResponse && $response->Success()) {
            /* @var $response Metaregistrar\EPP\eppCheckResponse */
            $checks = $response->getCheckedContacts();
            foreach ($checks as $contact => $check) {
                echo "Contact {$contact} " . ($check ? 'does not exist' : 'exists') . "\n";
            }
예제 #5
0
            echo "Checking poll\n";
            checkpoll($conn);
            // Check domain names
            echo "Checking " . count($domains) . " domain names\n";
            checkdomains($conn, $domains);
            echo "Checking contact\n";
            checkcontact($conn, 'C5525');
            echo "Checking hosts\n";
            checkhosts($conn, ['ns1.metaregistrar.com', 'ns2.metaregistrar.com', 'ns3.metaregistrar.com']);
            //echo "Creating contact\n";
            //$contactid = createcontact($conn, '*****@*****.**','+35.8401231234','Department' ,'Metaregistrar' ,'Zuidelijk Halfrond 1' ,'8201 DD' , 'Gouda', 'NL');
            $registrant = 'C5525';
            $admin = 'C2526';
            $tech = 'C4529';
            echo "Creating domain\n";
            createdomain($conn, 'ewoutdegraaf4.fi', $registrant, $admin, $tech, null, ['ns1.metaregistrar.com', 'ns2.metaregistrar.com']);
            $conn->logout();
        }
    }
} catch (eppException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
    echo $e->getLastCommand();
    echo "\n\n";
}
/**
 * @param eppConnection $conn
 */
function checkbalance($conn)
{
    $check = new ficoraEppCheckBalanceRequest();
    if ($response = $conn->request($check)) {