summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8b630a7)
raw | patch | inline | side by side (parent: 8b630a7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 30 Jan 2007 05:10:49 +0000 (05:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 30 Jan 2007 05:10:49 +0000 (05:10 +0000) |
Avoid selection '- no reverse zone matching you ip -' as zone.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5653 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5653 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_termDNS.inc | patch | blob | history |
index a4f234ed809798c872d07f7b4bceebaa6f76a5f5..c3a3994d9828fe261acbe23bc658251dc455a235 100644 (file)
/* Get Zones
*/
$this->Zones = getAvailableZones($config);
- //echo '<pre>DEBUG: '.print_r($this->Zones, true).'</pre>';
-
- $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 '<pre>DEBUG: '.print_r($this->Zones, true).'</pre>';
/* Get Entry
*/
$this->DNSinitially_was_account = $this->DNS_is_account;
}
- function netmaskIsCoherent($idZone) {
+
+ function netmaskIsCoherent($idZone)
+ {
$netmask = FlipIp(str_replace(".in-addr.arpa","",getNameFromMix($idZone)));
- if(!strstr($this->ipHostNumber, $netmask))
+ if(!strstr($this->ipHostNumber, $netmask)){
return false;
- else
+ }else{
return true;
+ }
}
$smarty->assign("Zones",$this->Zones);
$smarty->assign("ZoneKeys",($this->Zones));
$smarty->assign("IPisMust",(($this->IPisMust)||($this->DNS_is_account)));
-
+
+ /* Create zone array */
+ $idZones = array();
+ foreach($this->Zones as $id => $zone){
+ if($this->netmaskIsCoherent($id)) {
+ $idZones[$id] = $zone;
+ }else{
+ $idZones[$id] = $zone." ("._("Not matching").")";
+ }
+ }
+ $smarty->assign("Zones",$idZones);
+ $smarty->assign("ZoneKeys", $idZones);
+
$tmp = $this->generateRecordsList();
$changeStateForRecords = $tmp['changeStateForRecords'];
$checkArray = array();
$onlyOnce = array();
+ $tmp = array_flip($this->Zones);
+ $tmp2 = $tmp[$this->dnsEntry['zoneName']];
+ if(!$this->netmaskIsCoherent($tmp2)){ //this->dnsEntry['zoneName'])){
+ $tmp2 = preg_replace("/^.*\//","",$tmp2);
+ $message[] =sprintf(_("The specified IP address '%s' is not matching the selected reverse zone entry '%s'."),$this->ipHostNumber,$tmp2);
+ }
+
// There can be many CNAME records
//$onlyOnce['cNAMERecord'] = 0;