Code

- When checking if a share is in use by other objects,
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Jul 2009 14:07:01 +0000 (14:07 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Jul 2009 14:07:01 +0000 (14:07 +0000)
also check if it is in use by object groups.
- Also check for used shares if removing the share only
  (and not the whole service or server)

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13926 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc

index 7d7b05d9a7b19bf7881c1178d6dbd2edab8586d1..f4ad3050f6fb15bed17658aa0bd0cc3c4a7dff5b 100644 (file)
@@ -221,7 +221,7 @@ class goShareServer extends goService{
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
     $cn = $ldap->getCn($this->dn);
-    $ldap->search("(&(|(objectClass=posixGroup)(objectClass=posixAccount))(gotoShare=$cn|*))", array("dn"));
+    $ldap->search("(&(|(objectClass=posixGroup)(objectClass=posixAccount)(objectClass=gosaGroupOfNames))(gotoShare=$cn|*))", array("dn"));
 
     if($ldap->count()){
       /* Number of entries shown in warning */
@@ -248,7 +248,7 @@ class goShareServer extends goService{
     /* Check if the share is used by someone */
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=*|$id|*||*))", array("cn"));
+    $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=*|$id|*))", array("cn"));
     if ($ldap->count() != 0){
       while ($attrs= $ldap->fetch()){
         $obj[$ldap->getDN()]= $attrs['cn'][0];