From: soufiane Date: Tue, 30 Jul 2024 13:24:29 +0000 (+0200) Subject: wait #7008 @0:30 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6a171684298e560ee1bb0afadec913a3cc042ef1;p=fluidbook-toolbox.git wait #7008 @0:30 --- diff --git a/app/Models/FluidbookExternalInstallServer.php b/app/Models/FluidbookExternalInstallServer.php index 458ebc9fe..310ab49e1 100644 --- a/app/Models/FluidbookExternalInstallServer.php +++ b/app/Models/FluidbookExternalInstallServer.php @@ -171,6 +171,27 @@ class FluidbookExternalInstallServer extends ExternalServer $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");