$res = [];
+ if($isHosting) {
+ $hosting = $data['protocol'] === 'hosting' ? 'hosting.fluidbook.com' : ($data['protocol'] === 'hosting2' ? 'hosting2.fluidbook.com' : 'us.hosting.fluidbook.com');
+ $ipHosting = dns_get_record($hosting, DNS_A)[0]['ip'];
+
+ $subdomains = explode("\r\n", $data['subdomains']);
+ $subdomainsIntruder = [];
+
+ if ($subdomains) {
+ foreach ($subdomains as $subdomain) {
+ $ipSubdomain = trim(str_replace('\n', '', shell_exec('dig +short @1.1.1.1 ' . $subdomain . ' | tail -1')));
+ if ($ipSubdomain !== $ipHosting) {
+ $subdomainsIntruder[] = $subdomain;
+ }
+ }
+ }
+ if ($subdomainsIntruder) {
+ $subdomainsList = implode(", ", $subdomainsIntruder);
+ $check = ['subdomains' => $subdomainsList, 'host' => $hosting];
+ }
+ }
+
if ($check === true) {
$res['success'] = true;
$res['message'] = __("La connexion a été établie avec succès");