Commit e8038afb authored by Thomas Citharel's avatar Thomas Citharel 🌲

Merge branch 'fix-cname-domain-attach' into 'framasites'

Fix cname domain attach

See merge request framasoft/framasite!15
parents a5b4427d 16097b4f
Pipeline #26028 passed with stage
in 5 minutes and 26 seconds
......@@ -13,7 +13,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* @ORM\HasLifecycleCallbacks()
* @FramasitesAssert\ConstraintValidDomainConfiguration
* @UniqueEntity(
* fields={"domain_name"},
* fields={"domainName"},
* message="domain.attach.already_attached"
* )
*/
......
......@@ -65,6 +65,15 @@ class ConfigurationDomainValidator extends ConstraintValidator
private function validateDnsZone()
{
$domain = $this->domainObject->getDomainName();
$this->validateDnsZoneAction($domain);
}
private function validateDnsZoneAction($domain)
{
$cname = dns_get_record($domain, DNS_CNAME);
if ($cname && isset($cname[0]) && $cname[0]['type'] === 'CNAME') {
$this->validateDnsZoneAction($cname[0]['target']);
}
$ipv4 = dns_get_record($domain, DNS_A);
$ipv6 = dns_get_record($domain, DNS_AAAA);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment