mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-20 17:46:03 +02:00
Updates to EPP server to match RST
This commit is contained in:
parent
8ac4875c9c
commit
98ae5dc19c
1 changed files with 436 additions and 419 deletions
|
@ -21,6 +21,9 @@ use Swoole\Timer;
|
||||||
use Swoole\Coroutine\Server;
|
use Swoole\Coroutine\Server;
|
||||||
use Swoole\Coroutine\Server\Connection;
|
use Swoole\Coroutine\Server\Connection;
|
||||||
use Namingo\Rately\Rately;
|
use Namingo\Rately\Rately;
|
||||||
|
use Selective\XmlDSig\PublicKeyStore;
|
||||||
|
use Selective\XmlDSig\CryptoVerifier;
|
||||||
|
use Selective\XmlDSig\XmlSignatureVerifier;
|
||||||
|
|
||||||
$table = new Table(1024);
|
$table = new Table(1024);
|
||||||
$table->column('clid', Table::TYPE_STRING, 64);
|
$table->column('clid', Table::TYPE_STRING, 64);
|
||||||
|
@ -150,77 +153,109 @@ $server->handle(function (Connection $conn) use ($table, $eppExtensionsTable, $p
|
||||||
$conn->close();
|
$conn->close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$data = $conn->recv();
|
|
||||||
$connId = spl_object_id($conn);
|
$connId = spl_object_id($conn);
|
||||||
|
|
||||||
if ($data === false || strlen($data) < 4) {
|
static $buffer = '';
|
||||||
sendEppError($conn, $pdo, 2000, 'Invalid or no data received');
|
|
||||||
|
$chunk = $conn->recv();
|
||||||
|
if ($chunk === '' || $chunk === false) {
|
||||||
$conn->close();
|
$conn->close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$buffer .= $chunk;
|
||||||
|
|
||||||
$length = unpack('N', substr($data, 0, 4))[1];
|
while (strlen($buffer) >= 4) {
|
||||||
$xmlData = substr($data, 4, $length - 4);
|
$len = unpack('N', substr($buffer, 0, 4))[1];
|
||||||
|
if ($len < 5) {
|
||||||
|
sendEppError($conn, $pdo, 2000, 'Invalid frame length');
|
||||||
|
$conn->close();
|
||||||
|
break 2;
|
||||||
|
}
|
||||||
|
if (strlen($buffer) < $len) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// If you're using PHP < 8.0
|
$xmlData = substr($buffer, 4, $len - 4);
|
||||||
libxml_disable_entity_loader(true);
|
$buffer = substr($buffer, $len);
|
||||||
libxml_use_internal_errors(true);
|
|
||||||
|
|
||||||
$xml = simplexml_load_string($xmlData);
|
// If you're using PHP < 8.0
|
||||||
if ($xml === false) {
|
libxml_disable_entity_loader(true);
|
||||||
sendEppError($conn, $pdo, 2001, 'Invalid XML syntax');
|
libxml_use_internal_errors(true);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$xml->registerXPathNamespace('e', 'urn:ietf:params:xml:ns:epp-1.0');
|
$xml = simplexml_load_string($xmlData);
|
||||||
$xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
if ($xml === false) {
|
||||||
$xml->registerXPathNamespace('domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
sendEppError($conn, $pdo, 2001, 'Invalid XML syntax');
|
||||||
$xml->registerXPathNamespace('contact', 'urn:ietf:params:xml:ns:contact-1.0');
|
continue;
|
||||||
$xml->registerXPathNamespace('host', 'urn:ietf:params:xml:ns:host-1.0');
|
}
|
||||||
$xml->registerXPathNamespace('rgp', 'urn:ietf:params:xml:ns:rgp-1.0');
|
|
||||||
$xml->registerXPathNamespace('secDNS', 'urn:ietf:params:xml:ns:secDNS-1.1');
|
|
||||||
$xml->registerXPathNamespace('launch', 'urn:ietf:params:xml:ns:launch-1.0');
|
|
||||||
$xml->registerXPathNamespace('fee', 'urn:ietf:params:xml:ns:epp:fee-1.0');
|
|
||||||
$xml->registerXPathNamespace('mark', 'urn:ietf:params:xml:ns:mark-1.0');
|
|
||||||
$xml->registerXPathNamespace('allocationToken', 'urn:ietf:params:xml:ns:allocationToken-1.0');
|
|
||||||
|
|
||||||
if ($xml->getName() != 'epp') {
|
$xml->registerXPathNamespace('e', 'urn:ietf:params:xml:ns:epp-1.0');
|
||||||
sendEppError($conn, $pdo, 2001, 'Root element must be <epp>');
|
$xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
||||||
continue;
|
$xml->registerXPathNamespace('domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
||||||
}
|
$xml->registerXPathNamespace('contact', 'urn:ietf:params:xml:ns:contact-1.0');
|
||||||
|
$xml->registerXPathNamespace('host', 'urn:ietf:params:xml:ns:host-1.0');
|
||||||
|
$xml->registerXPathNamespace('rgp', 'urn:ietf:params:xml:ns:rgp-1.0');
|
||||||
|
$xml->registerXPathNamespace('secDNS', 'urn:ietf:params:xml:ns:secDNS-1.1');
|
||||||
|
$xml->registerXPathNamespace('launch', 'urn:ietf:params:xml:ns:launch-1.0');
|
||||||
|
$xml->registerXPathNamespace('fee', 'urn:ietf:params:xml:ns:epp:fee-1.0');
|
||||||
|
$xml->registerXPathNamespace('mark', 'urn:ietf:params:xml:ns:mark-1.0');
|
||||||
|
$xml->registerXPathNamespace('allocationToken', 'urn:ietf:params:xml:ns:allocationToken-1.0');
|
||||||
|
|
||||||
switch (true) {
|
if ($xml->getName() != 'epp') {
|
||||||
case isset($xml->command->login):
|
sendEppError($conn, $pdo, 2001, 'Root element must be <epp>');
|
||||||
{
|
continue;
|
||||||
$clID = (string) $xml->command->login->clID;
|
}
|
||||||
$pw = (string) $xml->command->login->pw;
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $clID);
|
|
||||||
if (!$clid) {
|
|
||||||
sendEppError($conn, $pdo, 2201, 'Unknown client identifier', $clTRID);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
|
|
||||||
if (checkLogin($pdo, $clID, $pw)) {
|
switch (true) {
|
||||||
if (isset($xml->command->login->newPW)) {
|
case isset($xml->command->login):
|
||||||
$newPW = (string) $xml->command->login->newPW;
|
{
|
||||||
$options = [
|
$clID = (string) $xml->command->login->clID;
|
||||||
'memory_cost' => 1024 * 128,
|
$pw = (string) $xml->command->login->pw;
|
||||||
'time_cost' => 6,
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
'threads' => 4,
|
$clid = getClid($pdo, $clID);
|
||||||
];
|
if (!$clid) {
|
||||||
$hashedPassword = password_hash($newPW, PASSWORD_ARGON2ID, $options);
|
sendEppError($conn, $pdo, 2201, 'Unknown client identifier', $clTRID);
|
||||||
try {
|
break;
|
||||||
$stmt = $pdo->prepare("UPDATE registrar SET pw = :newPW WHERE clid = :clID");
|
}
|
||||||
$stmt->bindParam(':newPW', $hashedPassword);
|
$xmlString = $xml->asXML();
|
||||||
$stmt->bindParam(':clID', $clID);
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$stmt->execute();
|
|
||||||
} catch (PDOException $e) {
|
if (checkLogin($pdo, $clID, $pw)) {
|
||||||
sendEppError($conn, $pdo, 2400, 'Password could not be changed', $clTRID);
|
if (isset($xml->command->login->newPW)) {
|
||||||
|
$newPW = (string) $xml->command->login->newPW;
|
||||||
|
$options = [
|
||||||
|
'memory_cost' => 1024 * 128,
|
||||||
|
'time_cost' => 6,
|
||||||
|
'threads' => 4,
|
||||||
|
];
|
||||||
|
$hashedPassword = password_hash($newPW, PASSWORD_ARGON2ID, $options);
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->prepare("UPDATE registrar SET pw = :newPW WHERE clid = :clID");
|
||||||
|
$stmt->bindParam(':newPW', $hashedPassword);
|
||||||
|
$stmt->bindParam(':clID', $clID);
|
||||||
|
$stmt->execute();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
sendEppError($conn, $pdo, 2400, 'Password could not be changed', $clTRID);
|
||||||
|
}
|
||||||
|
|
||||||
|
$svTRID = generateSvTRID();
|
||||||
|
$response = [
|
||||||
|
'command' => 'login',
|
||||||
|
'resultCode' => 1000,
|
||||||
|
'lang' => 'en-US',
|
||||||
|
'clTRID' => $clTRID,
|
||||||
|
'svTRID' => $svTRID,
|
||||||
|
'msg' => 'Password changed successfully. Session will be terminated'
|
||||||
|
];
|
||||||
|
|
||||||
|
$epp = new EPP\EppWriter();
|
||||||
|
$xml = $epp->epp_writer($response);
|
||||||
|
updateTransaction($pdo, 'login', null, null, 1000, 'Password changed successfully. Session will be terminated', $svTRID, $xml, $trans);
|
||||||
|
sendEppResponse($conn, $xml);
|
||||||
|
$conn->close();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$table->set($connId, ['clid' => $clID, 'logged_in' => 1]);
|
||||||
$svTRID = generateSvTRID();
|
$svTRID = generateSvTRID();
|
||||||
$response = [
|
$response = [
|
||||||
'command' => 'login',
|
'command' => 'login',
|
||||||
|
@ -228,22 +263,31 @@ $server->handle(function (Connection $conn) use ($table, $eppExtensionsTable, $p
|
||||||
'lang' => 'en-US',
|
'lang' => 'en-US',
|
||||||
'clTRID' => $clTRID,
|
'clTRID' => $clTRID,
|
||||||
'svTRID' => $svTRID,
|
'svTRID' => $svTRID,
|
||||||
'msg' => 'Password changed successfully. Session will be terminated'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$epp = new EPP\EppWriter();
|
$epp = new EPP\EppWriter();
|
||||||
$xml = $epp->epp_writer($response);
|
$xml = $epp->epp_writer($response);
|
||||||
updateTransaction($pdo, 'login', null, null, 1000, 'Password changed successfully. Session will be terminated', $svTRID, $xml, $trans);
|
$log->info('registrar ' . $clID . ' logged in');
|
||||||
|
updateTransaction($pdo, 'login', null, null, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
$conn->close();
|
} else {
|
||||||
break;
|
sendEppError($conn, $pdo, 2200, 'Authentication error', $clTRID);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
$table->set($connId, ['clid' => $clID, 'logged_in' => 1]);
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->logout):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clid = getClid($pdo, $clID);
|
||||||
|
$table->del($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$svTRID = generateSvTRID();
|
$svTRID = generateSvTRID();
|
||||||
$response = [
|
$response = [
|
||||||
'command' => 'login',
|
'command' => 'logout',
|
||||||
'resultCode' => 1000,
|
'resultCode' => 1500,
|
||||||
'lang' => 'en-US',
|
'lang' => 'en-US',
|
||||||
'clTRID' => $clTRID,
|
'clTRID' => $clTRID,
|
||||||
'svTRID' => $svTRID,
|
'svTRID' => $svTRID,
|
||||||
|
@ -251,375 +295,348 @@ $server->handle(function (Connection $conn) use ($table, $eppExtensionsTable, $p
|
||||||
|
|
||||||
$epp = new EPP\EppWriter();
|
$epp = new EPP\EppWriter();
|
||||||
$xml = $epp->epp_writer($response);
|
$xml = $epp->epp_writer($response);
|
||||||
$log->info('registrar ' . $clID . ' logged in');
|
$log->info('registrar ' . $clID . ' logged out');
|
||||||
updateTransaction($pdo, 'login', null, null, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($pdo, 'logout', null, null, 1500, 'Command completed successfully; ending session', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
} else {
|
$conn->close();
|
||||||
sendEppError($conn, $pdo, 2200, 'Authentication error', $clTRID);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->hello):
|
||||||
|
{
|
||||||
|
sendGreeting($conn, $eppExtensionsTable);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->poll):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processPoll($conn, $pdo, $xml, $data['clid'], $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->check) && isset($xml->command->check->children('urn:ietf:params:xml:ns:contact-1.0')->check):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
if ($c['minimum_data']) {
|
||||||
|
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processContactCheck($conn, $pdo, $xml, $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->create) && isset($xml->command->create->children('urn:ietf:params:xml:ns:contact-1.0')->create):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
if ($c['minimum_data']) {
|
||||||
|
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processContactCreate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->info) && isset($xml->command->info->children('urn:ietf:params:xml:ns:contact-1.0')->info):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
if ($c['minimum_data']) {
|
||||||
|
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processContactInfo($conn, $pdo, $xml, $data['clid'], $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->update) && isset($xml->command->update->children('urn:ietf:params:xml:ns:contact-1.0')->update):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
if ($c['minimum_data']) {
|
||||||
|
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processContactUpdate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->delete) && isset($xml->command->delete->children('urn:ietf:params:xml:ns:contact-1.0')->delete):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
if ($c['minimum_data']) {
|
||||||
|
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processContactDelete($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->transfer) && isset($xml->command->transfer->children('urn:ietf:params:xml:ns:contact-1.0')->transfer):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
if ($c['minimum_data']) {
|
||||||
|
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processContactTransfer($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case isset($xml->command->check) && isset($xml->command->check->children('urn:ietf:params:xml:ns:domain-1.0')->check):
|
||||||
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processDomainCheck($conn, $pdo, $xml, $trans, $data['clid']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->logout):
|
case isset($xml->command->info) && isset($xml->command->info->children('urn:ietf:params:xml:ns:domain-1.0')->info):
|
||||||
{
|
{
|
||||||
$data = $table->get($connId);
|
$data = $table->get($connId);
|
||||||
$clid = getClid($pdo, $clID);
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
$table->del($connId);
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$xmlString = $xml->asXML();
|
||||||
$xmlString = $xml->asXML();
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$svTRID = generateSvTRID();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$response = [
|
$conn->close();
|
||||||
'command' => 'logout',
|
}
|
||||||
'resultCode' => 1500,
|
processDomainInfo($conn, $pdo, $xml, $clid, $trans);
|
||||||
'lang' => 'en-US',
|
break;
|
||||||
'clTRID' => $clTRID,
|
|
||||||
'svTRID' => $svTRID,
|
|
||||||
];
|
|
||||||
|
|
||||||
$epp = new EPP\EppWriter();
|
|
||||||
$xml = $epp->epp_writer($response);
|
|
||||||
$log->info('registrar ' . $clID . ' logged out');
|
|
||||||
updateTransaction($pdo, 'logout', null, null, 1500, 'Command completed successfully; ending session', $svTRID, $xml, $trans);
|
|
||||||
sendEppResponse($conn, $xml);
|
|
||||||
$conn->close();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->hello):
|
|
||||||
{
|
|
||||||
sendGreeting($conn, $eppExtensionsTable);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->poll):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
}
|
||||||
processPoll($conn, $pdo, $xml, $data['clid'], $trans);
|
|
||||||
break;
|
case isset($xml->command->update) && isset($xml->command->update->children('urn:ietf:params:xml:ns:domain-1.0')->update):
|
||||||
}
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
case isset($xml->command->check) && isset($xml->command->check->children('urn:ietf:params:xml:ns:contact-1.0')->check):
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
{
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$data = $table->get($connId);
|
$xmlString = $xml->asXML();
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$clid = getClid($pdo, $data['clid']);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$xmlString = $xml->asXML();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
$conn->close();
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
}
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
processDomainUpdate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
$conn->close();
|
break;
|
||||||
}
|
}
|
||||||
if ($c['minimum_data']) {
|
|
||||||
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
case isset($xml->command->create) && isset($xml->command->create->children('urn:ietf:params:xml:ns:domain-1.0')->create):
|
||||||
$conn->close();
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processDomainCreate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans, $c['minimum_data']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
processContactCheck($conn, $pdo, $xml, $trans);
|
|
||||||
break;
|
case isset($xml->command->delete) && isset($xml->command->delete->children('urn:ietf:params:xml:ns:domain-1.0')->delete):
|
||||||
}
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
case isset($xml->command->create) && isset($xml->command->create->children('urn:ietf:params:xml:ns:contact-1.0')->create):
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
{
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$data = $table->get($connId);
|
$xmlString = $xml->asXML();
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$clid = getClid($pdo, $data['clid']);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$xmlString = $xml->asXML();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
$conn->close();
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
}
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
processDomainDelete($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
$conn->close();
|
break;
|
||||||
}
|
}
|
||||||
if ($c['minimum_data']) {
|
|
||||||
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
case isset($xml->command->transfer) && isset($xml->command->transfer->children('urn:ietf:params:xml:ns:domain-1.0')->transfer):
|
||||||
$conn->close();
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processDomainTransfer($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
processContactCreate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
case isset($xml->command->check) && isset($xml->command->check->children('urn:ietf:params:xml:ns:host-1.0')->check):
|
||||||
}
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
case isset($xml->command->info) && isset($xml->command->info->children('urn:ietf:params:xml:ns:contact-1.0')->info):
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
{
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$data = $table->get($connId);
|
$xmlString = $xml->asXML();
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$clid = getClid($pdo, $data['clid']);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$xmlString = $xml->asXML();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
$conn->close();
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
}
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
processHostCheck($conn, $pdo, $xml, $trans);
|
||||||
$conn->close();
|
break;
|
||||||
}
|
}
|
||||||
if ($c['minimum_data']) {
|
|
||||||
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
case isset($xml->command->create) && isset($xml->command->create->children('urn:ietf:params:xml:ns:host-1.0')->create):
|
||||||
$conn->close();
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processHostCreate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
processContactInfo($conn, $pdo, $xml, $data['clid'], $trans);
|
|
||||||
break;
|
case isset($xml->command->info) && isset($xml->command->info->children('urn:ietf:params:xml:ns:host-1.0')->info):
|
||||||
}
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
case isset($xml->command->update) && isset($xml->command->update->children('urn:ietf:params:xml:ns:contact-1.0')->update):
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
{
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$data = $table->get($connId);
|
$xmlString = $xml->asXML();
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$clid = getClid($pdo, $data['clid']);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$xmlString = $xml->asXML();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
$conn->close();
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
}
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
processHostInfo($conn, $pdo, $xml, $trans);
|
||||||
$conn->close();
|
break;
|
||||||
}
|
}
|
||||||
if ($c['minimum_data']) {
|
|
||||||
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
case isset($xml->command->update) && isset($xml->command->update->children('urn:ietf:params:xml:ns:host-1.0')->update):
|
||||||
$conn->close();
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processHostUpdate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
processContactUpdate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
case isset($xml->command->delete) && isset($xml->command->delete->children('urn:ietf:params:xml:ns:host-1.0')->delete):
|
||||||
}
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
case isset($xml->command->delete) && isset($xml->command->delete->children('urn:ietf:params:xml:ns:contact-1.0')->delete):
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
{
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$data = $table->get($connId);
|
$xmlString = $xml->asXML();
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$clid = getClid($pdo, $data['clid']);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$xmlString = $xml->asXML();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
$conn->close();
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
}
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
processHostDelete($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
$conn->close();
|
break;
|
||||||
}
|
}
|
||||||
if ($c['minimum_data']) {
|
|
||||||
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
case isset($xml->command->info) && isset($xml->command->info->children('https://namingo.org/epp/funds-1.0')->info):
|
||||||
$conn->close();
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
$clid = getClid($pdo, $data['clid']);
|
||||||
|
$xmlString = $xml->asXML();
|
||||||
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
|
$conn->close();
|
||||||
|
}
|
||||||
|
processFundsInfo($conn, $pdo, $xml, $data['clid'], $trans);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
processContactDelete($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
case isset($xml->command->renew) && isset($xml->command->renew->children('urn:ietf:params:xml:ns:domain-1.0')->renew):
|
||||||
}
|
{
|
||||||
|
$data = $table->get($connId);
|
||||||
case isset($xml->command->transfer) && isset($xml->command->transfer->children('urn:ietf:params:xml:ns:contact-1.0')->transfer):
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
{
|
$clid = getClid($pdo, $data['clid']);
|
||||||
$data = $table->get($connId);
|
$xmlString = $xml->asXML();
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
||||||
$clid = getClid($pdo, $data['clid']);
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
$xmlString = $xml->asXML();
|
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
$conn->close();
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
}
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
processDomainRenew($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
$conn->close();
|
break;
|
||||||
}
|
}
|
||||||
if ($c['minimum_data']) {
|
|
||||||
sendEppError($conn, $pdo, 2101, 'Contact commands are not supported in minimum data mode', $clTRID);
|
default:
|
||||||
$conn->close();
|
{
|
||||||
|
sendEppError($conn, $pdo, 2000, 'Unrecognized command');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
processContactTransfer($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->check) && isset($xml->command->check->children('urn:ietf:params:xml:ns:domain-1.0')->check):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainCheck($conn, $pdo, $xml, $trans, $data['clid']);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->info) && isset($xml->command->info->children('urn:ietf:params:xml:ns:domain-1.0')->info):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainInfo($conn, $pdo, $xml, $clid, $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->update) && isset($xml->command->update->children('urn:ietf:params:xml:ns:domain-1.0')->update):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainUpdate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->create) && isset($xml->command->create->children('urn:ietf:params:xml:ns:domain-1.0')->create):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainCreate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans, $c['minimum_data']);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->delete) && isset($xml->command->delete->children('urn:ietf:params:xml:ns:domain-1.0')->delete):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainDelete($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->transfer) && isset($xml->command->transfer->children('urn:ietf:params:xml:ns:domain-1.0')->transfer):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainTransfer($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->check) && isset($xml->command->check->children('urn:ietf:params:xml:ns:host-1.0')->check):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processHostCheck($conn, $pdo, $xml, $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->create) && isset($xml->command->create->children('urn:ietf:params:xml:ns:host-1.0')->create):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processHostCreate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->info) && isset($xml->command->info->children('urn:ietf:params:xml:ns:host-1.0')->info):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processHostInfo($conn, $pdo, $xml, $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->update) && isset($xml->command->update->children('urn:ietf:params:xml:ns:host-1.0')->update):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processHostUpdate($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->delete) && isset($xml->command->delete->children('urn:ietf:params:xml:ns:host-1.0')->delete):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processHostDelete($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->info) && isset($xml->command->info->children('https://namingo.org/epp/funds-1.0')->info):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processFundsInfo($conn, $pdo, $xml, $data['clid'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case isset($xml->command->renew) && isset($xml->command->renew->children('urn:ietf:params:xml:ns:domain-1.0')->renew):
|
|
||||||
{
|
|
||||||
$data = $table->get($connId);
|
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
|
||||||
$clid = getClid($pdo, $data['clid']);
|
|
||||||
$xmlString = $xml->asXML();
|
|
||||||
$trans = createTransaction($pdo, $clid, $clTRID, $xmlString);
|
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
|
||||||
sendEppError($conn, $pdo, 2202, 'Authorization error', $clTRID);
|
|
||||||
$conn->close();
|
|
||||||
}
|
|
||||||
processDomainRenew($conn, $pdo, $xml, $data['clid'], $c['db_type'], $trans);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
sendEppError($conn, $pdo, 2000, 'Unrecognized command');
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue