Final RST modifications (12 May)

This commit is contained in:
Pinga 2025-05-12 17:40:46 +03:00
parent 1c79be37a6
commit cb372409d3
4 changed files with 48 additions and 0 deletions

View file

@ -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)')); $notBefore = new \DateTime($xpath->evaluate('string(//smd:notBefore)'));
$notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)')); $notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)'));
$markName = $xpath->evaluate('string(//mark:markName)'); $markName = $xpath->evaluate('string(//mark:markName)');

View file

@ -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)')); $notBefore = new \DateTime($xpath->evaluate('string(//smd:notBefore)'));
$notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)')); $notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)'));
$markName = $xpath->evaluate('string(//mark:markName)'); $markName = $xpath->evaluate('string(//mark:markName)');

View file

@ -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)')); $notBefore = new \DateTime($xpath->evaluate('string(//smd:notBefore)'));
$notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)')); $notafter = new \DateTime($xpath->evaluate('string(//smd:notAfter)'));
$markName = $xpath->evaluate('string(//mark:markName)'); $markName = $xpath->evaluate('string(//mark:markName)');

View file

@ -1557,6 +1557,16 @@ function processDomainUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
$stmt->closeCursor(); $stmt->closeCursor();
if ($host_id) { 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 = $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(':domain_id', $domain_id, PDO::PARAM_INT);
$stmt->bindParam(':host_id', $host_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(); $stmt->closeCursor();
if ($host_id) { 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 = $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(':domain_id', $domain_id, PDO::PARAM_INT);
$stmt->bindParam(':host_id', $host_id, PDO::PARAM_INT); $stmt->bindParam(':host_id', $host_id, PDO::PARAM_INT);