From: zeph Date: Mon, 29 Jan 2007 13:33:26 +0000 (+0000) Subject: partially fixing bug #32 / termDNS , filter on the reverse zone X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ea0d95ded0cfd2b330aef4157805b2c2800889a0;p=gosa.git partially fixing bug #32 / termDNS , filter on the reverse zone git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5647 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index a7310a89f..c4f6f3293 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -71,6 +71,16 @@ class termDNS extends plugin /* Get Zones */ $this->Zones = getAvailableZones($config); + //echo '
DEBUG: '.print_r($this->Zones, true).'
'; + + $idZones = array_flip($this->Zones); + + $idZones = array_filter($idZones,array($this,"netmaskIsCoherent")); + $this->Zones = array_flip($idZones); + + if(count($this->Zones) < 1) $this->Zones = array("" => "- no reverse zone matching you ip -"); + + //echo '
DEBUG: '.print_r($this->Zones, true).'
'; /* Get Entry */ @@ -103,6 +113,14 @@ class termDNS extends plugin $this->DNSinitially_was_account = $this->DNS_is_account; } + function netmaskIsCoherent($idZone) { + $netmask = FlipIp(str_replace(".in-addr.arpa","",getNameFromMix($idZone))); + if(!strstr($this->ipHostNumber, $netmask)) + return false; + else + return true; + } + function getVarsForSaving($attrs) {