From: hickert Date: Tue, 16 Jan 2007 06:35:12 +0000 (+0000) Subject: Fixed DNs zone editor. Save failed for new entries. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=835f7700d39eaf34e48f80b261548d9005d218dc;p=gosa.git Fixed DNs zone editor. Save failed for new entries. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5571 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc index 3a13bde7d..21c334d69 100644 --- a/plugins/admin/systems/class_servDNSeditZoneEntries.inc +++ b/plugins/admin/systems/class_servDNSeditZoneEntries.inc @@ -9,7 +9,7 @@ class servDNSeditZoneEntries extends plugin /* attribute list for save action */ var $ignore_account = TRUE; - var $attributes = array(); + var $attributes = array("cn"); var $objectclasses = array("whatever"); var $Devices = array(); @@ -20,6 +20,7 @@ class servDNSeditZoneEntries extends plugin var $RecordTypes = array(); // Possible record type. var $disableDialog = false; // Dialog will be disabled, if this zone is new + var $cn; function servDNSeditZoneEntries ($config,$dn, $zoneObject) { @@ -29,8 +30,8 @@ class servDNSeditZoneEntries extends plugin */ $this->RecordTypes = getDnsRecordTypes(); $this->dn = "zoneName=".$zoneObject['InitialzoneName'].",".$dn; - $this->zoneName = $zoneObject['InitialzoneName']; - $this->reverseName = $zoneObject['InitialReverseZone']; + $this->zoneName = strtoupper($this->cn)."/".$zoneObject['InitialzoneName']; + $this->reverseName = strtoupper($this->cn)."/".$zoneObject['InitialReverseZone']; /* Get ldap connection */ @@ -195,8 +196,14 @@ class servDNSeditZoneEntries extends plugin $ldap->cd($this->config->current['BASE']); $names = array(); + foreach($this->Devices as $DevName => $device){ + /* skip checking empty attributes */ + if(count($this->Devices[$DevName]['RECORDS']) == 0){ + return; + } + /* Checking entry name */ if((!is_uid($DevName)) | (empty($DevName))){ @@ -229,6 +236,8 @@ class servDNSeditZoneEntries extends plugin /* Names should be written in lowercase */ + + if(strtolower($DevName) != $DevName){ $message[] = sprintf(_("The host name '%s' should be written in lowercase."), $DevName); } @@ -275,6 +284,8 @@ class servDNSeditZoneEntries extends plugin $todo = array(); + print_a($this->Devices); + /* Create todolist */ foreach($this->Devices as $name => $dev){