|
@@ -44,6 +44,14 @@ if ($dirsStatuses[$_POST['dir']] !== false)
|
|
|
if (query('select', 'sites', ['domain' => $_POST['domain']], 'domain') !== [])
|
|
|
userError("Ce domaine existe déjà sur ce service.");
|
|
|
|
|
|
+$remoteAaaaRecords = array_column(dns_get_record($_POST['domain'], DNS_AAAA), 'ipv6');
|
|
|
+if (array_merge(array_diff($remoteAaaaRecords, [CONF['ht']['ipv6_address']]), array_diff([CONF['ht']['ipv6_address']], $remoteAaaaRecords)) !== [])
|
|
|
+ userError("Ce domaine doit avoir pour enregistrement AAAA <code>" . CONF['ht']['ipv6_address'] . "</code>.");
|
|
|
+
|
|
|
+$remoteARecords = array_column(dns_get_record($_POST['domain'], DNS_A), 'ip');
|
|
|
+if (array_merge(array_diff($remoteARecords, [CONF['ht']['ipv4_address']]), array_diff([CONF['ht']['ipv4_address']], $remoteARecords)) !== [])
|
|
|
+ userError("Ce domaine doit avoir pour enregistrement A <code>" . CONF['ht']['ipv4_address'] . "</code>.");
|
|
|
+
|
|
|
addSite($_SESSION['username'], $_POST['dir'], $_POST['domain'], "dns", "http");
|
|
|
|
|
|
$nginxConf = 'server {
|