Exemplo n.º 1
0
function checkdomains($conn, $domains)
{
    try {
        $check = new Metaregistrar\EPP\eppLaunchCheckRequest($domains);
        $check->setLaunchPhase(Metaregistrar\EPP\eppLaunchCheckRequest::PHASE_CLAIMS, 'test', Metaregistrar\EPP\eppLaunchCheckRequest::TYPE_CLAIMS);
        if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppLaunchCheckResponse && $response->Success()) {
            //$phase = $response->getLaunchPhase();
            $checks = $response->getDomainClaims();
            foreach ($checks as $check) {
                echo $check['domainname'] . " has " . ($check['claimed'] ? 'a claim' : 'no claim') . "\n";
                if ($check['claimed']) {
                    if ($check['claim']) {
                        if ($check['claim'] instanceof Metaregistrar\EPP\eppDomainClaim) {
                            echo "Claim validator: " . $check['claim']->getValidator() . ", claim key: " . $check['claim']->getClaimKey() . "\n";
                            $tmch = new Metaregistrar\TMCH\cnisTmchConnection();
                            $output = $tmch->getCnis($check['claim']->getClaimKey());
                            echo "Notice ID: " . $output->getNoticeId() . " Not after: " . $output->getNotAfter() . "\n";
                        } else {
                            throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no valid claim key is present");
                        }
                    } else {
                        throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no claim key is present");
                    }
                }
            }
        } else {
            echo "ERROR2\n";
        }
    } catch (Metaregistrar\EPP\eppException $e) {
        echo 'ERROR1: ' . $e->getMessage() . "\n";
    } catch (Metaregistrar\TMCH\tmchException $t) {
        echo 'ERROR TMCH: ' . $t->getMessage() . "\n";
    }
}
Exemplo n.º 2
0
/**
 * @param Metaregistrar\EPP\eppConnection $conn
 * @param string $domainname
 * @return array|null
 */
function checkdomainclaim($conn, $domainname)
{
    $check = new Metaregistrar\EPP\eppLaunchCheckRequest(array($domainname));
    $check->setLaunchPhase(Metaregistrar\EPP\eppLaunchCheckRequest::PHASE_CLAIMS, null, Metaregistrar\EPP\eppLaunchCheckRequest::TYPE_CLAIMS);
    if (($response = $conn->writeandread($check)) instanceof Metaregistrar\EPP\eppLaunchCheckResponse && $response->Success()) {
        //$phase = $response->getLaunchPhase();
        /* @var Metaregistrar\EPP\eppLaunchCheckResponse $response */
        $checks = $response->getDomainClaims();
        foreach ($checks as $check) {
            echo $check['domainname'] . " has " . ($check['claimed'] ? 'a claim' : 'no claim') . "\n";
            if ($check['claimed']) {
                if ($check['claim']) {
                    if ($check['claim'] instanceof Metaregistrar\EPP\eppDomainClaim) {
                        echo "Claim validator: " . $check['claim']->getValidator() . ", claim key: " . $check['claim']->getClaimKey() . "\n";
                        $tmch = new Metaregistrar\TMCH\cnisTmchConnection(true, 'settingslive.ini');
                        $claim = array();
                        $output = $tmch->getCnis($check['claim']->getClaimKey());
                        /* @var $output Metaregistrar\TMCH\tmchClaimData */
                        $claim['noticeid'] = $output->getNoticeId();
                        $claim['notafter'] = $output->getNotAfter();
                        $claim['confirmed'] = gmDate("Y-m-d\\TH:i:s\\Z");
                        return $claim;
                    } else {
                        throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no valid claim key is present");
                    }
                } else {
                    throw new Metaregistrar\EPP\eppException("Domain name " . $check['domainname'] . " is claimed, but no claim key is present");
                }
            }
        }
    } else {
        echo "ERROR2\n";
    }
    return null;
}
Exemplo n.º 3
0
<?php

require "../autoloader.php";
/* This test file retrieves the latest test-domain-name-list (DNL) and gets the claim notice from the first item of this list. */
try {
    $dnl = new Metaregistrar\TMCH\dnlTmchConnection();
    $dnl->setConnectionDetails('');
    $cnis = new Metaregistrar\TMCH\cnisTmchConnection();
    $cnis->setConnectionDetails('');
    $list = $dnl->getDnl();
    $linecounter = -1;
    $k = array();
    foreach ($list as $line) {
        if ($linecounter > 0 && strlen($line) > 0) {
            list($domainname, $key, $datetime) = explode(',', $line);
            if ($domainname != '1' and $domainname != 'DNL') {
                echo $linecounter . ": " . $domainname . "\n";
                $k[$linecounter] = $key;
            }
        }
        $linecounter++;
    }
    echo "Enter the number from one of the labels above to display the warning notice for this label\n:";
    $number = (int) fgets(STDIN);
    echo $cnis->showWarning($cnis->getCnis($k[$number]));
} catch (Metaregistrar\TMCH\tmchException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}
Exemplo n.º 4
0
<?php

require "../autoloader.php";
$domain = 'nike';
$domainkey = null;
try {
    $dnl = new Metaregistrar\TMCH\dnlTmchConnection();
    $dnl->setConnectionDetails('');
    $cnis = new Metaregistrar\TMCH\cnisTmchConnection();
    $cnis->setConnectionDetails('');
    $list = $dnl->getDnl();
    foreach ($list as $line) {
        list($domainname, $key, $datetime) = explode(',', $line);
        if ($domainname == $domain) {
            $domainkey = $key;
        }
    }
    if ($domainkey) {
        echo $cnis->showWarning($cnis->getCnis($domainkey), true);
    } else {
        echo "Domain name not found in CNIS list\n";
    }
} catch (Metaregistrar\TMCH\tmchException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}
Exemplo n.º 5
0
<?php

require "../autoloader.php";
/* This test file retrieves the latest test-domain-name-list (DNL) and gets the claim notice from the first item of this list. */
try {
    $dnl = new Metaregistrar\TMCH\dnlTmchConnection();
    $cnis = new Metaregistrar\TMCH\cnisTmchConnection();
    $list = $dnl->getDnl();
    $linecounter = -1;
    $k = array();
    foreach ($list as $line) {
        if ($linecounter > 0 && strlen($line) > 0) {
            list($domainname, $key, $datetime) = explode(',', $line);
            if ($domainname != '1' and $domainname != 'DNL') {
                echo $linecounter . ": " . $domainname . "\n";
                $k[$linecounter] = $key;
            }
        }
        $linecounter++;
    }
    echo "Select the number from one of the labels above to display the warning notice for this label\n:";
    $number = (int) fgets(STDIN);
    echo $cnis->showWarning($cnis->getCnis($k[$number]));
} catch (Metaregistrar\TMCH\tmchException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}
Exemplo n.º 6
0
<?php

require "../autoloader.php";
$domain = 'nike';
$domainkey = null;
try {
    $dnl = new Metaregistrar\TMCH\dnlTmchConnection();
    $cnis = new Metaregistrar\TMCH\cnisTmchConnection();
    $list = $dnl->getDnl();
    foreach ($list as $line) {
        list($domainname, $key, $datetime) = explode(',', $line);
        if ($domainname == $domain) {
            $domainkey = $key;
        }
    }
    if ($domainkey) {
        echo $cnis->showWarning($cnis->getCnis($domainkey), true);
    } else {
        echo "Domain name not found in CNIS list\n";
    }
} catch (Metaregistrar\TMCH\tmchException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}