From 3611efdcf29fcbf5fc5a4e463d9de75d9ba746f6 Mon Sep 17 00:00:00 2001 From: psc Date: Thu, 18 Jun 2009 09:49:06 +0000 Subject: [PATCH] Relax checks when adding a new share. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13727 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/systems/services/nfs/class_servNfs.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc b/trunk/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc index 3ee3550d0..3de43eddc 100644 --- a/trunk/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc +++ b/trunk/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc @@ -222,16 +222,20 @@ class servnfs extends plugin $this->path=substr($this->path, 0, -1); } + $this_cn = preg_replace("/,ou=.*$/","",$this->dn); + $this_cn = preg_replace("/cn=/","",$this_cn); $ldap= $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - $ldap->search("(objectClass=goShareServer)", array("goExportEntry")); + $ldap->search("(objectClass=goShareServer)", array("goExportEntry", "cn", "gosaUnitTag")); while($test = $ldap->fetch()){ if($test['dn']==$this->dn) continue; if(isset($test['goExportEntry'])){ foreach($test['goExportEntry'] as $entry){ $tmp = split("\|",$entry); - if($tmp[0] == $this->name){ + if($tmp[0] == $this->name && $test['cn'][0] == $this_cn){ + /* The selected share name is identical to another share name. Furthermore, that other share is + on a server with the same name. Reject this. $message[]= sprintf(_("The share '%s' on another server '%s' already exists."), $this->name, $this_cn); } } -- 2.30.2