From c69a8774d92e7bddd0deab1bdd4586b9b0976f58 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 31 Mar 2006 06:07:30 +0000 Subject: [PATCH] Some fixes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2937 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_servDNSeditZoneEntries.inc | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc index fa41684f8..7a2e57a45 100644 --- a/plugins/admin/systems/class_servDNSeditZoneEntries.inc +++ b/plugins/admin/systems/class_servDNSeditZoneEntries.inc @@ -168,8 +168,13 @@ class servDNSeditZoneEntries extends plugin */ if(preg_match("/RenameHost_/",$name)){ if((isset($this->Devices[$Name])) && ($Name != $value)){ - $this->Devices[$value] = $this->Devices[$Name]; - unset($this->Devices[$Name]); + + if(isset($this->Devices[$value])){ + print_red(sprintf(_("Can't rename '%s' to '%s' there is already an entry with the same name in our zone editing dialog."),$Name,$value)); + }else{ + $this->Devices[$value] = $this->Devices[$Name]; + unset($this->Devices[$Name]); + } } } } @@ -197,9 +202,16 @@ class servDNSeditZoneEntries extends plugin /* Renaming check for existing devices */ if(isset($device['OrigCn']) && ($DevName != $device['OrigCn'] )){ - $ldap->search("(cn=".$DevName.")",array("cn")); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName")); + if($ldap->count()){ + $message[] = sprintf(_("Can not rename '%s' to '%s',the destination name already exists."),$device['OrigCn'],$DevName); + } + }elseif(!isset($device['OrigCn'])){ + $ldap->cd($this->config->current['BASE']); + $ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName")); if($ldap->count()){ - $message[] = sprintf(_("Can't rename '%s' to '%s',the destination name already exists."),$device['OrigCn'],$DevName); + $message[] = sprintf(_("Can not create '%s',the destination name already exists."),$DevName); } } -- 2.30.2