andre 5 месяцев назад
Родитель
Сommit
c06ed5e70b
1 измененных файлов с 28 добавлено и 10 удалено
  1. 28 10
      app/UI/Client/Setting/Pages/Settings.php

+ 28 - 10
app/UI/Client/Setting/Pages/Settings.php

@@ -33,6 +33,7 @@ class Settings extends DataTable implements ClientArea
         'set'       =>  'success',
         'unset'     =>  'warning',
         'wrong'     =>  'danger',
+        'multi'     =>  'danger',
         'default'   =>  'default'
     ];
 
@@ -191,20 +192,37 @@ class Settings extends DataTable implements ClientArea
             in_array($domain,$clientDomains) ? $selfdomain = 'set' : $selfdomain = 'unset';
             $dnsRecords = $dns->getRecords($domain);
             $dnsRecords['selfdns'] ? $selfDns = 'set' : $selfDns = 'unset';
-            in_array($params['serverhostname'],$dnsRecords['mx']) ? $mx = 'set' : $mx = 'unset';
-            $spf = 'unset';
-            if(!empty($dnsRecords['spf']) && !(count($dnsRecords['spf']) > 1)) {
-                if($dnsRecords['spf'][0] === $this->spfConfig){
-                    $spf = 'set';
+            if(empty($dnsRecords['mx'])){
+                $mx = 'unset';
+            } else {
+                in_array($params['serverhostname'],$dnsRecords['mx']) ? $mx = 'set' : $mx = 'wrong';
+            }
+            if(empty($dnsRecords['spf'])) {
+                $spf = 'unset';
+            } else {
+                if (count($dnsRecords['spf']) > 1) {
+                    $spf = 'multi';
+                } else {
+                    if($dnsRecords['spf'][0] === $this->spfConfig){
+                        $spf = 'set';
+                    } else {
+                        $spf = 'wrong';
+                    }
                 }
             }
-            $dmarc = 'unset';
-            if(!empty($dnsRecords['dmarc']) && !(count($dnsRecords['dmarc']) > 1)) {
-                if($dnsRecords['dmarc'][0] === $this->dmarcConfig){
-                    $dmarc = 'set';
+            if(empty($dnsRecords['dmarc'])) {
+                $dmarc = 'unset';
+            } else {
+                if (count($dnsRecords['dmarc']) > 1) {
+                    $dmarc = 'multi';
+                } else {
+                    if($dnsRecords['dmarc'][0] === $this->dmarcConfig){
+                        $dmarc = 'set';
+                    } else {
+                        $dmarc = 'wrong';
+                    }
                 }
             }
-            $dkim = 'unset';
             in_array($this->domainKey, $dnsRecords['dkim']) ? $dkim = 'set' : $dkim = 'unset';
             $tmp = [
                 'domain' => $domain,