mirror of
https://github.com/getnamingo/registry.git
synced 2025-06-15 00:44:34 +02:00
Final RST modifications (12 May)
This commit is contained in:
parent
1c79be37a6
commit
cb372409d3
4 changed files with 48 additions and 0 deletions
|
@ -240,6 +240,16 @@ class ApplicationsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$smdId = $xpath->evaluate('string(//smd:id)');
|
||||
$isRevoked = $db->selectValue(
|
||||
"SELECT 1 FROM tmch_revocation WHERE smd_id = ?",
|
||||
[ $smdId ]
|
||||
);
|
||||
if ($isRevoked === 1) {
|
||||
$this->container->get('flash')->addMessage('error', 'Error creating application: SMD certificate has been revoked');
|
||||
return $response->withHeader('Location', '/application/create')->withStatus(302);
|
||||
}
|
||||
|
||||
$notBefore = new \DateTime($xpath->evaluate('string(//smd:notBefore)'));
|
||||
$notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)'));
|
||||
$markName = $xpath->evaluate('string(//mark:markName)');
|
||||
|
|
|
@ -350,6 +350,16 @@ class DomainsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$smdId = $xpath->evaluate('string(//smd:id)');
|
||||
$isRevoked = $db->selectValue(
|
||||
"SELECT 1 FROM tmch_revocation WHERE smd_id = ?",
|
||||
[ $smdId ]
|
||||
);
|
||||
if ($isRevoked === 1) {
|
||||
$this->container->get('flash')->addMessage('error', 'Error creating domain: SMD certificate has been revoked');
|
||||
return $response->withHeader('Location', '/domain/create')->withStatus(302);
|
||||
}
|
||||
|
||||
$notBefore = new \DateTime($xpath->evaluate('string(//smd:notBefore)'));
|
||||
$notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)'));
|
||||
$markName = $xpath->evaluate('string(//mark:markName)');
|
||||
|
|
|
@ -849,6 +849,14 @@ function processDomainCreate($conn, $db, $xml, $clid, $database_type, $trans, $m
|
|||
}
|
||||
}
|
||||
|
||||
$smdId = $xpath->evaluate('string(//smd:id)');
|
||||
$stmt = $db->prepare("SELECT 1 FROM tmch_revocation WHERE smd_id = ?");
|
||||
$stmt->execute([$smdId]);
|
||||
if ($stmt->fetchColumn()) {
|
||||
sendEppError($conn, $db, 2306, 'Error creating domain: SMD certificate has been revoked.', $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
$notBefore = new \DateTime($xpath->evaluate('string(//smd:notBefore)'));
|
||||
$notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)'));
|
||||
$markName = $xpath->evaluate('string(//mark:markName)');
|
||||
|
|
|
@ -1557,6 +1557,16 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$stmt->closeCursor();
|
||||
|
||||
if ($host_id) {
|
||||
$stmt = $db->prepare("SELECT 1 FROM domain_host_map WHERE domain_id = :domain_id AND host_id = :host_id LIMIT 1");
|
||||
$stmt->execute([':domain_id' => $domain_id, ':host_id' => $host_id]);
|
||||
$linked = $stmt->fetchColumn();
|
||||
$stmt->closeCursor();
|
||||
|
||||
if (!$linked) {
|
||||
sendEppError($conn, $db, 2305, "hostObj $hostObj is not associated with this domain", $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("DELETE FROM domain_host_map WHERE domain_id = :domain_id AND host_id = :host_id");
|
||||
$stmt->bindParam(':domain_id', $domain_id, PDO::PARAM_INT);
|
||||
$stmt->bindParam(':host_id', $host_id, PDO::PARAM_INT);
|
||||
|
@ -1586,6 +1596,16 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
|||
$stmt->closeCursor();
|
||||
|
||||
if ($host_id) {
|
||||
$stmt = $db->prepare("SELECT 1 FROM domain_host_map WHERE domain_id = :domain_id AND host_id = :host_id LIMIT 1");
|
||||
$stmt->execute([':domain_id' => $domain_id, ':host_id' => $host_id]);
|
||||
$linked = $stmt->fetchColumn();
|
||||
$stmt->closeCursor();
|
||||
|
||||
if (!$linked) {
|
||||
sendEppError($conn, $db, 2305, "hostAttr $hostName is not associated with this domain", $clTRID, $trans);
|
||||
return;
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("DELETE FROM domain_host_map WHERE domain_id = :domain_id AND host_id = :host_id");
|
||||
$stmt->bindParam(':domain_id', $domain_id, PDO::PARAM_INT);
|
||||
$stmt->bindParam(':host_id', $host_id, PDO::PARAM_INT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue