mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-15 17:16:59 +02:00
parent
e7dde7724f
commit
35e9090009
9 changed files with 363 additions and 359 deletions
|
@ -65,7 +65,7 @@ function processHostCheck($conn, $db, $xml, $trans) {
|
||||||
|
|
||||||
// Validation for host name
|
// Validation for host name
|
||||||
if (!preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $host) && strlen($host) > 254) {
|
if (!preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $host) && strlen($host) > 254) {
|
||||||
sendEppError($conn, 2005, 'Invalid host name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid host name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,14 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
|
||||||
if (!$contactID) {
|
if (!$contactID) {
|
||||||
sendEppError($conn, 2003, 'Identifier type minLength value=3, maxLength value=16', $clTRID);
|
sendEppError($conn, $db, 2003, 'Identifier type minLength value=3, maxLength value=16', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validation for contact ID
|
// Validation for contact ID
|
||||||
$invalid_identifier = validate_identifier($contactID);
|
$invalid_identifier = validate_identifier($contactID);
|
||||||
if ($invalid_identifier) {
|
if ($invalid_identifier) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact ID', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact ID', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$contact = $stmt->fetch(PDO::FETCH_ASSOC);
|
$contact = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if ($contact) {
|
if ($contact) {
|
||||||
sendEppError($conn, 2302, 'Contact ID already exists', $clTRID);
|
sendEppError($conn, $db, 2302, 'Contact ID already exists', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,64 +65,64 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$postalInfoIntCc = (string) $postalInfoInt->addr->cc;
|
$postalInfoIntCc = (string) $postalInfoInt->addr->cc;
|
||||||
|
|
||||||
if (!$postalInfoIntName) {
|
if (!$postalInfoIntName) {
|
||||||
sendEppError($conn, 2003, 'Missing contact:name', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing contact:name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntName) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntName)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntName) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntName)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoIntOrg) {
|
if ($postalInfoIntOrg) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntOrg) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntOrg)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntOrg) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntOrg)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:org', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:org', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoIntStreet1) {
|
if ($postalInfoIntStreet1) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntStreet1) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntStreet1)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntStreet1) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntStreet1)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:street', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:street', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoIntStreet2) {
|
if ($postalInfoIntStreet2) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntStreet2) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntStreet2)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntStreet2) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntStreet2)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:street', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:street', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoIntStreet3) {
|
if ($postalInfoIntStreet3) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntStreet3) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntStreet3)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoIntStreet3) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoIntStreet3)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:street', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:street', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoIntCity)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoIntCity)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:city', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:city', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoIntSp) {
|
if ($postalInfoIntSp) {
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntSp) || !preg_match('/^[A-Z][a-zA-Z\-\.\s]{1,}$/', $postalInfoIntSp)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntSp) || !preg_match('/^[A-Z][a-zA-Z\-\.\s]{1,}$/', $postalInfoIntSp)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:sp', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:sp', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoIntPc) {
|
if ($postalInfoIntPc) {
|
||||||
if (preg_match('/(^\-)|(\-\-)|(\-$)/', $postalInfoIntPc) || !preg_match('/^[A-Z0-9\-\s]{3,}$/', $postalInfoIntPc)) {
|
if (preg_match('/(^\-)|(\-\-)|(\-$)/', $postalInfoIntPc) || !preg_match('/^[A-Z0-9\-\s]{3,}$/', $postalInfoIntPc)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:pc', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:pc', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^(AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW)$/', $postalInfoIntCc)) {
|
if (!preg_match('/^(AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW)$/', $postalInfoIntCc)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:cc', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:cc', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,70 +148,70 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$postalInfoLocCc = (string) $postalInfoLoc->addr->cc;
|
$postalInfoLocCc = (string) $postalInfoLoc->addr->cc;
|
||||||
|
|
||||||
if (!$postalInfoLocName) {
|
if (!$postalInfoLocName) {
|
||||||
sendEppError($conn, 2003, 'Missing contact:name', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing contact:name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocName) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocName)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocName) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocName)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoLocOrg) {
|
if ($postalInfoLocOrg) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocOrg) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocOrg)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocOrg) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocOrg)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:org', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:org', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoLocStreet1) {
|
if ($postalInfoLocStreet1) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocStreet1) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocStreet1)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocStreet1) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocStreet1)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:street', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:street', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoLocStreet2) {
|
if ($postalInfoLocStreet2) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocStreet2) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocStreet2)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocStreet2) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocStreet2)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:street', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:street', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoLocStreet3) {
|
if ($postalInfoLocStreet3) {
|
||||||
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocStreet3) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocStreet3)) {
|
if (preg_match('/(^\-)|(^\,)|(^\.)|(\-\-)|(\,\,)|(\.\.)|(\-$)/', $postalInfoLocStreet3) || !preg_match('/^[a-zA-Z0-9\-\&\,\.\/\s]{5,}$/', $postalInfoLocStreet3)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:street', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:street', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoLocCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoLocCity)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoLocCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoLocCity)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:city', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:city', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoLocSp) {
|
if ($postalInfoLocSp) {
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoLocSp) || !preg_match('/^[A-Z][a-zA-Z\-\.\s]{1,}$/', $postalInfoLocSp)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoLocSp) || !preg_match('/^[A-Z][a-zA-Z\-\.\s]{1,}$/', $postalInfoLocSp)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:sp', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:sp', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($postalInfoLocPc) {
|
if ($postalInfoLocPc) {
|
||||||
if (preg_match('/(^\-)|(\-\-)|(\-$)/', $postalInfoLocPc) || !preg_match('/^[A-Z0-9\-\s]{3,}$/', $postalInfoLocPc)) {
|
if (preg_match('/(^\-)|(\-\-)|(\-$)/', $postalInfoLocPc) || !preg_match('/^[A-Z0-9\-\s]{3,}$/', $postalInfoLocPc)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:pc', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:pc', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^(AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW)$/', $postalInfoLocCc)) {
|
if (!preg_match('/^(AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW)$/', $postalInfoLocCc)) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact:cc', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact:cc', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$postalInfoInt && !$postalInfoLoc) {
|
if (!$postalInfoInt && !$postalInfoLoc) {
|
||||||
sendEppError($conn, 2003, 'Missing contact:postalInfo', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing contact:postalInfo', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$voice = (string) $contactCreate->voice;
|
$voice = (string) $contactCreate->voice;
|
||||||
$voice_x = (string) $contactCreate->voice->attributes()->x;
|
$voice_x = (string) $contactCreate->voice->attributes()->x;
|
||||||
if ($voice && (!preg_match('/^\+\d{1,3}\.\d{1,14}$/', $voice) || strlen($voice) > 17)) {
|
if ($voice && (!preg_match('/^\+\d{1,3}\.\d{1,14}$/', $voice) || strlen($voice) > 17)) {
|
||||||
sendEppError($conn, 2005, 'Voice must be (\+[0-9]{1,3}\.[0-9]{1,14})', $clTRID);
|
sendEppError($conn, $db, 2005, 'Voice must be (\+[0-9]{1,3}\.[0-9]{1,14})', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,34 +230,34 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$fax_x = (string) $contactCreate->fax->attributes()->x;
|
$fax_x = (string) $contactCreate->fax->attributes()->x;
|
||||||
}
|
}
|
||||||
if ($fax && (!preg_match('/^\+\d{1,3}\.\d{1,14}$/', $fax) || strlen($fax) > 17)) {
|
if ($fax && (!preg_match('/^\+\d{1,3}\.\d{1,14}$/', $fax) || strlen($fax) > 17)) {
|
||||||
sendEppError($conn, 2005, 'Fax must be (\+[0-9]{1,3}\.[0-9]{1,14})', $clTRID);
|
sendEppError($conn, $db, 2005, 'Fax must be (\+[0-9]{1,3}\.[0-9]{1,14})', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = (string) $contactCreate->email;
|
$email = (string) $contactCreate->email;
|
||||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
sendEppError($conn, 2005, 'Email address failed check', $clTRID);
|
sendEppError($conn, $db, 2005, 'Email address failed check', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$authInfo_pw = (string) $contactCreate->authInfo->pw;
|
$authInfo_pw = (string) $contactCreate->authInfo->pw;
|
||||||
if (!$authInfo_pw) {
|
if (!$authInfo_pw) {
|
||||||
sendEppError($conn, 2003, 'Missing contact:pw', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing contact:pw', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
if ((strlen($authInfo_pw) < 6) || (strlen($authInfo_pw) > 16)) {
|
||||||
sendEppError($conn, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID);
|
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/[A-Z]/', $authInfo_pw)) {
|
if (!preg_match('/[A-Z]/', $authInfo_pw)) {
|
||||||
sendEppError($conn, 2005, 'Password should have both upper and lower case characters', $clTRID);
|
sendEppError($conn, $db, 2005, 'Password should have both upper and lower case characters', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/\d/', $authInfo_pw)) {
|
if (!preg_match('/\d/', $authInfo_pw)) {
|
||||||
sendEppError($conn, 2005, 'Password should contain one or more numbers', $clTRID);
|
sendEppError($conn, $db, 2005, 'Password should contain one or more numbers', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$nin_type = (string)$obj_ext->xpath('identica:nin/@type')[0] ?? '';
|
$nin_type = (string)$obj_ext->xpath('identica:nin/@type')[0] ?? '';
|
||||||
|
|
||||||
if (!preg_match('/\d/', $nin)) {
|
if (!preg_match('/\d/', $nin)) {
|
||||||
sendEppError($conn, 2005, 'NIN should contain one or more numbers', $clTRID);
|
sendEppError($conn, $db, 2005, 'NIN should contain one or more numbers', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!in_array($nin_type, ['personal', 'business'])) {
|
if (!in_array($nin_type, ['personal', 'business'])) {
|
||||||
sendEppError($conn, 2005, 'NIN type is invalid', $clTRID);
|
sendEppError($conn, $db, 2005, 'NIN type is invalid', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$crdate = $stmt->fetchColumn();
|
$crdate = $stmt->fetchColumn();
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
sendEppError($conn, 2400, 'Contact could not be created due to database error', $clTRID);
|
sendEppError($conn, $db, 2400, 'Contact could not be created due to database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,17 +399,17 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
if (preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $hostName) && strlen($hostName) < 254) {
|
if (preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $hostName) && strlen($hostName) < 254) {
|
||||||
$host_id_already_exist = $db->query("SELECT id FROM host WHERE name = '$hostName' LIMIT 1")->fetchColumn();
|
$host_id_already_exist = $db->query("SELECT id FROM host WHERE name = '$hostName' LIMIT 1")->fetchColumn();
|
||||||
if ($host_id_already_exist) {
|
if ($host_id_already_exist) {
|
||||||
sendEppError($conn, 2302, 'host:name already exists', $clTRID);
|
sendEppError($conn, $db, 2302, 'host:name already exists', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid host:name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid host:name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$host_addr_list = $xml->xpath('//addr');
|
$host_addr_list = $xml->xpath('//addr');
|
||||||
if (count($host_addr_list) > 13) {
|
if (count($host_addr_list) > 13) {
|
||||||
sendEppError($conn, 2306, 'No more than 13 host:addr are allowed', $clTRID);
|
sendEppError($conn, $db, 2306, 'No more than 13 host:addr are allowed', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,19 +433,19 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// v6 IP validation
|
// v6 IP validation
|
||||||
if ($addr_type === 'v6' && !filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
if ($addr_type === 'v6' && !filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||||
sendEppError($conn, 2005, 'Invalid host:addr v6', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid host:addr v6', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// v4 IP validation
|
// v4 IP validation
|
||||||
if ($addr_type !== 'v6' && !filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
|
if ($addr_type !== 'v6' && !filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
|
||||||
sendEppError($conn, 2005, 'Invalid host:addr v4', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid host:addr v4', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for duplicate IPs
|
// check for duplicate IPs
|
||||||
if (isset($nsArr[$addr_type][$addr])) {
|
if (isset($nsArr[$addr_type][$addr])) {
|
||||||
sendEppError($conn, 2306, 'Duplicated host:addr '.$addr, $clTRID);
|
sendEppError($conn, $db, 2306, 'Duplicated host:addr '.$addr, $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,12 +480,12 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$domain_exist) {
|
if (!$domain_exist) {
|
||||||
sendEppError($conn, 2303, 'A host name object can NOT be created in a repository for which no superordinate domain name object exists', $clTRID);
|
sendEppError($conn, $db, 2303, 'A host name object can NOT be created in a repository for which no superordinate domain name object exists', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clid != $clid_domain) {
|
if ($clid != $clid_domain) {
|
||||||
sendEppError($conn, 2201, 'The domain name belongs to another registrar, you are not allowed to create hosts for it', $clTRID);
|
sendEppError($conn, $db, 2201, 'The domain name belongs to another registrar, you are not allowed to create hosts for it', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$invalid_domain = validate_label($domainName, $db);
|
$invalid_domain = validate_label($domainName, $db);
|
||||||
|
|
||||||
if ($invalid_domain) {
|
if ($invalid_domain) {
|
||||||
sendEppError($conn, 2306, 'Invalid domain:name', $clTRID);
|
sendEppError($conn, $db, 2306, 'Invalid domain:name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$valid_tld) {
|
if (!$valid_tld) {
|
||||||
sendEppError($conn, 2306, 'Invalid domain extension', $clTRID);
|
sendEppError($conn, $db, 2306, 'Invalid domain extension', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$domain_already_exist = $stmt->fetchColumn();
|
$domain_already_exist = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($domain_already_exist) {
|
if ($domain_already_exist) {
|
||||||
sendEppError($conn, 2302, 'Domain name already exists', $clTRID);
|
sendEppError($conn, $db, 2302, 'Domain name already exists', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,7 +606,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$domain_already_reserved = $stmt->fetchColumn();
|
$domain_already_reserved = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($domain_already_reserved) {
|
if ($domain_already_reserved) {
|
||||||
sendEppError($conn, 2302, 'Domain name is reserved or restricted', $clTRID);
|
sendEppError($conn, $db, 2302, 'Domain name is reserved or restricted', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$period_unit = (string) $periodElement['unit'];
|
$period_unit = (string) $periodElement['unit'];
|
||||||
|
|
||||||
if ($period && (($period < 1) || ($period > 99))) {
|
if ($period && (($period < 1) || ($period > 99))) {
|
||||||
sendEppError($conn, 2004, 'domain:period minLength value=1, maxLength value=99', $clTRID);
|
sendEppError($conn, $db, 2004, 'domain:period minLength value=1, maxLength value=99', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} elseif (!$period) {
|
} elseif (!$period) {
|
||||||
$period = 1;
|
$period = 1;
|
||||||
|
@ -624,7 +624,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
if ($period_unit) {
|
if ($period_unit) {
|
||||||
if (!preg_match('/^(m|y)$/', $period_unit)) {
|
if (!preg_match('/^(m|y)$/', $period_unit)) {
|
||||||
sendEppError($conn, 2004, 'domain:period unit m|y', $clTRID);
|
sendEppError($conn, $db, 2004, 'domain:period unit m|y', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -639,7 +639,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match("/^(12|24|36|48|60|72|84|96|108|120)$/", $date_add)) {
|
if (!preg_match("/^(12|24|36|48|60|72|84|96|108|120)$/", $date_add)) {
|
||||||
sendEppError($conn, 2306, 'A domain name can initially be registered for 1-10 years period', $clTRID);
|
sendEppError($conn, $db, 2306, 'A domain name can initially be registered for 1-10 years period', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,12 +663,12 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$price) {
|
if (!$price) {
|
||||||
sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID);
|
sendEppError($conn, $db, 2400, 'The price, period and currency for such TLD are not declared', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($registrar_balance + $creditLimit) < $price) {
|
if (($registrar_balance + $creditLimit) < $price) {
|
||||||
sendEppError($conn, 2104, 'Low credit: minimum threshold reached', $clTRID);
|
sendEppError($conn, $db, 2104, 'Low credit: minimum threshold reached', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -677,24 +677,24 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$hostAttr_list = $ns->xpath('//domain:hostAttr');
|
$hostAttr_list = $ns->xpath('//domain:hostAttr');
|
||||||
|
|
||||||
if (count($hostObj_list) > 0 && count($hostAttr_list) > 0) {
|
if (count($hostObj_list) > 0 && count($hostAttr_list) > 0) {
|
||||||
sendEppError($conn, 2001, 'It cannot be hostObj and hostAttr at the same time, either one or the other', $clTRID);
|
sendEppError($conn, $db, 2001, 'It cannot be hostObj and hostAttr at the same time, either one or the other', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($hostObj_list) > 13) {
|
if (count($hostObj_list) > 13) {
|
||||||
sendEppError($conn, 2306, 'No more than 13 domain:hostObj are allowed', $clTRID);
|
sendEppError($conn, $db, 2306, 'No more than 13 domain:hostObj are allowed', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($hostAttr_list) > 13) {
|
if (count($hostAttr_list) > 13) {
|
||||||
sendEppError($conn, 2306, 'No more than 13 domain:hostAttr are allowed', $clTRID);
|
sendEppError($conn, $db, 2306, 'No more than 13 domain:hostAttr are allowed', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nsArr = [];
|
$nsArr = [];
|
||||||
foreach ($hostObj_list as $hostObj) {
|
foreach ($hostObj_list as $hostObj) {
|
||||||
if (isset($nsArr[(string)$hostObj])) {
|
if (isset($nsArr[(string)$hostObj])) {
|
||||||
sendEppError($conn, 2302, 'Duplicate nameserver '.(string)$hostObj, $clTRID);
|
sendEppError($conn, $db, 2302, 'Duplicate nameserver '.(string)$hostObj, $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$nsArr[(string)$hostObj] = 1;
|
$nsArr[(string)$hostObj] = 1;
|
||||||
|
@ -703,7 +703,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$nsArr = [];
|
$nsArr = [];
|
||||||
foreach ($ns->xpath('//domain:hostAttr/domain:hostName') as $hostName) {
|
foreach ($ns->xpath('//domain:hostAttr/domain:hostName') as $hostName) {
|
||||||
if (isset($nsArr[(string)$hostName])) {
|
if (isset($nsArr[(string)$hostName])) {
|
||||||
sendEppError($conn, 2302, 'Duplicate nameserver '.(string)$hostName, $clTRID);
|
sendEppError($conn, $db, 2302, 'Duplicate nameserver '.(string)$hostName, $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$nsArr[(string)$hostName] = 1;
|
$nsArr[(string)$hostName] = 1;
|
||||||
|
@ -714,7 +714,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$hostObj = strtoupper((string)$node);
|
$hostObj = strtoupper((string)$node);
|
||||||
|
|
||||||
if (preg_match("/[^A-Z0-9\.\-]/", $hostObj) || preg_match("/^-|^\.|-\.|\.-|\.\.|-$|\.$/", $hostObj)) {
|
if (preg_match("/[^A-Z0-9\.\-]/", $hostObj) || preg_match("/^-|^\.|-\.|\.-|\.\.|-$|\.$/", $hostObj)) {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostObj', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostObj', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,11 +727,11 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$host_id_already_exist = $stmt->fetch(PDO::FETCH_COLUMN);
|
$host_id_already_exist = $stmt->fetch(PDO::FETCH_COLUMN);
|
||||||
|
|
||||||
if (!$host_id_already_exist) {
|
if (!$host_id_already_exist) {
|
||||||
sendEppError($conn, 2303, 'domain:hostObj '.$hostObj.' does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'domain:hostObj '.$hostObj.' does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostObj', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostObj', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -742,7 +742,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$hostName = strtoupper((string)$node->xpath('//domain:hostName')[0]);
|
$hostName = strtoupper((string)$node->xpath('//domain:hostName')[0]);
|
||||||
|
|
||||||
if (preg_match("/[^A-Z0-9\.\-]/", $hostName) || preg_match("/^-|^\.-|-\.$|^\.$/", $hostName)) {
|
if (preg_match("/[^A-Z0-9\.\-]/", $hostName) || preg_match("/^-|^\.-|-\.$|^\.$/", $hostName)) {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostName', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostName', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,7 +764,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$hostAddrNodes = $node->xpath('//domain:hostAddr');
|
$hostAddrNodes = $node->xpath('//domain:hostAddr');
|
||||||
|
|
||||||
if (count($hostAddrNodes) > 13) {
|
if (count($hostAddrNodes) > 13) {
|
||||||
sendEppError($conn, 2306, 'No more than 13 domain:hostObj are allowed', $clTRID);
|
sendEppError($conn, $db, 2306, 'No more than 13 domain:hostObj are allowed', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -772,14 +772,14 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
foreach ($hostAddrNodes as $hostAddrNode) {
|
foreach ($hostAddrNodes as $hostAddrNode) {
|
||||||
$hostAddr = (string)$hostAddrNode;
|
$hostAddr = (string)$hostAddrNode;
|
||||||
if (isset($nsArr[$hostAddr])) {
|
if (isset($nsArr[$hostAddr])) {
|
||||||
sendEppError($conn, 2302, 'Duplicate IP'.$hostAddr, $clTRID);
|
sendEppError($conn, $db, 2302, 'Duplicate IP'.$hostAddr, $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$nsArr[$hostAddr] = true;
|
$nsArr[$hostAddr] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($hostAddrNodes) === 0) {
|
if (count($hostAddrNodes) === 0) {
|
||||||
sendEppError($conn, 2003, 'Missing domain:hostAddr', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing domain:hostAddr', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// true
|
// true
|
||||||
// Additional verifications for reserved or private IPs as per [RFC5735] [RFC5156] can go here.
|
// Additional verifications for reserved or private IPs as per [RFC5735] [RFC5156] can go here.
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostAddr v6', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostAddr v6', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -810,11 +810,11 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// true
|
// true
|
||||||
// Additional verifications for reserved or private IPs as per [RFC5735] [RFC5156] can go here.
|
// Additional verifications for reserved or private IPs as per [RFC5735] [RFC5156] can go here.
|
||||||
if ($hostAddr == '127.0.0.1') {
|
if ($hostAddr == '127.0.0.1') {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostAddr v4', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostAddr v4', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostAddr v4', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostAddr v4', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -840,17 +840,17 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Object does not exist error
|
// Object does not exist error
|
||||||
if (!$domain_exist) {
|
if (!$domain_exist) {
|
||||||
sendEppError($conn, 2303, 'domain:hostName '.$hostName.' . A host name object can NOT be created in a repository for which no superordinate domain name object exists', $clTRID);
|
sendEppError($conn, $db, 2303, 'domain:hostName '.$hostName.' . A host name object can NOT be created in a repository for which no superordinate domain name object exists', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authorization error
|
// Authorization error
|
||||||
if ($clid != $clid_domain) {
|
if ($clid != $clid_domain) {
|
||||||
sendEppError($conn, 2201, 'The domain name belongs to another registrar, you are not allowed to create hosts for it', $clTRID);
|
sendEppError($conn, $db, 2201, 'The domain name belongs to another registrar, you are not allowed to create hosts for it', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostName', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostName', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,7 +858,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Max 13 IP per host
|
// Max 13 IP per host
|
||||||
if (count($hostAddr_list) > 13) {
|
if (count($hostAddr_list) > 13) {
|
||||||
sendEppError($conn, 2306, 'No more than 13 IPs are allowed per host', $clTRID);
|
sendEppError($conn, $db, 2306, 'No more than 13 IPs are allowed per host', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,7 +867,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
foreach ($hostAddr_list as $node) {
|
foreach ($hostAddr_list as $node) {
|
||||||
$hostAddr = (string) $node;
|
$hostAddr = (string) $node;
|
||||||
if (isset($nsArr[$hostAddr])) {
|
if (isset($nsArr[$hostAddr])) {
|
||||||
sendEppError($conn, 2302, 'Duplicate IP'.$hostAddr, $clTRID);
|
sendEppError($conn, $db, 2302, 'Duplicate IP'.$hostAddr, $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$nsArr[$hostAddr] = 1;
|
$nsArr[$hostAddr] = 1;
|
||||||
|
@ -875,7 +875,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Check for missing host addresses
|
// Check for missing host addresses
|
||||||
if (count($hostAddr_list) === 0) {
|
if (count($hostAddr_list) === 0) {
|
||||||
sendEppError($conn, 2003, 'Missing domain:hostAddr', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing domain:hostAddr', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -898,7 +898,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// true
|
// true
|
||||||
// Add check for reserved or private IP addresses (not implemented here, add as needed)
|
// Add check for reserved or private IP addresses (not implemented here, add as needed)
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostAddr v6', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostAddr v6', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -909,11 +909,11 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// true
|
// true
|
||||||
// Add check for reserved or private IP addresses (not implemented here, add as needed)
|
// Add check for reserved or private IP addresses (not implemented here, add as needed)
|
||||||
if ($hostAddr === '127.0.0.1') {
|
if ($hostAddr === '127.0.0.1') {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostAddr v4', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostAddr v4', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostAddr v4', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostAddr v4', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -924,7 +924,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
if (preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $hostName) && strlen($hostName) < 254) {
|
if (preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $hostName) && strlen($hostName) < 254) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Invalid domain:hostName', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain:hostName', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -944,12 +944,12 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
sendEppError($conn, 2303, 'domain:registrant does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'domain:registrant does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clid != $row['clid']) {
|
if ($clid != $row['clid']) {
|
||||||
sendEppError($conn, 2201, 'The contact requested in the command does NOT belong to the current registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'The contact requested in the command does NOT belong to the current registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -961,7 +961,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Max five contacts per domain name for each type
|
// Max five contacts per domain name for each type
|
||||||
if ($size > 5) {
|
if ($size > 5) {
|
||||||
sendEppError($conn, 2306, 'No more than 5 '.$type.' contacts are allowed per domain name', $clTRID);
|
sendEppError($conn, $db, 2306, 'No more than 5 '.$type.' contacts are allowed per domain name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -975,12 +975,12 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
sendEppError($conn, 2303, 'domain:contact '.$type.' does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'domain:contact '.$type.' does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clid != $row['clid']) {
|
if ($clid != $row['clid']) {
|
||||||
sendEppError($conn, 2201, 'The contact type='.$type.' requested in the command does NOT belong to the current Registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'The contact type='.$type.' requested in the command does NOT belong to the current Registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -989,22 +989,22 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$authInfo_pw = $xml->xpath('//domain:authInfo/domain:pw[1]')[0] ?? null;
|
$authInfo_pw = $xml->xpath('//domain:authInfo/domain:pw[1]')[0] ?? null;
|
||||||
|
|
||||||
if (!$authInfo_pw) {
|
if (!$authInfo_pw) {
|
||||||
sendEppError($conn, 2003, 'Missing domain:pw', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing domain:pw', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($authInfo_pw) < 6 || strlen($authInfo_pw) > 16) {
|
if (strlen($authInfo_pw) < 6 || strlen($authInfo_pw) > 16) {
|
||||||
sendEppError($conn, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID);
|
sendEppError($conn, $db, 2005, 'Password needs to be at least 6 and up to 16 characters long', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/[A-Z]/', $authInfo_pw)) {
|
if (!preg_match('/[A-Z]/', $authInfo_pw)) {
|
||||||
sendEppError($conn, 2005, 'Password should have both upper and lower case characters', $clTRID);
|
sendEppError($conn, $db, 2005, 'Password should have both upper and lower case characters', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/\d/', $authInfo_pw)) {
|
if (!preg_match('/\d/', $authInfo_pw)) {
|
||||||
sendEppError($conn, 2005, 'Password should contain one or more numbers', $clTRID);
|
sendEppError($conn, $db, 2005, 'Password should contain one or more numbers', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1049,24 +1049,24 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// Data sanity checks
|
// Data sanity checks
|
||||||
// Validate keyTag
|
// Validate keyTag
|
||||||
if (!isset($keyTag) || !is_int($keyTag)) {
|
if (!isset($keyTag) || !is_int($keyTag)) {
|
||||||
sendEppError($conn, 2005, 'Incomplete keyTag provided', $clTRID);
|
sendEppError($conn, $db, 2005, 'Incomplete keyTag provided', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($keyTag < 0 || $keyTag > 65535) {
|
if ($keyTag < 0 || $keyTag > 65535) {
|
||||||
sendEppError($conn, 2006, 'Invalid keyTag provided', $clTRID);
|
sendEppError($conn, $db, 2006, 'Invalid keyTag provided', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate alg
|
// Validate alg
|
||||||
$validAlgorithms = [2, 3, 5, 6, 7, 8, 10, 13, 14, 15, 16];
|
$validAlgorithms = [2, 3, 5, 6, 7, 8, 10, 13, 14, 15, 16];
|
||||||
if (!isset($alg) || !in_array($alg, $validAlgorithms)) {
|
if (!isset($alg) || !in_array($alg, $validAlgorithms)) {
|
||||||
sendEppError($conn, 2006, 'Invalid algorithm', $clTRID);
|
sendEppError($conn, $db, 2006, 'Invalid algorithm', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate digestType and digest
|
// Validate digestType and digest
|
||||||
if (!isset($digestType) || !is_int($digestType)) {
|
if (!isset($digestType) || !is_int($digestType)) {
|
||||||
sendEppError($conn, 2005, 'Invalid digestType', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid digestType', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$validDigests = [
|
$validDigests = [
|
||||||
|
@ -1075,11 +1075,11 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
4 => 96 // SHA-384
|
4 => 96 // SHA-384
|
||||||
];
|
];
|
||||||
if (!isset($validDigests[$digestType])) {
|
if (!isset($validDigests[$digestType])) {
|
||||||
sendEppError($conn, 2006, 'Unsupported digestType', $clTRID);
|
sendEppError($conn, $db, 2006, 'Unsupported digestType', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isset($digest) || strlen($digest) != $validDigests[$digestType] || !ctype_xdigit($digest)) {
|
if (!isset($digest) || strlen($digest) != $validDigests[$digestType] || !ctype_xdigit($digest)) {
|
||||||
sendEppError($conn, 2006, 'Invalid digest length or format', $clTRID);
|
sendEppError($conn, $db, 2006, 'Invalid digest length or format', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1099,25 +1099,25 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// Validate flags
|
// Validate flags
|
||||||
$validFlags = [256, 257];
|
$validFlags = [256, 257];
|
||||||
if (isset($flags) && !in_array($flags, $validFlags)) {
|
if (isset($flags) && !in_array($flags, $validFlags)) {
|
||||||
sendEppError($conn, 2005, 'Invalid flags', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid flags', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate protocol
|
// Validate protocol
|
||||||
if (isset($protocol) && $protocol != 3) {
|
if (isset($protocol) && $protocol != 3) {
|
||||||
sendEppError($conn, 2006, 'Invalid protocol', $clTRID);
|
sendEppError($conn, $db, 2006, 'Invalid protocol', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate algKeyData
|
// Validate algKeyData
|
||||||
if (isset($algKeyData)) {
|
if (isset($algKeyData)) {
|
||||||
sendEppError($conn, 2005, 'Invalid algKeyData encoding', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid algKeyData encoding', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate pubKey
|
// Validate pubKey
|
||||||
if (isset($pubKey) && base64_encode(base64_decode($pubKey, true)) !== $pubKey) {
|
if (isset($pubKey) && base64_encode(base64_decode($pubKey, true)) !== $pubKey) {
|
||||||
sendEppError($conn, 2005, 'Invalid pubKey encoding', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid pubKey encoding', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1307,7 +1307,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$db->rollBack();
|
$db->rollBack();
|
||||||
|
|
||||||
sendEppError($conn, 2400, "Database failure: " . $e->getMessage(), $clTRID);
|
sendEppError($conn, $db, 2400, "Database failure: " . $e->getMessage(), $clTRID, $trans);
|
||||||
}
|
}
|
||||||
$svTRID = generateSvTRID();
|
$svTRID = generateSvTRID();
|
||||||
$response = [
|
$response = [
|
||||||
|
|
|
@ -5,7 +5,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
|
||||||
if (!$contactID) {
|
if (!$contactID) {
|
||||||
sendEppError($conn, 2003, 'Missing contact:id', $clTRID);
|
sendEppError($conn, $db, 2003, 'Missing contact:id', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$registrar_id_contact = $row['clid'] ?? null;
|
$registrar_id_contact = $row['clid'] ?? null;
|
||||||
|
|
||||||
if (!$contact_id) {
|
if (!$contact_id) {
|
||||||
sendEppError($conn, 2303, 'contact:id does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'contact:id does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clid = $clid['id'];
|
$clid = $clid['id'];
|
||||||
|
|
||||||
if ($clid !== $registrar_id_contact) {
|
if ($clid !== $registrar_id_contact) {
|
||||||
sendEppError($conn, 2201, 'Contact belongs to another registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'Contact belongs to another registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$registrantExists = $stmt->fetchColumn();
|
$registrantExists = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($registrantExists) {
|
if ($registrantExists) {
|
||||||
sendEppError($conn, 2305, 'This contact is associated with a domain as a registrant', $clTRID);
|
sendEppError($conn, $db, 2305, 'This contact is associated with a domain as a registrant', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$contactInUse = $stmt->fetchColumn();
|
$contactInUse = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($contactInUse) {
|
if ($contactInUse) {
|
||||||
sendEppError($conn, 2305, 'This contact is associated with a domain', $clTRID);
|
sendEppError($conn, $db, 2305, 'This contact is associated with a domain', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
while ($status = $stmt->fetchColumn()) {
|
while ($status = $stmt->fetchColumn()) {
|
||||||
if (preg_match('/.*(UpdateProhibited|DeleteProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
if (preg_match('/.*(UpdateProhibited|DeleteProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
||||||
sendEppError($conn, 2304, 'It has a status that does not allow deletion', $clTRID);
|
sendEppError($conn, $db, 2304, 'It has a status that does not allow deletion', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ function processContactDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->execute([$contact_id]);
|
$stmt->execute([$contact_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() != '00000') {
|
if ($stmt->errorCode() != '00000') {
|
||||||
sendEppError($conn, 2400, 'Contact was not deleted, it probably has links to other objects', $clTRID);
|
sendEppError($conn, $db, 2400, 'Contact was not deleted, it probably has links to other objects', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
|
||||||
if (!$hostName) {
|
if (!$hostName) {
|
||||||
sendEppError($conn, 2003, 'Specify your host name', $clTRID);
|
sendEppError($conn, $db, 2003, 'Specify your host name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$registrar_id_host = $result['clid'] ?? null;
|
$registrar_id_host = $result['clid'] ?? null;
|
||||||
|
|
||||||
if (!$host_id) {
|
if (!$host_id) {
|
||||||
sendEppError($conn, 2303, 'host:name does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'host:name does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clid = $clid['id'];
|
$clid = $clid['id'];
|
||||||
|
|
||||||
if ($clid !== $registrar_id_host) {
|
if ($clid !== $registrar_id_host) {
|
||||||
sendEppError($conn, 2201, 'Host belongs to another registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'Host belongs to another registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$nameserver_inuse = $stmt->fetchColumn();
|
$nameserver_inuse = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($nameserver_inuse) {
|
if ($nameserver_inuse) {
|
||||||
sendEppError($conn, 2305, 'It is not possible to delete because it is a dependency, it is used by some domain', $clTRID);
|
sendEppError($conn, $db, 2305, 'It is not possible to delete because it is a dependency, it is used by some domain', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ function processHostDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->execute([':host_id' => $host_id]);
|
$stmt->execute([':host_id' => $host_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() != '00000') {
|
if ($stmt->errorCode() != '00000') {
|
||||||
sendEppError($conn, 2400, 'The host was not deleted, it depends on other objects', $clTRID);
|
sendEppError($conn, $db, 2400, 'The host was not deleted, it depends on other objects', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
|
||||||
if (!$domainName) {
|
if (!$domainName) {
|
||||||
sendEppError($conn, 2003, 'Please specify the domain name that will be deleted', $clTRID);
|
sendEppError($conn, $db, 2003, 'Please specify the domain name that will be deleted', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
sendEppError($conn, 2303, 'domain:name does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'domain:name does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clid = $clid['id'];
|
$clid = $clid['id'];
|
||||||
|
|
||||||
if ($clid != $registrar_id_domain) {
|
if ($clid != $registrar_id_domain) {
|
||||||
sendEppError($conn, 2201, 'Domain belongs to another registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'Domain belongs to another registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$status = $row['status'];
|
$status = $row['status'];
|
||||||
if (preg_match('/.*(UpdateProhibited|DeleteProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
if (preg_match('/.*(UpdateProhibited|DeleteProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
||||||
sendEppError($conn, 2304, 'The domain name has a status that does not allow deletion', $clTRID);
|
sendEppError($conn, $db, 2304, 'The domain name has a status that does not allow deletion', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!isset($price)) {
|
if (!isset($price)) {
|
||||||
sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID);
|
sendEppError($conn, $db, 2400, 'The price, period and currency for such TLD are not declared', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() != "00000") {
|
if ($stmt->errorCode() != "00000") {
|
||||||
sendEppError($conn, 2400, 'The domain name has not been deleted, it has something to do with other objects', $clTRID);
|
sendEppError($conn, $db, 2400, 'The domain name has not been deleted, it has something to do with other objects', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!isset($price)) {
|
if (!isset($price)) {
|
||||||
sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID);
|
sendEppError($conn, $db, 2400, 'The price, period and currency for such TLD are not declared', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!isset($price)) {
|
if (!isset($price)) {
|
||||||
sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID);
|
sendEppError($conn, $db, 2400, 'The price, period and currency for such TLD are not declared', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!isset($price)) {
|
if (!isset($price)) {
|
||||||
sendEppError($conn, 2400, 'The price, period and currency for such TLD are not declared', $clTRID);
|
sendEppError($conn, $db, 2400, 'The price, period and currency for such TLD are not declared', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ function processContactInfo($conn, $db, $xml, $trans) {
|
||||||
// Validation for contact ID
|
// Validation for contact ID
|
||||||
$invalid_identifier = validate_identifier($contactID);
|
$invalid_identifier = validate_identifier($contactID);
|
||||||
if ($invalid_identifier) {
|
if ($invalid_identifier) {
|
||||||
sendEppError($conn, 2005, 'Invalid contact ID', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid contact ID', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ function processContactInfo($conn, $db, $xml, $trans) {
|
||||||
$contact = $stmt->fetch(PDO::FETCH_ASSOC);
|
$contact = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (!$contact) {
|
if (!$contact) {
|
||||||
sendEppError($conn, 2303, 'Contact does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'Contact does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ function processContactInfo($conn, $db, $xml, $trans) {
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
sendEppError($conn, 2400, 'Database error', $clTRID);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ function processHostInfo($conn, $db, $xml, $trans) {
|
||||||
|
|
||||||
// Validation for host name
|
// Validation for host name
|
||||||
if (!preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $hostName) && strlen($hostName) > 254) {
|
if (!preg_match('/^([A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9]){0,1}\\.){1,125}[A-Z0-9]([A-Z0-9-]{0,61}[A-Z0-9])$/i', $hostName) && strlen($hostName) > 254) {
|
||||||
sendEppError($conn, 2005, 'Invalid host name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid host name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ function processHostInfo($conn, $db, $xml, $trans) {
|
||||||
$host = $stmt->fetch(PDO::FETCH_ASSOC);
|
$host = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (!$host) {
|
if (!$host) {
|
||||||
sendEppError($conn, 2303, 'Host does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'Host does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ function processHostInfo($conn, $db, $xml, $trans) {
|
||||||
updateTransaction($db, 'info', 'host', 'H_'.$host['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($db, 'info', 'host', 'H_'.$host['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
sendEppError($conn, 2400, 'Database error', $clTRID);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,12 +175,12 @@ function processDomainInfo($conn, $db, $xml, $trans) {
|
||||||
// Validation for domain name
|
// Validation for domain name
|
||||||
$invalid_label = validate_label($domainName, $db);
|
$invalid_label = validate_label($domainName, $db);
|
||||||
if ($invalid_label) {
|
if ($invalid_label) {
|
||||||
sendEppError($conn, 2005, 'Invalid domain name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filter_var($domainName, FILTER_VALIDATE_DOMAIN)) {
|
if (!filter_var($domainName, FILTER_VALIDATE_DOMAIN)) {
|
||||||
sendEppError($conn, 2005, 'Invalid domain name', $clTRID);
|
sendEppError($conn, $db, 2005, 'Invalid domain name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ function processDomainInfo($conn, $db, $xml, $trans) {
|
||||||
$domain = $stmt->fetch(PDO::FETCH_ASSOC);
|
$domain = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (!$domain) {
|
if (!$domain) {
|
||||||
sendEppError($conn, 2303, 'Domain does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'Domain does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ function processDomainInfo($conn, $db, $xml, $trans) {
|
||||||
updateTransaction($db, 'info', 'domain', 'D_'.$domain['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($db, 'info', 'domain', 'D_'.$domain['id'], 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
sendEppError($conn, 2400, 'Database error', $clTRID);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ function processFundsInfo($conn, $db, $xml, $clid, $trans) {
|
||||||
$availableCredit = number_format($availableCredit, 2, '.', '');
|
$availableCredit = number_format($availableCredit, 2, '.', '');
|
||||||
|
|
||||||
if (!$funds) {
|
if (!$funds) {
|
||||||
sendEppError($conn, 2303, 'Registrar does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'Registrar does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,6 +374,6 @@ function processFundsInfo($conn, $db, $xml, $clid, $trans) {
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
sendEppError($conn, 2400, 'Database error', $clTRID);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,20 +10,20 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$clTRID = (string) $xml->command->clTRID;
|
$clTRID = (string) $xml->command->clTRID;
|
||||||
|
|
||||||
if (!$domainName) {
|
if (!$domainName) {
|
||||||
sendEppError($conn, 2003, 'Pleae provide domain name', $clTRID);
|
sendEppError($conn, $db, 2003, 'Please provide domain name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($period) {
|
if ($period) {
|
||||||
if ($period < 1 || $period > 99) {
|
if ($period < 1 || $period > 99) {
|
||||||
sendEppError($conn, 2004, "domain:period minLength value='1', maxLength value='99'");
|
sendEppError($conn, $db, 2004, "domain:period minLength value='1', maxLength value='99'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($periodUnit) {
|
if ($periodUnit) {
|
||||||
if (!preg_match("/^(m|y)$/", $periodUnit)) {
|
if (!preg_match("/^(m|y)$/", $periodUnit)) {
|
||||||
sendEppError($conn, 2004, "domain:period unit m|y");
|
sendEppError($conn, $db, 2004, "domain:period unit m|y");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,12 +39,12 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$domainData = $stmt->fetch(PDO::FETCH_ASSOC);
|
$domainData = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (!$domainData) {
|
if (!$domainData) {
|
||||||
sendEppError($conn, 2303, 'Domain does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'Domain does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clid['id'] != $domainData['clid']) {
|
if ($clid['id'] != $domainData['clid']) {
|
||||||
sendEppError($conn, 2201, 'It belongs to another registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'It belongs to another registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$status = $row['status'];
|
$status = $row['status'];
|
||||||
if (preg_match('/.*(RenewProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
if (preg_match('/.*(RenewProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
||||||
sendEppError($conn, 2304, 'It has a status that does not allow renew, first change the status', $clTRID);
|
sendEppError($conn, $db, 2304, 'It has a status that does not allow renew, first change the status', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$expiration_date = explode(" ", $domainData['exdate'])[0]; // remove time, keep only date
|
$expiration_date = explode(" ", $domainData['exdate'])[0]; // remove time, keep only date
|
||||||
|
|
||||||
if ($curExpDate !== $expiration_date) {
|
if ($curExpDate !== $expiration_date) {
|
||||||
sendEppError($conn, 2306, 'The expiration date does not match', $clTRID);
|
sendEppError($conn, $db, 2306, 'The expiration date does not match', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
if ($date_add > 0) {
|
if ($date_add > 0) {
|
||||||
// The number of units available MAY be subject to limits imposed by the server.
|
// The number of units available MAY be subject to limits imposed by the server.
|
||||||
if (!in_array($date_add, [12, 24, 36, 48, 60, 72, 84, 96, 108, 120])) {
|
if (!in_array($date_add, [12, 24, 36, 48, 60, 72, 84, 96, 108, 120])) {
|
||||||
sendEppError($conn, 2306, 'Not less than 1 year and not more than 10', $clTRID);
|
sendEppError($conn, $db, 2306, 'Not less than 1 year and not more than 10', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Domains can be renewed at any time, but the expire date cannot be more than 10 years in the future.
|
// Domains can be renewed at any time, but the expire date cannot be more than 10 years in the future.
|
||||||
if ($after_renew > $after_10_years) {
|
if ($after_renew > $after_10_years) {
|
||||||
sendEppError($conn, 2306, 'Domains can be renewed at any time, but the expire date cannot be more than 10 years in the future', $clTRID);
|
sendEppError($conn, $db, 2306, 'Domains can be renewed at any time, but the expire date cannot be more than 10 years in the future', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (($registrar_balance + $creditLimit) < $price) {
|
if (($registrar_balance + $creditLimit) < $price) {
|
||||||
sendEppError($conn, 2104, 'There is no money on the account to renew', $clTRID);
|
sendEppError($conn, $db, 2104, 'There is no money on the account to renew', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// Error check
|
// Error check
|
||||||
$errorInfo = $stmt->errorInfo();
|
$errorInfo = $stmt->errorInfo();
|
||||||
if (isset($errorInfo[2])) {
|
if (isset($errorInfo[2])) {
|
||||||
sendEppError($conn, 2400, 'It was not renewed successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'It was not renewed successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Update registrar's account balance:
|
// Update registrar's account balance:
|
||||||
|
|
|
@ -12,7 +12,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$authInfo_pw = (string)$obj->xpath('//contact:authInfo/contact:pw[1]')[0];
|
$authInfo_pw = (string)$obj->xpath('//contact:authInfo/contact:pw[1]')[0];
|
||||||
|
|
||||||
if (!$contactID) {
|
if (!$contactID) {
|
||||||
sendEppError($conn, 2003, 'Contact ID was not provided', $clTRID);
|
sendEppError($conn, $db, 2003, 'Contact ID was not provided', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$registrar_id_contact = $result['clid'] ?? null;
|
$registrar_id_contact = $result['clid'] ?? null;
|
||||||
|
|
||||||
if (!$contact_id) {
|
if (!$contact_id) {
|
||||||
sendEppError($conn, 2303, 'Contact does not exist', $clTRID);
|
sendEppError($conn, $db, 2303, 'Contact does not exist', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
if ($op === 'approve') {
|
if ($op === 'approve') {
|
||||||
if ($clid !== $registrar_id_contact) {
|
if ($clid !== $registrar_id_contact) {
|
||||||
sendEppError($conn, 2201, 'Only the losing registrar can approve', $clTRID);
|
sendEppError($conn, $db, 2201, 'Only the losing registrar can approve', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$contact_authinfo_id = $stmt->fetchColumn();
|
$contact_authinfo_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$contact_authinfo_id) {
|
if (!$contact_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($stmt->errorCode() != 0) {
|
if ($stmt->errorCode() != 0) {
|
||||||
sendEppError($conn, 2400, 'The transfer was not approved successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not approved successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
|
@ -104,13 +104,13 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} elseif ($op === 'cancel') {
|
} elseif ($op === 'cancel') {
|
||||||
// Only the requesting or 'Gaining' Registrar can cancel
|
// Only the requesting or 'Gaining' Registrar can cancel
|
||||||
if ($clid === $registrar_id_contact) {
|
if ($clid === $registrar_id_contact) {
|
||||||
sendEppError($conn, 2201, 'Only the applicant can cancel', $clTRID);
|
sendEppError($conn, $db, 2201, 'Only the applicant can cancel', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute([':contact_id' => $contact_id, ':authInfo_pw' => $authInfo_pw]);
|
$stmt->execute([':contact_id' => $contact_id, ':authInfo_pw' => $authInfo_pw]);
|
||||||
$contact_authinfo_id = $stmt->fetchColumn();
|
$contact_authinfo_id = $stmt->fetchColumn();
|
||||||
if (!$contact_authinfo_id) {
|
if (!$contact_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() != 0) {
|
if ($stmt->errorCode() != 0) {
|
||||||
sendEppError($conn, 2400, 'The transfer was not canceled successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not canceled successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
|
@ -171,7 +171,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} elseif ($op === 'query') {
|
} elseif ($op === 'query') {
|
||||||
|
@ -210,13 +210,13 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($db, 'transfer', 'contact', $identifier, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} elseif ($op === 'reject') {
|
} elseif ($op === 'reject') {
|
||||||
// Only the LOSING REGISTRAR can approve or reject
|
// Only the LOSING REGISTRAR can approve or reject
|
||||||
if ($clid !== $registrar_id_contact) {
|
if ($clid !== $registrar_id_contact) {
|
||||||
sendEppError($conn, 2201, 'Only the losing registrar can reject', $clTRID);
|
sendEppError($conn, $db, 2201, 'Only the losing registrar can reject', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$contact_authinfo_id = $stmt->fetchColumn();
|
$contact_authinfo_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$contact_authinfo_id) {
|
if (!$contact_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$updateStmt->execute([':contact_id' => $contact_id]);
|
$updateStmt->execute([':contact_id' => $contact_id]);
|
||||||
|
|
||||||
if ($updateStmt->errorCode() !== '00000') {
|
if ($updateStmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, 2400, 'The transfer was not successfully rejected, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not successfully rejected, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("SELECT `crid`, `crdate`, `upid`, `update`, `trdate`, `trstatus`, `reid`, `redate`, `acid`, `acdate` FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
$stmt = $db->prepare("SELECT `crid`, `crdate`, `upid`, `update`, `trdate`, `trstatus`, `reid`, `redate`, `acid`, `acdate` FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
||||||
|
@ -280,7 +280,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'Command failed because the contact is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} elseif ($op == 'request') {
|
} elseif ($op == 'request') {
|
||||||
|
@ -290,7 +290,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$days_from_registration = $stmt->fetchColumn();
|
$days_from_registration = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($days_from_registration < 60) {
|
if ($days_from_registration < 60) {
|
||||||
sendEppError($conn, 2201, 'The contact name must not be within 60 days of its initial registration', $clTRID);
|
sendEppError($conn, $db, 2201, 'The contact name must not be within 60 days of its initial registration', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$days_from_last_transfer = $result['intval'];
|
$days_from_last_transfer = $result['intval'];
|
||||||
|
|
||||||
if ($last_trdate && $days_from_last_transfer < 60) {
|
if ($last_trdate && $days_from_last_transfer < 60) {
|
||||||
sendEppError($conn, 2201, 'The contact name must not be within 60 days of its last transfer from another registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'The contact name must not be within 60 days of its last transfer from another registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$contact_authinfo_id = $stmt->fetchColumn();
|
$contact_authinfo_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$contact_authinfo_id) {
|
if (!$contact_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,13 +322,13 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
while ($status = $stmt->fetchColumn()) {
|
while ($status = $stmt->fetchColumn()) {
|
||||||
if (preg_match("/.*(TransferProhibited)$/", $status) || preg_match("/^pending/", $status)) {
|
if (preg_match("/.*(TransferProhibited)$/", $status) || preg_match("/^pending/", $status)) {
|
||||||
sendEppError($conn, 2304, 'It has a status that does not allow the transfer, first change the status', $clTRID);
|
sendEppError($conn, $db, 2304, 'It has a status that does not allow the transfer, first change the status', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clid == $registrar_id_contact) {
|
if ($clid == $registrar_id_contact) {
|
||||||
sendEppError($conn, 2106, 'Destination client of the transfer operation is the contact sponsoring client', $clTRID);
|
sendEppError($conn, $db, 2106, 'Destination client of the transfer operation is the contact sponsoring client', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($stmt->errorCode() != '00000') {
|
if ($stmt->errorCode() != '00000') {
|
||||||
sendEppError($conn, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("SELECT `crid`,`crdate`,`upid`,`update`,`trdate`,`trstatus`,`reid`,`redate`,`acid`,`acdate` FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
$stmt = $db->prepare("SELECT `crid`,`crdate`,`upid`,`update`,`trdate`,`trstatus`,`reid`,`redate`,`acid`,`acdate` FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
||||||
|
@ -389,11 +389,11 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} elseif ($op == 'pending') {
|
} elseif ($op == 'pending') {
|
||||||
sendEppError($conn, 2300, 'Command failed because the contact is pending transfer', $clTRID);
|
sendEppError($conn, $db, 2300, 'Command failed because the contact is pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2005, 'Only op: approve|cancel|query|reject|request are accepted', $clTRID);
|
sendEppError($conn, $db, 2005, 'Only op: approve|cancel|query|reject|request are accepted', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$authInfo_pw = (string)$xml->xpath('//domain:authInfo/domain:pw[1]')[0];
|
$authInfo_pw = (string)$xml->xpath('//domain:authInfo/domain:pw[1]')[0];
|
||||||
|
|
||||||
if (!$domainName) {
|
if (!$domainName) {
|
||||||
sendEppError($conn, 2003, 'Please provide the domain name', $clTRID);
|
sendEppError($conn, $db, 2003, 'Please provide the domain name', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$registrar_id_domain = $row['clid'] ?? null;
|
$registrar_id_domain = $row['clid'] ?? null;
|
||||||
|
|
||||||
if (!$domain_id) {
|
if (!$domain_id) {
|
||||||
sendEppError($conn, 2303, 'Domain does not exist in registry', $clTRID);
|
sendEppError($conn, $db, 2303, 'Domain does not exist in registry', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
if ($op === 'approve') {
|
if ($op === 'approve') {
|
||||||
if ($clid !== $registrar_id_domain) {
|
if ($clid !== $registrar_id_domain) {
|
||||||
sendEppError($conn, 2201, 'Only LOSING REGISTRAR can approve', $clTRID);
|
sendEppError($conn, $db, 2201, 'Only LOSING REGISTRAR can approve', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$domain_authinfo_id = $stmt->fetchColumn();
|
$domain_authinfo_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$domain_authinfo_id) {
|
if (!$domain_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -471,7 +471,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$price = $stmt->fetchColumn();
|
$price = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (($registrar_balance + $creditLimit) < $price) {
|
if (($registrar_balance + $creditLimit) < $price) {
|
||||||
sendEppError($conn, 2104, 'The registrar who took over this domain has no money to pay the renewal period that resulted from the transfer request', $clTRID);
|
sendEppError($conn, $db, 2104, 'The registrar who took over this domain has no money to pay the renewal period that resulted from the transfer request', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute([$row["reid"], $clid, $domain_id]);
|
$stmt->execute([$row["reid"], $clid, $domain_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== PDO::ERR_NONE) {
|
if ($stmt->errorCode() !== PDO::ERR_NONE) {
|
||||||
sendEppError($conn, 2400, 'The transfer was not successful, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not successful, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("UPDATE `registrar` SET `accountBalance` = (`accountBalance` - :price) WHERE `id` = :reid");
|
$stmt = $db->prepare("UPDATE `registrar` SET `accountBalance` = (`accountBalance` - :price) WHERE `id` = :reid");
|
||||||
|
@ -551,14 +551,14 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'The domain is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'The domain is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($op === 'cancel') {
|
elseif ($op === 'cancel') {
|
||||||
|
|
||||||
if ($clid === $registrar_id_domain) {
|
if ($clid === $registrar_id_domain) {
|
||||||
sendEppError($conn, 2201, 'Only the APPLICANT can cancel', $clTRID);
|
sendEppError($conn, $db, 2201, 'Only the APPLICANT can cancel', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,7 +568,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$domain_authinfo_id = $stmt->fetchColumn();
|
$domain_authinfo_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$domain_authinfo_id) {
|
if (!$domain_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== '00000') {
|
if ($stmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, 2400, 'The transfer was not canceled successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not canceled successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("SELECT `id`, `registrant`, `crdate`, `exdate`, `update`, `clid`, `crid`, `upid`, `trdate`, `trstatus`, `reid`, `redate`, `acid`, `acdate`, `transfer_exdate` FROM `domain` WHERE `name` = :name LIMIT 1");
|
$stmt = $db->prepare("SELECT `id`, `registrant`, `crdate`, `exdate`, `update`, `clid`, `crid`, `upid`, `trdate`, `trstatus`, `reid`, `redate`, `acid`, `acdate`, `transfer_exdate` FROM `domain` WHERE `name` = :name LIMIT 1");
|
||||||
|
@ -625,7 +625,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'The domain is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'The domain is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -672,14 +672,14 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($db, 'transfer', 'domain', $domainName, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'The domain is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'The domain is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($op === 'reject') {
|
elseif ($op === 'reject') {
|
||||||
|
|
||||||
if ($clid !== $registrar_id_domain) {
|
if ($clid !== $registrar_id_domain) {
|
||||||
sendEppError($conn, 2201, 'Only LOSING REGISTRAR can reject', $clTRID);
|
sendEppError($conn, $db, 2201, 'Only LOSING REGISTRAR can reject', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,7 +689,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$domain_authinfo_id = $stmtAuthInfo->fetchColumn();
|
$domain_authinfo_id = $stmtAuthInfo->fetchColumn();
|
||||||
|
|
||||||
if (!$domain_authinfo_id) {
|
if (!$domain_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is not correct', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is not correct', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -704,7 +704,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$success = $stmtUpdate->execute(['domain_id' => $domain_id]);
|
$success = $stmtUpdate->execute(['domain_id' => $domain_id]);
|
||||||
|
|
||||||
if (!$success || $stmtUpdate->errorCode() !== '00000') {
|
if (!$success || $stmtUpdate->errorCode() !== '00000') {
|
||||||
sendEppError($conn, 2400, 'The transfer was not successfully rejected, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not successfully rejected, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
$stmtReID = $db->prepare("SELECT `clid` FROM `registrar` WHERE `id` = :reid LIMIT 1");
|
$stmtReID = $db->prepare("SELECT `clid` FROM `registrar` WHERE `id` = :reid LIMIT 1");
|
||||||
|
@ -741,7 +741,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2301, 'The domain is NOT pending transfer', $clTRID);
|
sendEppError($conn, $db, 2301, 'The domain is NOT pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -753,7 +753,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$days_from_registration = $stmt->fetchColumn();
|
$days_from_registration = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($days_from_registration < 60) {
|
if ($days_from_registration < 60) {
|
||||||
sendEppError($conn, 2201, 'The domain name must not be within 60 days of its initial registration', $clTRID);
|
sendEppError($conn, $db, 2201, 'The domain name must not be within 60 days of its initial registration', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -765,7 +765,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$days_from_last_transfer = $result["intval"];
|
$days_from_last_transfer = $result["intval"];
|
||||||
|
|
||||||
if ($last_trdate && $days_from_last_transfer < 60) {
|
if ($last_trdate && $days_from_last_transfer < 60) {
|
||||||
sendEppError($conn, 2201, 'The domain name must not be within 60 days of its last transfer from another registrar', $clTRID);
|
sendEppError($conn, $db, 2201, 'The domain name must not be within 60 days of its last transfer from another registrar', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -775,7 +775,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$days_from_expiry_date = $stmt->fetchColumn();
|
$days_from_expiry_date = $stmt->fetchColumn();
|
||||||
|
|
||||||
if ($days_from_expiry_date > 30) {
|
if ($days_from_expiry_date > 30) {
|
||||||
sendEppError($conn, 2201, 'The domain name must not be more than 30 days past its expiry date', $clTRID);
|
sendEppError($conn, $db, 2201, 'The domain name must not be more than 30 days past its expiry date', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,7 +785,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$domain_authinfo_id = $stmt->fetchColumn();
|
$domain_authinfo_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
if (!$domain_authinfo_id) {
|
if (!$domain_authinfo_id) {
|
||||||
sendEppError($conn, 2202, 'authInfo pw is invalid', $clTRID);
|
sendEppError($conn, $db, 2202, 'authInfo pw is invalid', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -794,13 +794,13 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
while ($status = $stmt->fetchColumn()) {
|
while ($status = $stmt->fetchColumn()) {
|
||||||
if (preg_match('/.*(TransferProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
if (preg_match('/.*(TransferProhibited)$/', $status) || preg_match('/^pending/', $status)) {
|
||||||
sendEppError($conn, 2304, 'It has a status that does not allow the transfer', $clTRID);
|
sendEppError($conn, $db, 2304, 'It has a status that does not allow the transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($clid == $registrar_id_domain) {
|
if ($clid == $registrar_id_domain) {
|
||||||
sendEppError($conn, 2106, 'Destination client of the transfer operation is the domain sponsoring client', $clTRID);
|
sendEppError($conn, $db, 2106, 'Destination client of the transfer operation is the domain sponsoring client', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,14 +829,14 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
if ($period) {
|
if ($period) {
|
||||||
if ($period < 1 || $period > 99) {
|
if ($period < 1 || $period > 99) {
|
||||||
sendEppError($conn, 2004, "domain:period minLength value='1', maxLength value='99'", $clTRID);
|
sendEppError($conn, $db, 2004, "domain:period minLength value='1', maxLength value='99'", $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($period_unit) {
|
if ($period_unit) {
|
||||||
if (!in_array($period_unit, ['m', 'y'])) {
|
if (!in_array($period_unit, ['m', 'y'])) {
|
||||||
sendEppError($conn, 2004, 'domain:period unit m|y', $clTRID);
|
sendEppError($conn, $db, 2004, 'domain:period unit m|y', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -851,7 +851,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
if ($date_add > 0) {
|
if ($date_add > 0) {
|
||||||
|
|
||||||
if (!preg_match("/^(12|24|36|48|60|72|84|96|108|120)$/", $date_add)) {
|
if (!preg_match("/^(12|24|36|48|60|72|84|96|108|120)$/", $date_add)) {
|
||||||
sendEppError($conn, 2306, 'Not less than 1 year and not more than 10', $clTRID);
|
sendEppError($conn, $db, 2306, 'Not less than 1 year and not more than 10', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -867,7 +867,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$price = $result["m$date_add"];
|
$price = $result["m$date_add"];
|
||||||
|
|
||||||
if (($registrar_balance + $creditLimit) < $price) {
|
if (($registrar_balance + $creditLimit) < $price) {
|
||||||
sendEppError($conn, 2104, 'The registrar who wants to take over this domain has no money', $clTRID);
|
sendEppError($conn, $db, 2104, 'The registrar who wants to take over this domain has no money', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,7 +876,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute([':registrar_id' => $clid, ':registrar_id_domain' => $registrar_id_domain, ':domain_id' => $domain_id]);
|
$stmt->execute([':registrar_id' => $clid, ':registrar_id_domain' => $registrar_id_domain, ':domain_id' => $domain_id]);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== '00000') {
|
if ($stmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Get the domain details
|
// Get the domain details
|
||||||
|
@ -944,7 +944,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($stmt->errorCode() !== '00000') {
|
if ($stmt->errorCode() !== '00000') {
|
||||||
sendEppError($conn, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID);
|
sendEppError($conn, $db, 2400, 'The transfer was not initiated successfully, something is wrong', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Get the domain details
|
// Get the domain details
|
||||||
|
@ -999,12 +999,12 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($trstatus === 'pending') {
|
} elseif ($trstatus === 'pending') {
|
||||||
sendEppError($conn, 2300, 'Command failed as the domain is pending transfer', $clTRID);
|
sendEppError($conn, $db, 2300, 'Command failed as the domain is pending transfer', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendEppError($conn, 2005, 'Only op: approve|cancel|query|reject|request are accepted', $clTRID);
|
sendEppError($conn, $db, 2005, 'Only op: approve|cancel|query|reject|request are accepted', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -48,21 +48,25 @@ function sendGreeting($conn) {
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendEppError($conn, $code, $msg, $clTRID = "000") {
|
function sendEppError($conn, $db, $code, $msg, $clTRID = "000", $trans = "0") {
|
||||||
if (!isset($clTRID)) {
|
if (!isset($clTRID)) {
|
||||||
$clTRID = "000";
|
$clTRID = "000";
|
||||||
}
|
}
|
||||||
|
if (!isset($trans)) {
|
||||||
|
$trans = "0";
|
||||||
|
}
|
||||||
|
$svTRID = generateSvTRID();
|
||||||
$response = [
|
$response = [
|
||||||
'command' => 'error',
|
'command' => 'error',
|
||||||
'resultCode' => $code,
|
'resultCode' => $code,
|
||||||
'human_readable_message' => $msg,
|
'human_readable_message' => $msg,
|
||||||
'clTRID' => $clTRID,
|
'clTRID' => $clTRID,
|
||||||
'svTRID' => generateSvTRID(),
|
'svTRID' => $svTRID,
|
||||||
];
|
];
|
||||||
|
|
||||||
$epp = new EPP\EppWriter();
|
$epp = new EPP\EppWriter();
|
||||||
$xml = $epp->epp_writer($response);
|
$xml = $epp->epp_writer($response);
|
||||||
|
updateTransaction($db, null, null, 'error', $code, $msg, $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$connId = spl_object_id($conn);
|
$connId = spl_object_id($conn);
|
||||||
|
|
||||||
if ($data === false || strlen($data) < 4) {
|
if ($data === false || strlen($data) < 4) {
|
||||||
sendEppError($conn, 2100, 'Data reception error');
|
sendEppError($conn, $db, 2100, 'Data reception error');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xml->registerXPathNamespace('secDNS', 'urn:ietf:params:xml:ns:secDNS-1.1');
|
$xml->registerXPathNamespace('secDNS', 'urn:ietf:params:xml:ns:secDNS-1.1');
|
||||||
|
|
||||||
if ($xml === false) {
|
if ($xml === false) {
|
||||||
sendEppError($conn, 2001, 'Invalid XML');
|
sendEppError($conn, $db, 2001, 'Invalid XML');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
updateTransaction($db, 'login', null, null, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
updateTransaction($db, 'login', null, null, 1000, 'Command completed successfully', $svTRID, $xml, $trans);
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
} else {
|
} else {
|
||||||
sendEppError($conn, 2200, 'Authentication error', $clTRID);
|
sendEppError($conn, $db, 2200, 'Authentication error', $clTRID);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processPoll($conn, $db, $xml, $data['clid'], $trans);
|
processPoll($conn, $db, $xml, $data['clid'], $trans);
|
||||||
|
@ -172,7 +172,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processContactCheck($conn, $db, $xml, $trans);
|
processContactCheck($conn, $db, $xml, $trans);
|
||||||
|
@ -187,7 +187,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processContactCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processContactCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -202,7 +202,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processContactInfo($conn, $db, $xml, $trans);
|
processContactInfo($conn, $db, $xml, $trans);
|
||||||
|
@ -217,7 +217,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processContactUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processContactUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -232,7 +232,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processContactDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processContactDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -247,7 +247,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processContactTransfer($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processContactTransfer($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -262,7 +262,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainCheck($conn, $db, $xml, $trans);
|
processDomainCheck($conn, $db, $xml, $trans);
|
||||||
|
@ -277,7 +277,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainInfo($conn, $db, $xml, $trans);
|
processDomainInfo($conn, $db, $xml, $trans);
|
||||||
|
@ -292,7 +292,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processDomainUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -307,7 +307,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processDomainCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -322,7 +322,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processDomainDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -337,7 +337,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainTransfer($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processDomainTransfer($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -352,7 +352,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processHostCheck($conn, $db, $xml, $trans);
|
processHostCheck($conn, $db, $xml, $trans);
|
||||||
|
@ -367,7 +367,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processHostCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processHostCreate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -382,7 +382,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processHostInfo($conn, $db, $xml, $trans);
|
processHostInfo($conn, $db, $xml, $trans);
|
||||||
|
@ -397,7 +397,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processHostUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processHostUpdate($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -412,7 +412,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processHostDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processHostDelete($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -427,7 +427,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processFundsInfo($conn, $db, $xml, $data['clid'], $trans);
|
processFundsInfo($conn, $db, $xml, $data['clid'], $trans);
|
||||||
|
@ -442,7 +442,7 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
$xmlString = $xml->asXML();
|
$xmlString = $xml->asXML();
|
||||||
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
$trans = createTransaction($db, $clid, $clTRID, $xmlString);
|
||||||
if (!$data || $data['logged_in'] !== 1) {
|
if (!$data || $data['logged_in'] !== 1) {
|
||||||
sendEppError($conn, 2202, 'Authorization error', $clTRID);
|
sendEppError($conn, $db, 2202, 'Authorization error', $clTRID);
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
processDomainRenew($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
processDomainRenew($conn, $db, $xml, $data['clid'], $c['db_type'], $trans);
|
||||||
|
@ -451,13 +451,13 @@ $server->handle(function (Connection $conn) use ($table, $db, $c) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
sendEppError($conn, 2102, 'Unrecognized command');
|
sendEppError($conn, $db, 2102, 'Unrecognized command');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sendEppError($conn, 2100, 'Unknown command');
|
sendEppError($conn, $db, 2100, 'Unknown command');
|
||||||
echo "Client disconnected.\n";
|
echo "Client disconnected.\n";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue