mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-19 10:59:18 +02:00
Even more millisecond fixes
This commit is contained in:
parent
7f435b6721
commit
164b54994c
6 changed files with 77 additions and 77 deletions
|
@ -545,19 +545,19 @@ class EppWriter {
|
||||||
$writer->writeElement('contact:email', $resp['email']);
|
$writer->writeElement('contact:email', $resp['email']);
|
||||||
$writer->writeElement('contact:clID', $resp['clID']);
|
$writer->writeElement('contact:clID', $resp['clID']);
|
||||||
$writer->writeElement('contact:crID', $resp['crID']);
|
$writer->writeElement('contact:crID', $resp['crID']);
|
||||||
$crDate = new DateTime($resp['crDate']);
|
$crDate = new \DateTime($resp['crDate']);
|
||||||
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('contact:crDate', $crDateFormatted);
|
$writer->writeElement('contact:crDate', $crDateFormatted);
|
||||||
if (isset($resp['upID'])) {
|
if (isset($resp['upID'])) {
|
||||||
$writer->writeElement('contact:upID', $resp['upID']);
|
$writer->writeElement('contact:upID', $resp['upID']);
|
||||||
}
|
}
|
||||||
if (isset($resp['upDate'])) {
|
if (isset($resp['upDate'])) {
|
||||||
$upDate = new DateTime($resp['upDate']);
|
$upDate = new \DateTime($resp['upDate']);
|
||||||
$upDateFormatted = $upDate->format('Y-m-d\TH:i:s.v\Z');
|
$upDateFormatted = $upDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('contact:upDate', $upDateFormatted);
|
$writer->writeElement('contact:upDate', $upDateFormatted);
|
||||||
}
|
}
|
||||||
if (isset($resp['trDate'])) {
|
if (isset($resp['trDate'])) {
|
||||||
$trDate = new DateTime($resp['trDate']);
|
$trDate = new \DateTime($resp['trDate']);
|
||||||
$trDateFormatted = $trDate->format('Y-m-d\TH:i:s.v\Z');
|
$trDateFormatted = $trDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('contact:trDate', $trDateFormatted);
|
$writer->writeElement('contact:trDate', $trDateFormatted);
|
||||||
}
|
}
|
||||||
|
@ -607,11 +607,11 @@ class EppWriter {
|
||||||
$writer->writeElement('contact:id', $resp['id']);
|
$writer->writeElement('contact:id', $resp['id']);
|
||||||
$writer->writeElement('contact:trStatus', $resp['trStatus']);
|
$writer->writeElement('contact:trStatus', $resp['trStatus']);
|
||||||
$writer->writeElement('contact:reID', $resp['reID']);
|
$writer->writeElement('contact:reID', $resp['reID']);
|
||||||
$reDate = new DateTime($resp['reDate']);
|
$reDate = new \DateTime($resp['reDate']);
|
||||||
$reDateFormatted = $reDate->format('Y-m-d\TH:i:s.v\Z');
|
$reDateFormatted = $reDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('contact:reDate', $reDateFormatted);
|
$writer->writeElement('contact:reDate', $reDateFormatted);
|
||||||
$writer->writeElement('contact:acID', $resp['acID']);
|
$writer->writeElement('contact:acID', $resp['acID']);
|
||||||
$acDate = new DateTime($resp['acDate']);
|
$acDate = new \DateTime($resp['acDate']);
|
||||||
$acDateFormatted = $acDate->format('Y-m-d\TH:i:s.v\Z');
|
$acDateFormatted = $acDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('contact:acDate', $acDateFormatted);
|
$writer->writeElement('contact:acDate', $acDateFormatted);
|
||||||
$writer->endElement(); // End of 'contact:trnData'
|
$writer->endElement(); // End of 'contact:trnData'
|
||||||
|
@ -630,7 +630,7 @@ class EppWriter {
|
||||||
$writer->writeAttribute('xmlns:contact', 'urn:ietf:params:xml:ns:contact-1.0');
|
$writer->writeAttribute('xmlns:contact', 'urn:ietf:params:xml:ns:contact-1.0');
|
||||||
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd');
|
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd');
|
||||||
$writer->writeElement('contact:id', $resp['id']);
|
$writer->writeElement('contact:id', $resp['id']);
|
||||||
$crDate = new DateTime($resp['crDate']);
|
$crDate = new \DateTime($resp['crDate']);
|
||||||
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('contact:crDate', $crDateFormatted);
|
$writer->writeElement('contact:crDate', $crDateFormatted);
|
||||||
$writer->endElement(); // End of 'contact:creData'
|
$writer->endElement(); // End of 'contact:creData'
|
||||||
|
@ -675,10 +675,10 @@ class EppWriter {
|
||||||
$writer->writeAttribute('xmlns:domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
$writer->writeAttribute('xmlns:domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
||||||
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd');
|
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd');
|
||||||
$writer->writeElement('domain:name', $resp['name']);
|
$writer->writeElement('domain:name', $resp['name']);
|
||||||
$crDate = new DateTime($resp['crDate']);
|
$crDate = new \DateTime($resp['crDate']);
|
||||||
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:crDate', $crDateFormatted);
|
$writer->writeElement('domain:crDate', $crDateFormatted);
|
||||||
$exDate = new DateTime($resp['exDate']);
|
$exDate = new \DateTime($resp['exDate']);
|
||||||
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:exDate', $exDateFormatted);
|
$writer->writeElement('domain:exDate', $exDateFormatted);
|
||||||
$writer->endElement(); // End of 'domain:creData'
|
$writer->endElement(); // End of 'domain:creData'
|
||||||
|
@ -736,12 +736,12 @@ class EppWriter {
|
||||||
$writer->writeElement('domain:crID', $resp['crID']);
|
$writer->writeElement('domain:crID', $resp['crID']);
|
||||||
}
|
}
|
||||||
if (isset($resp['crDate'])) {
|
if (isset($resp['crDate'])) {
|
||||||
$crDate = new DateTime($resp['crDate']);
|
$crDate = new \DateTime($resp['crDate']);
|
||||||
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:crDate', $crDateFormatted);
|
$writer->writeElement('domain:crDate', $crDateFormatted);
|
||||||
}
|
}
|
||||||
if (isset($resp['exDate'])) {
|
if (isset($resp['exDate'])) {
|
||||||
$exDate = new DateTime($resp['exDate']);
|
$exDate = new \DateTime($resp['exDate']);
|
||||||
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:exDate', $exDateFormatted);
|
$writer->writeElement('domain:exDate', $exDateFormatted);
|
||||||
}
|
}
|
||||||
|
@ -749,12 +749,12 @@ class EppWriter {
|
||||||
$writer->writeElement('domain:upID', $resp['upID']);
|
$writer->writeElement('domain:upID', $resp['upID']);
|
||||||
}
|
}
|
||||||
if (isset($resp['upDate'])) {
|
if (isset($resp['upDate'])) {
|
||||||
$upDate = new DateTime($resp['upDate']);
|
$upDate = new \DateTime($resp['upDate']);
|
||||||
$upDateFormatted = $upDate->format('Y-m-d\TH:i:s.v\Z');
|
$upDateFormatted = $upDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:upDate', $upDateFormatted);
|
$writer->writeElement('domain:upDate', $upDateFormatted);
|
||||||
}
|
}
|
||||||
if (isset($resp['trDate'])) {
|
if (isset($resp['trDate'])) {
|
||||||
$trDate = new DateTime($resp['trDate']);
|
$trDate = new \DateTime($resp['trDate']);
|
||||||
$trDateFormatted = $trDate->format('Y-m-d\TH:i:s.v\Z');
|
$trDateFormatted = $trDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:trDate', $trDateFormatted);
|
$writer->writeElement('domain:trDate', $trDateFormatted);
|
||||||
}
|
}
|
||||||
|
@ -843,7 +843,7 @@ class EppWriter {
|
||||||
$writer->writeAttribute('xmlns:domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
$writer->writeAttribute('xmlns:domain', 'urn:ietf:params:xml:ns:domain-1.0');
|
||||||
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd');
|
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd');
|
||||||
$writer->writeElement('domain:name', $resp['name']);
|
$writer->writeElement('domain:name', $resp['name']);
|
||||||
$exDate = new DateTime($resp['exDate']);
|
$exDate = new \DateTime($resp['exDate']);
|
||||||
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:exDate', $exDateFormatted);
|
$writer->writeElement('domain:exDate', $exDateFormatted);
|
||||||
$writer->endElement(); // End of 'domain:renData'
|
$writer->endElement(); // End of 'domain:renData'
|
||||||
|
@ -864,15 +864,15 @@ class EppWriter {
|
||||||
$writer->writeElement('domain:name', $resp['name']);
|
$writer->writeElement('domain:name', $resp['name']);
|
||||||
$writer->writeElement('domain:trStatus', $resp['trStatus']);
|
$writer->writeElement('domain:trStatus', $resp['trStatus']);
|
||||||
$writer->writeElement('domain:reID', $resp['reID']);
|
$writer->writeElement('domain:reID', $resp['reID']);
|
||||||
$reDate = new DateTime($resp['reDate']);
|
$reDate = new \DateTime($resp['reDate']);
|
||||||
$reDateFormatted = $reDate->format('Y-m-d\TH:i:s.v\Z');
|
$reDateFormatted = $reDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:reDate', $reDateFormatted);
|
$writer->writeElement('domain:reDate', $reDateFormatted);
|
||||||
$writer->writeElement('domain:acID', $resp['acID']);
|
$writer->writeElement('domain:acID', $resp['acID']);
|
||||||
$acDate = new DateTime($resp['acDate']);
|
$acDate = new \DateTime($resp['acDate']);
|
||||||
$acDateFormatted = $acDate->format('Y-m-d\TH:i:s.v\Z');
|
$acDateFormatted = $acDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:acDate', $acDateFormatted);
|
$writer->writeElement('domain:acDate', $acDateFormatted);
|
||||||
if (isset($resp['exDate'])) {
|
if (isset($resp['exDate'])) {
|
||||||
$exDate = new DateTime($resp['exDate']);
|
$exDate = new \DateTime($resp['exDate']);
|
||||||
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
$exDateFormatted = $exDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('domain:exDate', $exDateFormatted);
|
$writer->writeElement('domain:exDate', $exDateFormatted);
|
||||||
}
|
}
|
||||||
|
@ -918,7 +918,7 @@ class EppWriter {
|
||||||
$writer->writeAttribute('xmlns:host', 'urn:ietf:params:xml:ns:host-1.0');
|
$writer->writeAttribute('xmlns:host', 'urn:ietf:params:xml:ns:host-1.0');
|
||||||
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:host-1.0 host-1.0.xsd');
|
$writer->writeAttribute('xsi:schemaLocation', 'urn:ietf:params:xml:ns:host-1.0 host-1.0.xsd');
|
||||||
$writer->writeElement('host:name', $resp['name']);
|
$writer->writeElement('host:name', $resp['name']);
|
||||||
$crDate = new DateTime($resp['crDate']);
|
$crDate = new \DateTime($resp['crDate']);
|
||||||
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('host:crDate', $crDateFormatted);
|
$writer->writeElement('host:crDate', $crDateFormatted);
|
||||||
$writer->endElement(); // End of 'host:creData'
|
$writer->endElement(); // End of 'host:creData'
|
||||||
|
@ -963,19 +963,19 @@ class EppWriter {
|
||||||
}
|
}
|
||||||
$writer->writeElement('host:clID', $resp['clID']);
|
$writer->writeElement('host:clID', $resp['clID']);
|
||||||
$writer->writeElement('host:crID', $resp['crID']);
|
$writer->writeElement('host:crID', $resp['crID']);
|
||||||
$crDate = new DateTime($resp['crDate']);
|
$crDate = new \DateTime($resp['crDate']);
|
||||||
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
$crDateFormatted = $crDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('host:crDate', $crDateFormatted);
|
$writer->writeElement('host:crDate', $crDateFormatted);
|
||||||
if (isset($resp['upID'])) {
|
if (isset($resp['upID'])) {
|
||||||
$writer->writeElement('host:upID', $resp['upID']);
|
$writer->writeElement('host:upID', $resp['upID']);
|
||||||
}
|
}
|
||||||
if (isset($resp['upDate'])) {
|
if (isset($resp['upDate'])) {
|
||||||
$upDate = new DateTime($resp['upDate']);
|
$upDate = new \DateTime($resp['upDate']);
|
||||||
$upDateFormatted = $upDate->format('Y-m-d\TH:i:s.v\Z');
|
$upDateFormatted = $upDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('host:upDate', $upDateFormatted);
|
$writer->writeElement('host:upDate', $upDateFormatted);
|
||||||
}
|
}
|
||||||
if (isset($resp['trDate'])) {
|
if (isset($resp['trDate'])) {
|
||||||
$trDate = new DateTime($resp['trDate']);
|
$trDate = new \DateTime($resp['trDate']);
|
||||||
$trDateFormatted = $trDate->format('Y-m-d\TH:i:s.v\Z');
|
$trDateFormatted = $trDate->format('Y-m-d\TH:i:s.v\Z');
|
||||||
$writer->writeElement('host:trDate', $trDateFormatted);
|
$writer->writeElement('host:trDate', $trDateFormatted);
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,9 +322,9 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($database_type === 'mysql') {
|
if ($database_type === 'mysql') {
|
||||||
$stmt = $db->prepare("INSERT INTO contact (identifier,voice,voice_x,fax,fax_x,email,nin,nin_type,clid,crid,crdate,upid,`update`,trdate,trstatus,reid,redate,acid,acdate,disclose_voice,disclose_fax,disclose_email) VALUES(?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,?,?,?)");
|
$stmt = $db->prepare("INSERT INTO contact (identifier,voice,voice_x,fax,fax_x,email,nin,nin_type,clid,crid,crdate,upid,`update`,trdate,trstatus,reid,redate,acid,acdate,disclose_voice,disclose_fax,disclose_email) VALUES(?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP(3),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,?,?,?)");
|
||||||
} elseif ($database_type === 'pgsql') {
|
} elseif ($database_type === 'pgsql') {
|
||||||
$stmt = $db->prepare("INSERT INTO \"contact\" (\"identifier\",\"voice\",\"voice_x\",\"fax\",\"fax_x\",\"email\",\"nin\",\"nin_type\",\"clid\",\"crid\",\"crdate\",\"upid\",\"update\",\"trdate\",\"trstatus\",\"reid\",\"redate\",\"acid\",\"acdate\",\"disclose_voice\",\"disclose_fax\",\"disclose_email\") VALUES(?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,?,?,?)");
|
$stmt = $db->prepare("INSERT INTO \"contact\" (\"identifier\",\"voice\",\"voice_x\",\"fax\",\"fax_x\",\"email\",\"nin\",\"nin_type\",\"clid\",\"crid\",\"crdate\",\"upid\",\"update\",\"trdate\",\"trstatus\",\"reid\",\"redate\",\"acid\",\"acdate\",\"disclose_voice\",\"disclose_fax\",\"disclose_email\") VALUES(?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP(3),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,?,?,?)");
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
|
@ -489,7 +489,7 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare("INSERT INTO host (name,domain_id,clid,crid,crdate) VALUES(?,?,?,?,CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO host (name,domain_id,clid,crid,crdate) VALUES(?,?,?,?,CURRENT_TIMESTAMP(3))");
|
||||||
$stmt->execute([$hostName, $superordinate_dom, $clid, $clid]);
|
$stmt->execute([$hostName, $superordinate_dom, $clid, $clid]);
|
||||||
$host_id = $db->lastInsertId();
|
$host_id = $db->lastInsertId();
|
||||||
|
|
||||||
|
@ -535,7 +535,7 @@ function processHostCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
sendEppResponse($conn, $xml);
|
sendEppResponse($conn, $xml);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("INSERT INTO host (name,clid,crid,crdate) VALUES(?,?,?,CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO host (name,clid,crid,crdate) VALUES(?,?,?,CURRENT_TIMESTAMP(3))");
|
||||||
$stmt->execute([$hostName, $clid, $clid]);
|
$stmt->execute([$hostName, $clid, $clid]);
|
||||||
|
|
||||||
$host_id = $db->lastInsertId();
|
$host_id = $db->lastInsertId();
|
||||||
|
@ -1037,7 +1037,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$db->beginTransaction();
|
$db->beginTransaction();
|
||||||
|
|
||||||
$domainSql = "INSERT INTO `domain` (`name`,`tldid`,`registrant`,`crdate`,`exdate`,`update`,`clid`,`crid`,`upid`,`trdate`,`trstatus`,`reid`,`redate`,`acid`,`acdate`,`rgpstatus`,`addPeriod`)
|
$domainSql = "INSERT INTO `domain` (`name`,`tldid`,`registrant`,`crdate`,`exdate`,`update`,`clid`,`crid`,`upid`,`trdate`,`trstatus`,`reid`,`redate`,`acid`,`acdate`,`rgpstatus`,`addPeriod`)
|
||||||
VALUES(:name, :tld_id, :registrant_id, CURRENT_TIMESTAMP, DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :date_add MONTH), NULL, :registrar_id, :registrar_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'addPeriod', :date_add2)";
|
VALUES(:name, :tld_id, :registrant_id, CURRENT_TIMESTAMP(3), DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL :date_add MONTH), NULL, :registrar_id, :registrar_id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'addPeriod', :date_add2)";
|
||||||
|
|
||||||
$domainStmt = $db->prepare($domainSql);
|
$domainStmt = $db->prepare($domainSql);
|
||||||
$domainStmt->execute([
|
$domainStmt->execute([
|
||||||
|
@ -1167,7 +1167,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
':registrar_id' => $clid
|
':registrar_id' => $clid
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$paymentHistoryStmt = $db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(:registrar_id,CURRENT_TIMESTAMP,:description,:amount)");
|
$paymentHistoryStmt = $db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(:registrar_id,CURRENT_TIMESTAMP(3),:description,:amount)");
|
||||||
$paymentHistoryStmt->execute([
|
$paymentHistoryStmt->execute([
|
||||||
':registrar_id' => $clid,
|
':registrar_id' => $clid,
|
||||||
':description' => "create domain $domainName for period $date_add MONTH",
|
':description' => "create domain $domainName for period $date_add MONTH",
|
||||||
|
@ -1178,7 +1178,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$selectDomainDatesStmt->execute([':name' => $domainName]);
|
$selectDomainDatesStmt->execute([':name' => $domainName]);
|
||||||
[$from, $to] = $selectDomainDatesStmt->fetch(PDO::FETCH_NUM);
|
[$from, $to] = $selectDomainDatesStmt->fetch(PDO::FETCH_NUM);
|
||||||
|
|
||||||
$statementStmt = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(:registrar_id,CURRENT_TIMESTAMP,:cmd,:name,:date_add,:from,:to,:price)");
|
$statementStmt = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(:registrar_id,CURRENT_TIMESTAMP(3),:cmd,:name,:date_add,:from,:to,:price)");
|
||||||
$statementStmt->execute([
|
$statementStmt->execute([
|
||||||
':registrar_id' => $clid,
|
':registrar_id' => $clid,
|
||||||
':cmd' => 'create',
|
':cmd' => 'create',
|
||||||
|
@ -1206,7 +1206,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$insertDomainHostMapStmt = $db->prepare("INSERT INTO `domain_host_map` (`domain_id`,`host_id`) VALUES(:domain_id,:host_id)");
|
$insertDomainHostMapStmt = $db->prepare("INSERT INTO `domain_host_map` (`domain_id`,`host_id`) VALUES(:domain_id,:host_id)");
|
||||||
$insertDomainHostMapStmt->execute([':domain_id' => $domain_id, ':host_id' => $hostObj_already_exist]);
|
$insertDomainHostMapStmt->execute([':domain_id' => $domain_id, ':host_id' => $hostObj_already_exist]);
|
||||||
} else {
|
} else {
|
||||||
$errorLogStmt = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(:registrar_id,:log,CURRENT_TIMESTAMP)");
|
$errorLogStmt = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(:registrar_id,:log,CURRENT_TIMESTAMP(3))");
|
||||||
$errorLogStmt->execute([':registrar_id' => $clid, ':log' => "Domain : $domainName ; hostObj : $hostObj - se dubleaza"]);
|
$errorLogStmt->execute([':registrar_id' => $clid, ':log' => "Domain : $domainName ; hostObj : $hostObj - se dubleaza"]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1226,7 +1226,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
if ($internal_host) {
|
if ($internal_host) {
|
||||||
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
||||||
$stmt = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
$stmt->execute([$hostObj, $domain_id, $clid, $clid]);
|
$stmt->execute([$hostObj, $domain_id, $clid, $clid]);
|
||||||
$host_id = $db->lastInsertId();
|
$host_id = $db->lastInsertId();
|
||||||
|
|
||||||
|
@ -1234,7 +1234,7 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->execute([$domain_id, $host_id]);
|
$stmt->execute([$domain_id, $host_id]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("INSERT INTO `host` (`name`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO `host` (`name`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
$stmt->execute([$hostObj, $clid, $clid]);
|
$stmt->execute([$hostObj, $clid, $clid]);
|
||||||
$host_id = $db->lastInsertId();
|
$host_id = $db->lastInsertId();
|
||||||
|
|
||||||
|
@ -1263,11 +1263,11 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt = $db->prepare("INSERT INTO `domain_host_map` (`domain_id`,`host_id`) VALUES(?,?)");
|
$stmt = $db->prepare("INSERT INTO `domain_host_map` (`domain_id`,`host_id`) VALUES(?,?)");
|
||||||
$stmt->execute([$domain_id, $hostName_already_exist]);
|
$stmt->execute([$domain_id, $hostName_already_exist]);
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(?, ?, CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
$stmt->execute([$clid, "Domain : $domainName ; hostName : $hostName - se dubleaza"]);
|
$stmt->execute([$clid, "Domain : $domainName ; hostName : $hostName - se dubleaza"]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
$stmt->execute([$hostName, $domain_id, $clid, $clid]);
|
$stmt->execute([$hostName, $domain_id, $clid, $clid]);
|
||||||
$host_id = $db->lastInsertId();
|
$host_id = $db->lastInsertId();
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
|
|
||||||
// UPDATE domain
|
// UPDATE domain
|
||||||
$stmt = $db->prepare("UPDATE domain SET rgpstatus = 'redemptionPeriod', delTime = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL ? DAY) WHERE id = ?");
|
$stmt = $db->prepare("UPDATE domain SET rgpstatus = 'redemptionPeriod', delTime = DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL ? DAY) WHERE id = ?");
|
||||||
$stmt->execute([$grace_period, $domain_id]);
|
$stmt->execute([$grace_period, $domain_id]);
|
||||||
|
|
||||||
// INSERT INTO domain_status
|
// INSERT INTO domain_status
|
||||||
|
@ -247,7 +247,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
if ($rgpstatus) {
|
if ($rgpstatus) {
|
||||||
if ($rgpstatus === 'addPeriod') {
|
if ($rgpstatus === 'addPeriod') {
|
||||||
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP < DATE_ADD(crdate, INTERVAL 5 DAY)) LIMIT 1");
|
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP(3) < DATE_ADD(crdate, INTERVAL 5 DAY)) LIMIT 1");
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
$addPeriod_id = $stmt->fetchColumn();
|
$addPeriod_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Insert into payment_history
|
// Insert into payment_history
|
||||||
$description = "domain name is deleted by the registrar during grace addPeriod, the registry provides a credit for the cost of the registration domain $domainName for period $addPeriod MONTH";
|
$description = "domain name is deleted by the registrar during grace addPeriod, the registry provides a credit for the cost of the registration domain $domainName for period $addPeriod MONTH";
|
||||||
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP(3), ?, ?)");
|
||||||
$stmt->execute([$clid, $description, $price]);
|
$stmt->execute([$clid, $description, $price]);
|
||||||
|
|
||||||
// Fetch host ids
|
// Fetch host ids
|
||||||
|
@ -305,7 +305,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$db->exec("UPDATE statistics SET deleted_domains = deleted_domains + 1 WHERE date = CURDATE()");
|
$db->exec("UPDATE statistics SET deleted_domains = deleted_domains + 1 WHERE date = CURDATE()");
|
||||||
}
|
}
|
||||||
} elseif ($rgpstatus === 'autoRenewPeriod') {
|
} elseif ($rgpstatus === 'autoRenewPeriod') {
|
||||||
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP < DATE_ADD(renewedDate, INTERVAL 45 DAY)) LIMIT 1");
|
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP(3) < DATE_ADD(renewedDate, INTERVAL 45 DAY)) LIMIT 1");
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
$autoRenewPeriod_id = $stmt->fetchColumn();
|
$autoRenewPeriod_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -325,11 +325,11 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Insert into payment_history
|
// Insert into payment_history
|
||||||
$description = "domain name is deleted by the registrar during grace autoRenewPeriod, the registry provides a credit for the cost of the renewal domain $domainName for period $autoRenewPeriod MONTH";
|
$description = "domain name is deleted by the registrar during grace autoRenewPeriod, the registry provides a credit for the cost of the renewal domain $domainName for period $autoRenewPeriod MONTH";
|
||||||
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP(3), ?, ?)");
|
||||||
$stmt->execute([$clid, $description, $price]);
|
$stmt->execute([$clid, $description, $price]);
|
||||||
}
|
}
|
||||||
} elseif ($rgpstatus === 'renewPeriod') {
|
} elseif ($rgpstatus === 'renewPeriod') {
|
||||||
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP < DATE_ADD(renewedDate, INTERVAL 5 DAY)) LIMIT 1");
|
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP(3) < DATE_ADD(renewedDate, INTERVAL 5 DAY)) LIMIT 1");
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
$renewPeriod_id = $stmt->fetchColumn();
|
$renewPeriod_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -349,11 +349,11 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Insert into payment_history
|
// Insert into payment_history
|
||||||
$description = "domain name is deleted by the registrar during grace renewPeriod, the registry provides a credit for the cost of the renewal domain $domainName for period $renewPeriod MONTH";
|
$description = "domain name is deleted by the registrar during grace renewPeriod, the registry provides a credit for the cost of the renewal domain $domainName for period $renewPeriod MONTH";
|
||||||
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP(3), ?, ?)");
|
||||||
$stmt->execute([$clid, $description, $price]);
|
$stmt->execute([$clid, $description, $price]);
|
||||||
}
|
}
|
||||||
} elseif ($rgpstatus === 'transferPeriod') {
|
} elseif ($rgpstatus === 'transferPeriod') {
|
||||||
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP < DATE_ADD(trdate, INTERVAL 5 DAY)) LIMIT 1");
|
$stmt = $db->prepare("SELECT id FROM domain WHERE id = ? AND (CURRENT_TIMESTAMP(3) < DATE_ADD(trdate, INTERVAL 5 DAY)) LIMIT 1");
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
$transferPeriod_id = $stmt->fetchColumn();
|
$transferPeriod_id = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ function processDomainDelete($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Insert into payment_history
|
// Insert into payment_history
|
||||||
$description = "domain name is deleted by the registrar during grace transferPeriod, the registry provides a credit for the cost of the transfer domain $domainName for period $transferPeriod MONTH";
|
$description = "domain name is deleted by the registrar during grace transferPeriod, the registry provides a credit for the cost of the transfer domain $domainName for period $transferPeriod MONTH";
|
||||||
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES(?, CURRENT_TIMESTAMP(3), ?, ?)");
|
||||||
$stmt->execute([$clid, $description, $price]);
|
$stmt->execute([$clid, $description, $price]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$from = $stmt->fetchColumn();
|
$from = $stmt->fetchColumn();
|
||||||
|
|
||||||
$rgpstatus = 'renewPeriod';
|
$rgpstatus = 'renewPeriod';
|
||||||
$stmt = $db->prepare("UPDATE domain SET exdate = DATE_ADD(exdate, INTERVAL :date_add MONTH), rgpstatus = :rgpstatus, renewPeriod = :renewPeriod, renewedDate = CURRENT_TIMESTAMP WHERE id = :domain_id");
|
$stmt = $db->prepare("UPDATE domain SET exdate = DATE_ADD(exdate, INTERVAL :date_add MONTH), rgpstatus = :rgpstatus, renewPeriod = :renewPeriod, renewedDate = CURRENT_TIMESTAMP(3) WHERE id = :domain_id");
|
||||||
$stmt->bindParam(':date_add', $date_add, PDO::PARAM_INT);
|
$stmt->bindParam(':date_add', $date_add, PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':rgpstatus', $rgpstatus, PDO::PARAM_STR);
|
$stmt->bindParam(':rgpstatus', $rgpstatus, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':renewPeriod', $date_add, PDO::PARAM_INT);
|
$stmt->bindParam(':renewPeriod', $date_add, PDO::PARAM_INT);
|
||||||
|
@ -152,7 +152,7 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
// Insert into payment_history:
|
// Insert into payment_history:
|
||||||
$description = "renew domain $domainName for period $date_add MONTH";
|
$description = "renew domain $domainName for period $date_add MONTH";
|
||||||
$negative_price = -$price;
|
$negative_price = -$price;
|
||||||
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES (:registrar_id, CURRENT_TIMESTAMP, :description, :amount)");
|
$stmt = $db->prepare("INSERT INTO payment_history (registrar_id, date, description, amount) VALUES (:registrar_id, CURRENT_TIMESTAMP(3), :description, :amount)");
|
||||||
$stmt->bindParam(':registrar_id', $clid['id'], PDO::PARAM_INT);
|
$stmt->bindParam(':registrar_id', $clid['id'], PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':description', $description, PDO::PARAM_STR);
|
$stmt->bindParam(':description', $description, PDO::PARAM_STR);
|
||||||
$stmt->bindParam(':amount', $negative_price, PDO::PARAM_INT);
|
$stmt->bindParam(':amount', $negative_price, PDO::PARAM_INT);
|
||||||
|
@ -166,9 +166,9 @@ function processDomainRenew($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Insert into statement:
|
// Insert into statement:
|
||||||
if ($database_type === "mysql") {
|
if ($database_type === "mysql") {
|
||||||
$stmt = $db->prepare("INSERT INTO statement (registrar_id, date, command, domain_name, length_in_months, `from`, `to`, amount) VALUES (?, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO statement (registrar_id, date, command, domain_name, length_in_months, `from`, `to`, amount) VALUES (?, CURRENT_TIMESTAMP(3), ?, ?, ?, ?, ?, ?)");
|
||||||
} elseif ($database_type === "pgsql") {
|
} elseif ($database_type === "pgsql") {
|
||||||
$stmt = $db->prepare('INSERT INTO statement (registrar_id, date, command, domain_name, length_in_months, "from", "to", amount) VALUES (?, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?, ?)');
|
$stmt = $db->prepare('INSERT INTO statement (registrar_id, date, command, domain_name, length_in_months, "from", "to", amount) VALUES (?, CURRENT_TIMESTAMP(3), ?, ?, ?, ?, ?, ?)');
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Unsupported database type: $database_type");
|
throw new Exception("Unsupported database type: $database_type");
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$trstatus = $contactInfo['trstatus'] ?? '';
|
$trstatus = $contactInfo['trstatus'] ?? '';
|
||||||
|
|
||||||
if ($trstatus === 'pending') {
|
if ($trstatus === 'pending') {
|
||||||
$stmt = $db->prepare("UPDATE `contact` SET `update` = CURRENT_TIMESTAMP, `clid` = :reid, `upid` = :upid, `trdate` = CURRENT_TIMESTAMP, `trstatus` = 'clientApproved', `acdate` = CURRENT_TIMESTAMP WHERE `id` = :contact_id");
|
$stmt = $db->prepare("UPDATE `contact` SET `update` = CURRENT_TIMESTAMP(3), `clid` = :reid, `upid` = :upid, `trdate` = CURRENT_TIMESTAMP(3), `trstatus` = 'clientApproved', `acdate` = CURRENT_TIMESTAMP(3) WHERE `id` = :contact_id");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
':reid' => $contactInfo['reid'],
|
':reid' => $contactInfo['reid'],
|
||||||
':upid' => $clid,
|
':upid' => $clid,
|
||||||
|
@ -285,7 +285,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
} elseif ($op == 'request') {
|
} elseif ($op == 'request') {
|
||||||
// Check if contact is within 60 days of its initial registration
|
// Check if contact is within 60 days of its initial registration
|
||||||
$stmt = $db->prepare("SELECT DATEDIFF(CURRENT_TIMESTAMP,`crdate`) FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
$stmt = $db->prepare("SELECT DATEDIFF(CURRENT_TIMESTAMP(3),`crdate`) FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
$days_from_registration = $stmt->fetchColumn();
|
$days_from_registration = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if contact is within 60 days of its last transfer
|
// Check if contact is within 60 days of its last transfer
|
||||||
$stmt = $db->prepare("SELECT `trdate`, DATEDIFF(CURRENT_TIMESTAMP,`trdate`) AS `intval` FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
$stmt = $db->prepare("SELECT `trdate`, DATEDIFF(CURRENT_TIMESTAMP(3),`trdate`) AS `intval` FROM `contact` WHERE `id` = :contact_id LIMIT 1");
|
||||||
$stmt->execute([':contact_id' => $contact_id]);
|
$stmt->execute([':contact_id' => $contact_id]);
|
||||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$last_trdate = $result['trdate'];
|
$last_trdate = $result['trdate'];
|
||||||
|
@ -339,7 +339,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
if (!$trstatus || $trstatus != 'pending') {
|
if (!$trstatus || $trstatus != 'pending') {
|
||||||
$waiting_period = 5; // days
|
$waiting_period = 5; // days
|
||||||
$stmt = $db->prepare("UPDATE `contact` SET `trstatus` = 'pending', `reid` = :registrar_id, `redate` = CURRENT_TIMESTAMP, `acid` = :registrar_id_contact, `acdate` = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL $waiting_period DAY) WHERE `id` = :contact_id");
|
$stmt = $db->prepare("UPDATE `contact` SET `trstatus` = 'pending', `reid` = :registrar_id, `redate` = CURRENT_TIMESTAMP(3), `acid` = :registrar_id_contact, `acdate` = DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL $waiting_period DAY) WHERE `id` = :contact_id");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
':registrar_id' => $clid,
|
':registrar_id' => $clid,
|
||||||
':registrar_id_contact' => $registrar_id_contact,
|
':registrar_id_contact' => $registrar_id_contact,
|
||||||
|
@ -357,7 +357,7 @@ function processContactTranfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$reid_identifier = $db->query("SELECT `clid` FROM `registrar` WHERE `id` = '{$result['reid']}' LIMIT 1")->fetchColumn();
|
$reid_identifier = $db->query("SELECT `clid` FROM `registrar` WHERE `id` = '{$result['reid']}' LIMIT 1")->fetchColumn();
|
||||||
$acid_identifier = $db->query("SELECT `clid` FROM `registrar` WHERE `id` = '{$result['acid']}' LIMIT 1")->fetchColumn();
|
$acid_identifier = $db->query("SELECT `clid` FROM `registrar` WHERE `id` = '{$result['acid']}' LIMIT 1")->fetchColumn();
|
||||||
|
|
||||||
$db->prepare("INSERT INTO `poll` (`registrar_id`,`qdate`,`msg`,`msg_type`,`obj_name_or_id`,`obj_trStatus`,`obj_reID`,`obj_reDate`,`obj_acID`,`obj_acDate`,`obj_exDate`) VALUES(:registrar_id_contact, CURRENT_TIMESTAMP, 'Transfer requested.', 'contactTransfer', :identifier, 'pending', :reid_identifier, :redate, :acid_identifier, :acdate, NULL)")
|
$db->prepare("INSERT INTO `poll` (`registrar_id`,`qdate`,`msg`,`msg_type`,`obj_name_or_id`,`obj_trStatus`,`obj_reID`,`obj_reDate`,`obj_acID`,`obj_acDate`,`obj_exDate`) VALUES(:registrar_id_contact, CURRENT_TIMESTAMP(3), 'Transfer requested.', 'contactTransfer', :identifier, 'pending', :reid_identifier, :redate, :acid_identifier, :acdate, NULL)")
|
||||||
->execute([
|
->execute([
|
||||||
':registrar_id_contact' => $registrar_id_contact,
|
':registrar_id_contact' => $registrar_id_contact,
|
||||||
':identifier' => $identifier,
|
':identifier' => $identifier,
|
||||||
|
@ -476,10 +476,10 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare("UPDATE `domain` SET `exdate` = DATE_ADD(`exdate`, INTERVAL ? MONTH), `update` = CURRENT_TIMESTAMP, `clid` = ?, `upid` = ?, `trdate` = CURRENT_TIMESTAMP, `trstatus` = 'clientApproved', `acdate` = CURRENT_TIMESTAMP, `transfer_exdate` = NULL, `rgpstatus` = 'transferPeriod', `transferPeriod` = ? WHERE `id` = ?");
|
$stmt = $db->prepare("UPDATE `domain` SET `exdate` = DATE_ADD(`exdate`, INTERVAL ? MONTH), `update` = CURRENT_TIMESTAMP(3), `clid` = ?, `upid` = ?, `trdate` = CURRENT_TIMESTAMP(3), `trstatus` = 'clientApproved', `acdate` = CURRENT_TIMESTAMP(3), `transfer_exdate` = NULL, `rgpstatus` = 'transferPeriod', `transferPeriod` = ? WHERE `id` = ?");
|
||||||
$stmt->execute([$date_add, $row["reid"], $clid, $date_add, $domain_id]);
|
$stmt->execute([$date_add, $row["reid"], $clid, $date_add, $domain_id]);
|
||||||
|
|
||||||
$stmt = $db->prepare("UPDATE `host` SET `clid` = ?, `upid` = ?, `update` = CURRENT_TIMESTAMP, `trdate` = CURRENT_TIMESTAMP WHERE `domain_id` = ?");
|
$stmt = $db->prepare("UPDATE `host` SET `clid` = ?, `upid` = ?, `update` = CURRENT_TIMESTAMP(3), `trdate` = CURRENT_TIMESTAMP(3) WHERE `domain_id` = ?");
|
||||||
$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) {
|
||||||
|
@ -489,7 +489,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt = $db->prepare("UPDATE `registrar` SET `accountBalance` = (`accountBalance` - :price) WHERE `id` = :reid");
|
$stmt = $db->prepare("UPDATE `registrar` SET `accountBalance` = (`accountBalance` - :price) WHERE `id` = :reid");
|
||||||
$stmt->execute(['price' => $price, 'reid' => $reid]);
|
$stmt->execute(['price' => $price, 'reid' => $reid]);
|
||||||
|
|
||||||
$stmt = $db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(:reid, CURRENT_TIMESTAMP, :description, :amount)");
|
$stmt = $db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(:reid, CURRENT_TIMESTAMP(3), :description, :amount)");
|
||||||
$description = "transfer domain $domainName for period $date_add MONTH";
|
$description = "transfer domain $domainName for period $date_add MONTH";
|
||||||
$stmt->execute(['reid' => $reid, 'description' => $description, 'amount' => -$price]);
|
$stmt->execute(['reid' => $reid, 'description' => $description, 'amount' => -$price]);
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
$to = $stmt->fetchColumn();
|
$to = $stmt->fetchColumn();
|
||||||
|
|
||||||
$stmt = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(:registrar_id, CURRENT_TIMESTAMP, :command, :domain_name, :length_in_months, :from, :to, :amount)");
|
$stmt = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(:registrar_id, CURRENT_TIMESTAMP(3), :command, :domain_name, :length_in_months, :from, :to, :amount)");
|
||||||
$stmt->execute(['registrar_id' => $reid, 'command' => 'transfer', 'domain_name' => $domainName, 'length_in_months' => $date_add, 'from' => $from, 'to' => $to, 'amount' => $price]);
|
$stmt->execute(['registrar_id' => $reid, 'command' => 'transfer', 'domain_name' => $domainName, 'length_in_months' => $date_add, 'from' => $from, 'to' => $to, 'amount' => $price]);
|
||||||
|
|
||||||
$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");
|
||||||
|
@ -748,7 +748,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
|
|
||||||
elseif ($op === 'request') {
|
elseif ($op === 'request') {
|
||||||
// Check days from registration
|
// Check days from registration
|
||||||
$stmt = $db->prepare("SELECT DATEDIFF(CURRENT_TIMESTAMP, `crdate`) FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
$stmt = $db->prepare("SELECT DATEDIFF(CURRENT_TIMESTAMP(3), `crdate`) FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
$days_from_registration = $stmt->fetchColumn();
|
$days_from_registration = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check days from last transfer
|
// Check days from last transfer
|
||||||
$stmt = $db->prepare("SELECT `trdate`, DATEDIFF(CURRENT_TIMESTAMP,`trdate`) AS `intval` FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
$stmt = $db->prepare("SELECT `trdate`, DATEDIFF(CURRENT_TIMESTAMP(3),`trdate`) AS `intval` FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
$result = $stmt->fetch();
|
$result = $stmt->fetch();
|
||||||
$last_trdate = $result["trdate"];
|
$last_trdate = $result["trdate"];
|
||||||
|
@ -770,7 +770,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check days from expiry date
|
// Check days from expiry date
|
||||||
$stmt = $db->prepare("SELECT DATEDIFF(CURRENT_TIMESTAMP,`exdate`) FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
$stmt = $db->prepare("SELECT DATEDIFF(CURRENT_TIMESTAMP(3),`exdate`) FROM `domain` WHERE `id` = :domain_id LIMIT 1");
|
||||||
$stmt->execute(['domain_id' => $domain_id]);
|
$stmt->execute(['domain_id' => $domain_id]);
|
||||||
$days_from_expiry_date = $stmt->fetchColumn();
|
$days_from_expiry_date = $stmt->fetchColumn();
|
||||||
|
|
||||||
|
@ -873,7 +873,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
}
|
}
|
||||||
|
|
||||||
$waiting_period = 5;
|
$waiting_period = 5;
|
||||||
$stmt = $db->prepare("UPDATE `domain` SET `trstatus` = 'pending', `reid` = :registrar_id, `redate` = CURRENT_TIMESTAMP, `acid` = :registrar_id_domain, `acdate` = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL $waiting_period DAY), `transfer_exdate` = DATE_ADD(`exdate`, INTERVAL $date_add MONTH) WHERE `id` = :domain_id");
|
$stmt = $db->prepare("UPDATE `domain` SET `trstatus` = 'pending', `reid` = :registrar_id, `redate` = CURRENT_TIMESTAMP(3), `acid` = :registrar_id_domain, `acdate` = DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL $waiting_period DAY), `transfer_exdate` = DATE_ADD(`exdate`, INTERVAL $date_add MONTH) WHERE `id` = :domain_id");
|
||||||
$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') {
|
||||||
|
@ -896,7 +896,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$acid_identifier = $stmt->fetchColumn();
|
$acid_identifier = $stmt->fetchColumn();
|
||||||
|
|
||||||
// The current sponsoring registrar will receive a notification of a pending transfer
|
// The current sponsoring registrar will receive a notification of a pending transfer
|
||||||
$stmt = $db->prepare("INSERT INTO `poll` (`registrar_id`,`qdate`,`msg`,`msg_type`,`obj_name_or_id`,`obj_trStatus`,`obj_reID`,`obj_reDate`,`obj_acID`,`obj_acDate`,`obj_exDate`) VALUES(:registrar_id_domain, CURRENT_TIMESTAMP, 'Transfer requested.', 'domainTransfer', :name, 'pending', :reid_identifier, :redate, :acid_identifier, :acdate, :transfer_exdate)");
|
$stmt = $db->prepare("INSERT INTO `poll` (`registrar_id`,`qdate`,`msg`,`msg_type`,`obj_name_or_id`,`obj_trStatus`,`obj_reID`,`obj_reDate`,`obj_acID`,`obj_acDate`,`obj_exDate`) VALUES(:registrar_id_domain, CURRENT_TIMESTAMP(3), 'Transfer requested.', 'domainTransfer', :name, 'pending', :reid_identifier, :redate, :acid_identifier, :acdate, :transfer_exdate)");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
':registrar_id_domain' => $registrar_id_domain,
|
':registrar_id_domain' => $registrar_id_domain,
|
||||||
':name' => $domainName,
|
':name' => $domainName,
|
||||||
|
@ -936,7 +936,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
// No expiration date is inserted after the transfer procedure
|
// No expiration date is inserted after the transfer procedure
|
||||||
$waiting_period = 5; // days
|
$waiting_period = 5; // days
|
||||||
|
|
||||||
$stmt = $db->prepare("UPDATE `domain` SET `trstatus` = 'pending', `reid` = :registrar_id, `redate` = CURRENT_TIMESTAMP, `acid` = :registrar_id_domain, `acdate` = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :waiting_period DAY), `transfer_exdate` = NULL WHERE `id` = :domain_id");
|
$stmt = $db->prepare("UPDATE `domain` SET `trstatus` = 'pending', `reid` = :registrar_id, `redate` = CURRENT_TIMESTAMP(3), `acid` = :registrar_id_domain, `acdate` = DATE_ADD(CURRENT_TIMESTAMP(3), INTERVAL :waiting_period DAY), `transfer_exdate` = NULL WHERE `id` = :domain_id");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
':registrar_id' => $clid,
|
':registrar_id' => $clid,
|
||||||
':registrar_id_domain' => $registrar_id_domain,
|
':registrar_id_domain' => $registrar_id_domain,
|
||||||
|
@ -964,7 +964,7 @@ function processDomainTransfer($conn, $db, $xml, $clid, $database_type, $trans)
|
||||||
$acid_identifier = $stmt->fetchColumn();
|
$acid_identifier = $stmt->fetchColumn();
|
||||||
|
|
||||||
// Notify the current sponsoring registrar of the pending transfer
|
// Notify the current sponsoring registrar of the pending transfer
|
||||||
$stmt = $db->prepare("INSERT INTO `poll` (`registrar_id`, `qdate`, `msg`, `msg_type`, `obj_name_or_id`, `obj_trStatus`, `obj_reID`, `obj_reDate`, `obj_acID`, `obj_acDate`, `obj_exDate`) VALUES(:registrar_id_domain, CURRENT_TIMESTAMP, 'Transfer requested.', 'domainTransfer', :name, 'pending', :reid_identifier, :redate, :acid_identifier, :acdate, NULL)");
|
$stmt = $db->prepare("INSERT INTO `poll` (`registrar_id`, `qdate`, `msg`, `msg_type`, `obj_name_or_id`, `obj_trStatus`, `obj_reID`, `obj_reDate`, `obj_acID`, `obj_acDate`, `obj_exDate`) VALUES(:registrar_id_domain, CURRENT_TIMESTAMP(3), 'Transfer requested.', 'domainTransfer', :name, 'pending', :reid_identifier, :redate, :acid_identifier, :acdate, NULL)");
|
||||||
$stmt->execute([
|
$stmt->execute([
|
||||||
':registrar_id_domain' => $registrar_id_domain,
|
':registrar_id_domain' => $registrar_id_domain,
|
||||||
':name' => $domainName,
|
':name' => $domainName,
|
||||||
|
|
|
@ -509,7 +509,7 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
// Update contact
|
// Update contact
|
||||||
if ($database_type == 'mysql') {
|
if ($database_type == 'mysql') {
|
||||||
$query = "UPDATE `contact` SET `voice` = ?, `voice_x` = ?, `fax` = ?, `fax_x` = ?, `email` = ?, `update` = CURRENT_TIMESTAMP WHERE `id` = ?";
|
$query = "UPDATE `contact` SET `voice` = ?, `voice_x` = ?, `fax` = ?, `fax_x` = ?, `email` = ?, `update` = CURRENT_TIMESTAMP(3) WHERE `id` = ?";
|
||||||
} else if ($database_type == 'pgsql') {
|
} else if ($database_type == 'pgsql') {
|
||||||
$query = "UPDATE \"contact\" SET \"voice\" = ?, \"voice_x\" = ?, \"fax\" = ?, \"fax_x\" = ?, \"email\" = ?, \"update\" = timestamp 'now' WHERE \"id\" = ?";
|
$query = "UPDATE \"contact\" SET \"voice\" = ?, \"voice_x\" = ?, \"fax\" = ?, \"fax_x\" = ?, \"email\" = ?, \"update\" = timestamp 'now' WHERE \"id\" = ?";
|
||||||
}
|
}
|
||||||
|
@ -582,7 +582,7 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
if ($identica_update) {
|
if ($identica_update) {
|
||||||
if ($database_type == 'mysql') {
|
if ($database_type == 'mysql') {
|
||||||
$query = "UPDATE `contact` SET `nin` = ?, `nin_type` = ?, `update` = CURRENT_TIMESTAMP WHERE `id` = ?";
|
$query = "UPDATE `contact` SET `nin` = ?, `nin_type` = ?, `update` = CURRENT_TIMESTAMP(3) WHERE `id` = ?";
|
||||||
} else if ($database_type == 'pgsql') {
|
} else if ($database_type == 'pgsql') {
|
||||||
$query = "UPDATE \"contact\" SET \"nin\" = ?, \"nin_type\" = ?, \"update\" = timestamp 'now' WHERE \"id\" = ?";
|
$query = "UPDATE \"contact\" SET \"nin\" = ?, \"nin_type\" = ?, \"update\" = timestamp 'now' WHERE \"id\" = ?";
|
||||||
}
|
}
|
||||||
|
@ -909,7 +909,7 @@ function processHostUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$chg_name = strtoupper($xml->xpath('//host:name[1]')[0]);
|
$chg_name = strtoupper($xml->xpath('//host:name[1]')[0]);
|
||||||
|
|
||||||
if ($database_type == 'mysql') {
|
if ($database_type == 'mysql') {
|
||||||
$query = "UPDATE `host` SET `name` = ?, `update` = CURRENT_TIMESTAMP WHERE `name` = ?";
|
$query = "UPDATE `host` SET `name` = ?, `update` = CURRENT_TIMESTAMP(3) WHERE `name` = ?";
|
||||||
} else if ($database_type == 'pgsql') {
|
} else if ($database_type == 'pgsql') {
|
||||||
$query = "UPDATE \"host\" SET \"name\" = ?, \"update\" = timestamp 'now' WHERE \"name\" = ?";
|
$query = "UPDATE \"host\" SET \"name\" = ?, \"update\" = timestamp 'now' WHERE \"name\" = ?";
|
||||||
}
|
}
|
||||||
|
@ -1423,7 +1423,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$stmt->bindParam(':hostObj_already_exist', $hostObj_already_exist, PDO::PARAM_INT);
|
$stmt->bindParam(':hostObj_already_exist', $hostObj_already_exist, PDO::PARAM_INT);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
} else {
|
} else {
|
||||||
$stmt = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(:registrar_id, :log, CURRENT_TIMESTAMP)");
|
$stmt = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(:registrar_id, :log, CURRENT_TIMESTAMP(3))");
|
||||||
$log = "Domain : $domainName ; hostObj : $hostObj - se dubleaza";
|
$log = "Domain : $domainName ; hostObj : $hostObj - se dubleaza";
|
||||||
$stmt->bindParam(':registrar_id', $clid, PDO::PARAM_INT);
|
$stmt->bindParam(':registrar_id', $clid, PDO::PARAM_INT);
|
||||||
$stmt->bindParam(':log', $log, PDO::PARAM_STR);
|
$stmt->bindParam(':log', $log, PDO::PARAM_STR);
|
||||||
|
@ -1449,7 +1449,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
|
|
||||||
if ($host_from_this_registry) {
|
if ($host_from_this_registry) {
|
||||||
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
if (preg_match("/\.$domainName$/i", $hostObj)) {
|
||||||
$sth = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP)");
|
$sth = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
if (!$sth->execute([$hostObj, $domain_id, $clid, $clid])) {
|
if (!$sth->execute([$hostObj, $domain_id, $clid, $clid])) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1463,7 +1463,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sth = $db->prepare("INSERT INTO `host` (`name`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, CURRENT_TIMESTAMP)");
|
$sth = $db->prepare("INSERT INTO `host` (`name`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
if (!$sth->execute([$hostObj, $clid, $clid])) {
|
if (!$sth->execute([$hostObj, $clid, $clid])) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1502,7 +1502,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$logMessage = "Domain : $domainName ; hostName : $hostName - se dubleaza";
|
$logMessage = "Domain : $domainName ; hostName : $hostName - se dubleaza";
|
||||||
$sth = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(?, ?, CURRENT_TIMESTAMP)");
|
$sth = $db->prepare("INSERT INTO `error_log` (`registrar_id`,`log`,`date`) VALUES(?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
if (!$sth->execute([$clid, $logMessage])) {
|
if (!$sth->execute([$clid, $logMessage])) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1510,7 +1510,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Insert into the host table
|
// Insert into the host table
|
||||||
$sth = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP)");
|
$sth = $db->prepare("INSERT INTO `host` (`name`,`domain_id`,`clid`,`crid`,`crdate`) VALUES(?, ?, ?, ?, CURRENT_TIMESTAMP(3))");
|
||||||
$sth->execute([$hostName, $domain_id, $clid, $clid]) or die($sth->errorInfo()[2]);
|
$sth->execute([$hostName, $domain_id, $clid, $clid]) or die($sth->errorInfo()[2]);
|
||||||
|
|
||||||
$host_id = $db->lastInsertId();
|
$host_id = $db->lastInsertId();
|
||||||
|
@ -1593,13 +1593,13 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$sth->execute([$registrant]);
|
$sth->execute([$registrant]);
|
||||||
$registrant_id = $sth->fetchColumn();
|
$registrant_id = $sth->fetchColumn();
|
||||||
|
|
||||||
$sth = $db->prepare("UPDATE `domain` SET `registrant` = ?, `update` = CURRENT_TIMESTAMP WHERE `id` = ?");
|
$sth = $db->prepare("UPDATE `domain` SET `registrant` = ?, `update` = CURRENT_TIMESTAMP(3) WHERE `id` = ?");
|
||||||
if (!$sth->execute([$registrant_id, $domain_id])) {
|
if (!$sth->execute([$registrant_id, $domain_id])) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$sth = $db->prepare("UPDATE `domain` SET `registrant` = NULL, `update` = CURRENT_TIMESTAMP WHERE `id` = ?");
|
$sth = $db->prepare("UPDATE `domain` SET `registrant` = NULL, `update` = CURRENT_TIMESTAMP(3) WHERE `id` = ?");
|
||||||
if (!$sth->execute([$domain_id])) {
|
if (!$sth->execute([$domain_id])) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1650,7 +1650,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$temp_id = $sth->fetchColumn();
|
$temp_id = $sth->fetchColumn();
|
||||||
|
|
||||||
if ($temp_id == 1) {
|
if ($temp_id == 1) {
|
||||||
$sth = $db->prepare("UPDATE `domain` SET `rgpstatus` = 'pendingRestore', `resTime` = CURRENT_TIMESTAMP, `update` = CURRENT_TIMESTAMP WHERE `id` = ?");
|
$sth = $db->prepare("UPDATE `domain` SET `rgpstatus` = 'pendingRestore', `resTime` = CURRENT_TIMESTAMP(3), `update` = CURRENT_TIMESTAMP(3) WHERE `id` = ?");
|
||||||
if (!$sth->execute([$domain_id])) {
|
if (!$sth->execute([$domain_id])) {
|
||||||
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'Database error', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
|
@ -1686,7 +1686,7 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$sth->execute([$domain_id]);
|
$sth->execute([$domain_id]);
|
||||||
$from = $sth->fetchColumn();
|
$from = $sth->fetchColumn();
|
||||||
|
|
||||||
$sth = $db->prepare("UPDATE `domain` SET `exdate` = DATE_ADD(`exdate`, INTERVAL 12 MONTH), `rgpstatus` = NULL, `rgpresTime` = CURRENT_TIMESTAMP, `update` = CURRENT_TIMESTAMP WHERE `id` = ?");
|
$sth = $db->prepare("UPDATE `domain` SET `exdate` = DATE_ADD(`exdate`, INTERVAL 12 MONTH), `rgpstatus` = NULL, `rgpresTime` = CURRENT_TIMESTAMP(3), `update` = CURRENT_TIMESTAMP(3) WHERE `id` = ?");
|
||||||
|
|
||||||
if (!$sth->execute([$domain_id])) {
|
if (!$sth->execute([$domain_id])) {
|
||||||
sendEppError($conn, $db, 2400, 'It was not renewed successfully, something is wrong', $clTRID, $trans);
|
sendEppError($conn, $db, 2400, 'It was not renewed successfully, something is wrong', $clTRID, $trans);
|
||||||
|
@ -1698,17 +1698,17 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
$db->prepare("UPDATE `registrar` SET `accountBalance` = (`accountBalance` - ? - ?) WHERE `id` = ?")
|
$db->prepare("UPDATE `registrar` SET `accountBalance` = (`accountBalance` - ? - ?) WHERE `id` = ?")
|
||||||
->execute([$renew_price, $restore_price, $clid]);
|
->execute([$renew_price, $restore_price, $clid]);
|
||||||
|
|
||||||
$db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(?,CURRENT_TIMESTAMP,'restore domain $domainName',?)")
|
$db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(?,CURRENT_TIMESTAMP(3),'restore domain $domainName',?)")
|
||||||
->execute([$clid, -$restore_price]);
|
->execute([$clid, -$restore_price]);
|
||||||
|
|
||||||
$db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(?,CURRENT_TIMESTAMP,'renew domain $domainName for period 12 MONTH',?)")
|
$db->prepare("INSERT INTO `payment_history` (`registrar_id`,`date`,`description`,`amount`) VALUES(?,CURRENT_TIMESTAMP(3),'renew domain $domainName for period 12 MONTH',?)")
|
||||||
->execute([$clid, -$renew_price]);
|
->execute([$clid, -$renew_price]);
|
||||||
|
|
||||||
$stmt = $db->prepare("SELECT `exdate` FROM `domain` WHERE `id` = ?");
|
$stmt = $db->prepare("SELECT `exdate` FROM `domain` WHERE `id` = ?");
|
||||||
$stmt->execute([$domain_id]);
|
$stmt->execute([$domain_id]);
|
||||||
$to = $stmt->fetchColumn();
|
$to = $stmt->fetchColumn();
|
||||||
|
|
||||||
$sth = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(?,CURRENT_TIMESTAMP,?,?,?,?,?,?)");
|
$sth = $db->prepare("INSERT INTO `statement` (`registrar_id`,`date`,`command`,`domain_name`,`length_in_months`,`from`,`to`,`amount`) VALUES(?,CURRENT_TIMESTAMP(3),?,?,?,?,?,?)");
|
||||||
$sth->execute([$clid, 'restore', $domainName, 0, $from, $from, $restore_price]);
|
$sth->execute([$clid, 'restore', $domainName, 0, $from, $from, $restore_price]);
|
||||||
|
|
||||||
$sth->execute([$clid, 'renew', $domainName, 12, $from, $to, $renew_price]);
|
$sth->execute([$clid, 'renew', $domainName, 12, $from, $to, $renew_price]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue