Code

Relax checks when adding a new share.
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Jun 2009 09:49:06 +0000 (09:49 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Jun 2009 09:49:06 +0000 (09:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13727 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc

index 3ee3550d0387b102edb7b0ac47a1ed123132b73b..3de43eddca3517a07bb0673d49aaf090ef75f9d1 100644 (file)
@@ -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);
           }
         }