Exemplo n.º 1
0
<?php

require '../autoloader.php';
try {
    $domainname = 'dnssectest.nl';
    $conn = new Metaregistrar\EPP\sidnEppConnection();
    eppConnect($conn);
    $add = new Metaregistrar\EPP\eppDomain($domainname);
    $sec = new Metaregistrar\EPP\eppSecdns();
    $sec->setKey('256', '8', 'AwEAAbWM8nWQZbDZgJjyq+tLZwPLEXfZZjfvlRcmoAVZHgZJCPn/Ytu/iOsgci+yWgDT28ENzREAoAbKMflFFdhc5DNV27TZxhv8nMo9n2f+cyyRKbQ6oIAvMl7siT6WxrLxEBIMyoyFgDMbqGScn9k19Ppa8fwnpJgv0VUemfxGqHH9');
    $add->addSecdns($sec);
    $domain = new Metaregistrar\EPP\eppDnssecUpdateDomainRequest($domainname, $add);
    if (($response = $conn->writeandread($domain)) instanceof Metaregistrar\EPP\eppUpdateResponse && $response->Success()) {
        echo "OKAY\n";
    }
    $this->eppDisconnect($conn);
    return true;
} catch (Metaregistrar\EPP\eppException $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
    eppDisconnect($conn);
}
function eppConnect($conn)
{
    if ($conn->connect()) {
        #
        # Send greeting to EPP server
        #
        $login = new Metaregistrar\EPP\eppLoginRequest();
        if (($response = $conn->writeandread($login)) instanceof Metaregistrar\EPP\eppLoginResponse && $response->Success()) {
        } else {
            throw new Metaregistrar\EPP\eppException('Unable to login to EPP');
Exemplo n.º 2
0
function updatedomainremoveds($conn, $domainname)
{
    try {
        $secdns = new Metaregistrar\EPP\eppSecdns();
        $secdns->setData(45678, 2, 'B5C422428DEA4137FBF15E1049A48D27FA5EADE64D2EC9F3B58A994A6ABDE543');
        $secdns->setAlgorithm(5);
        $domain = new Metaregistrar\EPP\eppDnssecUpdateDomainRequest($domainname, null, $secdns);
        echo $domain->saveXML();
        if (($response = $conn->writeandread($domain)) instanceof Metaregistrar\EPP\eppUpdateResponse && $response->Success()) {
            echo $response->saveXML();
        }
    } catch (Metaregistrar\EPP\eppException $e) {
        echo $e->getMessage() . "\n";
    }
}