mirror of
https://github.com/getnamingo/registry.git
synced 2025-06-15 00:44:34 +02:00
More RST fixes
This commit is contained in:
parent
b150d95b36
commit
b11a80e0fb
7 changed files with 94 additions and 41 deletions
|
@ -414,8 +414,21 @@ try {
|
|||
|
||||
// Start of svcExtension
|
||||
$xml->startElementNS('rdeEppParams', 'svcExtension', null);
|
||||
$extUriArray = [];
|
||||
if (file_exists('/opt/registry/epp/extensions.json')) {
|
||||
$json = file_get_contents('/opt/registry/epp/extensions.json');
|
||||
$data = json_decode($json, true);
|
||||
|
||||
// Add extURI elements
|
||||
if (is_array($data)) {
|
||||
foreach ($data as $urn => $ext) {
|
||||
if (!empty($ext['enabled'])) {
|
||||
$extUriArray[] = $urn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fallback to hardcoded list if needed
|
||||
if (empty($extUriArray)) {
|
||||
$extUriArray = [
|
||||
'https://namingo.org/epp/funds-1.0',
|
||||
'https://namingo.org/epp/identica-1.0',
|
||||
|
@ -427,7 +440,7 @@ try {
|
|||
'urn:ietf:params:xml:ns:mark-1.0',
|
||||
'urn:ietf:params:xml:ns:allocationToken-1.0'
|
||||
];
|
||||
|
||||
}
|
||||
foreach ($extUriArray as $extUri) {
|
||||
$xml->writeElementNS('epp', 'extURI', null, $extUri);
|
||||
}
|
||||
|
|
|
@ -244,8 +244,8 @@ class ContactsController extends Controller
|
|||
return $response->withHeader('Location', '/contact/create')->withStatus(302);
|
||||
}
|
||||
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
||||
$this->container->get('flash')->addMessage('error', 'Unable to create contact: Password needs to be at least 6 and up to 16 characters long');
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 64)) {
|
||||
$this->container->get('flash')->addMessage('error', 'Unable to create contact: Password needs to be at least 6 and up to 64 characters long');
|
||||
return $response->withHeader('Location', '/contact/create')->withStatus(302);
|
||||
}
|
||||
|
||||
|
@ -644,8 +644,8 @@ class ContactsController extends Controller
|
|||
return $response->withHeader('Content-Type', 'application/json')->withStatus(400);
|
||||
}
|
||||
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
||||
$error = ["error" => "Unable to create contact: Password needs to be at least 6 and up to 16 characters long"];
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 64)) {
|
||||
$error = ["error" => "Unable to create contact: Password needs to be at least 6 and up to 64 characters long"];
|
||||
$response->getBody()->write(json_encode($error));
|
||||
return $response->withHeader('Content-Type', 'application/json')->withStatus(400);
|
||||
}
|
||||
|
@ -1498,8 +1498,8 @@ class ContactsController extends Controller
|
|||
return $response->withHeader('Location', '/contact/update/'.$identifier)->withStatus(302);
|
||||
}
|
||||
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
||||
$this->container->get('flash')->addMessage('error', 'Unable to update contact: Password needs to be at least 6 and up to 16 characters long');
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 64)) {
|
||||
$this->container->get('flash')->addMessage('error', 'Unable to update contact: Password needs to be at least 6 and up to 64 characters long');
|
||||
return $response->withHeader('Location', '/contact/update/'.$identifier)->withStatus(302);
|
||||
}
|
||||
|
||||
|
|
41
epp/extensions.json
Normal file
41
epp/extensions.json
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"urn:ietf:params:xml:ns:secDNS-1.1": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:rgp-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:launch-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:epp:fee-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:secDNS-1.1": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:allocationToken-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:epp:loginSec-1.0": {
|
||||
"enabled": false
|
||||
},
|
||||
"urn:ietf:params:xml:ns:epp:unhandled-namespaces-1.0": {
|
||||
"enabled": false
|
||||
},
|
||||
"urn:ietf:params:xml:ns:epp:secure-authinfo-transfer-1.0": {
|
||||
"enabled": false
|
||||
},
|
||||
"urn:ietf:params:xml:ns:idn-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"urn:ietf:params:xml:ns:mark-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"https://namingo.org/epp/funds-1.0": {
|
||||
"enabled": true
|
||||
},
|
||||
"https://namingo.org/epp/identica-1.0": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
|
@ -377,8 +377,12 @@ class EppWriter {
|
|||
private function _postamble($writer, $resp) {
|
||||
if (isset($resp['clTRID']) || isset($resp['svTRID'])) {
|
||||
$writer->startElement('trID');
|
||||
if (isset($resp['clTRID']) && $resp['clTRID'] !== '') {
|
||||
$writer->writeElement('clTRID', $resp['clTRID']);
|
||||
}
|
||||
if (isset($resp['svTRID']) && $resp['svTRID'] !== '') {
|
||||
$writer->writeElement('svTRID', $resp['svTRID']);
|
||||
}
|
||||
$writer->endElement(); // End of 'trID'
|
||||
}
|
||||
$writer->endElement(); // End of 'response'
|
||||
|
|
|
@ -242,8 +242,8 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID, $trans);
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 64)) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 64 characters long', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1228,8 +1228,8 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
|
|||
return;
|
||||
}
|
||||
|
||||
if (strlen($authInfo_pw) < 6 || strlen($authInfo_pw) > 16) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID, $trans);
|
||||
if (strlen($authInfo_pw) < 6 || strlen($authInfo_pw) > 64) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 64 characters long', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -318,8 +318,8 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
|
||||
$authInfo_pw = (string) $contactUpdate->chg->authInfo->pw;
|
||||
if ($authInfo_pw) {
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID, $trans);
|
||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 64)) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 64 characters long', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1349,8 +1349,8 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$authInfo_pw = (string)$authInfo_pw_elements[0];
|
||||
|
||||
if ($authInfo_pw) {
|
||||
if (strlen($authInfo_pw) < 6 || strlen($authInfo_pw) > 16) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID, $trans);
|
||||
if (strlen($authInfo_pw) < 6 || strlen($authInfo_pw) > 64) {
|
||||
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 64 characters long', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,11 +99,16 @@ function checkLogin($db, $clID, $pw) {
|
|||
return password_verify($pw, $hashedPassword);
|
||||
}
|
||||
|
||||
function sendGreeting($conn) {
|
||||
function sendGreeting($conn, Swoole\Table $eppExtensionsTable) {
|
||||
global $c;
|
||||
$currentDateTime = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$currentDate = $currentDateTime->format("Y-m-d\TH:i:s.v\Z");
|
||||
|
||||
$extensions = [];
|
||||
foreach ($eppExtensionsTable as $urn => $row) {
|
||||
$extensions[] = $urn;
|
||||
}
|
||||
|
||||
$response = [
|
||||
'command' => 'greeting',
|
||||
'svID' => $c['epp_greeting'],
|
||||
|
@ -115,17 +120,7 @@ function sendGreeting($conn) {
|
|||
'urn:ietf:params:xml:ns:contact-1.0',
|
||||
'urn:ietf:params:xml:ns:host-1.0'
|
||||
],
|
||||
'extensions' => [
|
||||
'https://namingo.org/epp/funds-1.0',
|
||||
'https://namingo.org/epp/identica-1.0',
|
||||
'urn:ietf:params:xml:ns:secDNS-1.1',
|
||||
'urn:ietf:params:xml:ns:rgp-1.0',
|
||||
'urn:ietf:params:xml:ns:launch-1.0',
|
||||
'urn:ietf:params:xml:ns:idn-1.0',
|
||||
'urn:ietf:params:xml:ns:epp:fee-1.0',
|
||||
'urn:ietf:params:xml:ns:mark-1.0',
|
||||
'urn:ietf:params:xml:ns:allocationToken-1.0'
|
||||
],
|
||||
'extensions' => $extensions,
|
||||
'dcp' => [ // Data Collection Policy (optional)
|
||||
'access' => ['all'],
|
||||
'statement' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue