]> _ Git - cubist_net.git/commitdiff
wait #7008
authorsoufiane <soufiane@cubedesigners.com>
Thu, 25 Jul 2024 14:32:35 +0000 (16:32 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 25 Jul 2024 14:32:35 +0000 (16:32 +0200)
src/Transfer/Local.php

index bba6fdc67682348cfc6f7519658f9a2e5fe3217f..40e2625448e8266abfea3b25490f91e2e47375ad 100644 (file)
@@ -10,6 +10,8 @@ class Local extends Driver
 
     const ERROR_FOLDER_UNMOUNT = 3;
 
+    const ERROR_SUBDOMAIN_DNS = 6;
+
     public function __construct(IServer $server, $rootPath = null)
     {
         parent::__construct($server);
@@ -72,6 +74,27 @@ class Local extends Driver
     }
 
     public function checkConnexion($data = []) {
+        $ipHosting = $data['protocol'] === 'hosting' ? gethostbyname('hosting.fluidbook.com') : gethostbyname('hosting2.fluidbook.com');
+
+        $subdomains = explode("\r\n",$data['subdomains']);
+        $subdomainsIntruder = [];
+
+        if($subdomains) {
+            foreach($subdomains as $subdomain) {
+                $ipSubdomain = gethostbyname($subdomain);
+                if($ipSubdomain === $ipHosting) {
+                    continue;
+                }else {
+                    $subdomainsIntruder[] = $subdomain;
+                }
+            }
+        }
+
+        if($subdomainsIntruder) {
+            $subdomainsList = implode(", ",$subdomainsIntruder);
+            return ['subdomains' => $subdomainsList];
+        }
+
         if(file_exists($this->getRootPath().'status')) {
             return true;
         } else {