Browse code

Zeige DNS-Records eine Domain auch dann an, wenn ein DynDNS eines anderen Users enthalten ist (z.B. für schokokeks.net)

Bernd Wurst authored on19/02/2016 04:57:23
Showing2 changed files
... ...
@@ -50,7 +50,11 @@ foreach ($records AS $rec)
50 50
       $editable = false;
51 51
     } else {
52 52
       $dyndns = get_dyndns_account($rec['dyndns']);
53
-      $data = internal_link('dyndns_edit', '<em>DynDNS #'.(int) $rec['dyndns'].' ('.filter_input_general($dyndns['handle']).')</em>', 'id='.(int) $rec['dyndns']);
53
+      if ($dyndns === NULL) {
54
+        $data = '<em>DynDNS #'.(int) $rec['dyndns'].' (nicht Ihr Account)</em>';
55
+      } else {
56
+        $data = internal_link('dyndns_edit', '<em>DynDNS #'.(int) $rec['dyndns'].' ('.filter_input_general($dyndns['handle']).')</em>', 'id='.(int) $rec['dyndns']);
57
+      }
54 58
     }
55 59
   }
56 60
   if ($rec['type'] == 'mx')
... ...
@@ -35,13 +35,16 @@ function get_dyndns_accounts()
35 35
 }
36 36
 
37 37
 
38
-function get_dyndns_account($id) 
38
+function get_dyndns_account($id, $ignore=true) 
39 39
 {
40 40
   $args = array(":id" => (int) $id,
41 41
                 ":uid" => (int) $_SESSION['userinfo']['uid']);
42 42
   $result = db_query("SELECT * FROM dns.dyndns WHERE id=:id AND uid=:uid", $args);
43 43
   if ($result->rowCount() != 1) {
44
-    logger(LOG_WARNING, "modules/dns/include/dnsinclude", "dyndns", "account »{$id}« invalid for uid »{$uid}«.");
44
+    if ($ignore) {
45
+      return NULL;
46
+    } 
47
+    logger(LOG_WARNING, "modules/dns/include/dnsinclude", "dyndns", "account »{$id}« invalid for uid »{$_SESSION['userinfo']['uid']}«.");
45 48
     system_failure("Account ungültig");
46 49
   }
47 50
   $item = $result->fetch();