From: wolffc Date: Thu, 16 Sep 2010 14:46:04 +0000 (+0000) Subject: When removing the File service or inidividual shares, honour the X-Git-Url: https://git.tokkee.org/?p=gosa.git;a=commitdiff_plain;h=ed3bf95ff0ef72007e2a9782d4ca00e79ba33ad8 When removing the File service or inidividual shares, honour the gosaUnitTag when searching for objects still using those shares and do not display an error message if they belong to a different administrative unit. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19726 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc b/trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc index c85f79c93..3a2d343f7 100644 --- a/trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc +++ b/trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc @@ -221,7 +221,13 @@ 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)(objectClass=gosaGroupOfNames))(gotoShare=$cn|*))", array("dn")); + if (isset($this->config->current['HONOURUNITTAGS']) && + preg_match('/true/i', $this->config->current['HONOURUNITTAGS']) && + $this->gosaUnitTag != "") { + $ldap->search("(&(&(|(objectClass=posixGroup)(objectClass=posixAccount)(objectClass=gosaGroupOfNames))(gotoShare=$cn|*))(gosaUnitTag=$this->gosaUnitTag))", array("dn")); + } else { + $ldap->search("(&(|(objectClass=posixGroup)(objectClass=posixAccount)(objectClass=gosaGroupOfNames))(gotoShare=$cn|*))", array("dn")); + } if($ldap->count()){ /* Number of entries shown in warning */ @@ -249,7 +255,13 @@ class goShareServer extends goService{ $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $cn = $ldap->getCn($this->dn); - $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=$cn|$id|*))", array("cn")); + if (isset($this->config->current['HONOURUNITTAGS']) && + preg_match('/true/i', $this->config->current['HONOURUNITTAGS']) && + $this->gosaUnitTag != "") { + $ldap->search("(&(|(gotoProfileServer=*|$id)(gotoShare=$cn|$id|*))(gosaUnitTag=$this->gosaUnitTag))", array("cn")); + } else { + $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=$cn|$id|*))", array("cn")); + } if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ $obj[$ldap->getDN()]= $attrs['cn'][0];