From: hickert Date: Wed, 10 Oct 2007 06:07:09 +0000 (+0000) Subject: Updated remove_from_parent for devices. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=501c1812094ee759f0fad28db3b33d19bad21d90;p=gosa.git Updated remove_from_parent for devices. Do not remove a used device git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7483 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/devices/class_deviceGeneric.inc b/plugins/admin/devices/class_deviceGeneric.inc index 958106860..70029985a 100644 --- a/plugins/admin/devices/class_deviceGeneric.inc +++ b/plugins/admin/devices/class_deviceGeneric.inc @@ -125,20 +125,18 @@ class deviceGeneric extends plugin plugin::remove_from_parent(); $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDeviceDN=*))",array("cn","gotoHotplugDeviceDN")); + + $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDeviceDN=".$this->dn."))",array("cn","gotoHotplugDeviceDN")); $skip = FALSE; $str =""; $cnt = 3; while($cnt && $attrs = $ldap->fetch()){ - if(in_array($this->dn,$attrs['gotoHotplugDeviceDN'])){ - $skip =TRUE; - $str .= $attrs['cn'][0].", "; - $cnt --; - } + $skip =TRUE; + $str .= $attrs['cn'][0].", "; + $cnt --; } if($skip){ $str = preg_replace("/, $/","",$str); - if($cnt == 0){ $str .= "..."; }