NotifySmtpCheck.php
[Pman.Core] / NotifySmtpCheck.php
index a7bddbb..71dab83 100644 (file)
@@ -30,12 +30,22 @@ class Pman_Core_NotifySmtpCheck extends Pman
         $ifconfig = file_get_contents("https://ifconfig.co/");
         $dom = new DomDocument('1.0', 'utf-8');
         $dom->loadHTML($ifconfig);
-        print_R($dom);exit;
+        
         $xpath = new DOMXPath($dom);
-        $lists = $xpath->query("code[@class='ip]");
         
+        $element = $xpath->query("//code[@class='ip']");
+        
+        if(!$element->length){
+            return;
+        }
+        
+        $ip = $element->item(0)->nodeValue;
+        
+        $cmd = "host {$ip}";
+        
+        $e = `$cmd`;
         
-        print_R($lists);exit;
+        $helo = array_pop(explode(' ', $e));
         
         $error = array();