summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74017e1)
raw | patch | inline | side by side (parent: 74017e1)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Oct 2007 12:56:11 +0000 (12:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 Oct 2007 12:56:11 +0000 (12:56 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7478 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/devices/class_deviceGeneric.inc | patch | blob | history | |
plugins/personal/environment/class_environment.inc | patch | blob | history |
diff --git a/plugins/admin/devices/class_deviceGeneric.inc b/plugins/admin/devices/class_deviceGeneric.inc
index 4ed86e7f2930f74318371864122d8139367e82c2..9581068608b488c30b3256c0c00cb028ca8d41c6 100644 (file)
}
}
+
+ public function remove_from_parent()
+ {
+ plugin::remove_from_parent();
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDeviceDN=*))",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 --;
+ }
+ }
+ if($skip){
+ $str = preg_replace("/, $/","",$str);
+
+ if($cnt == 0){
+ $str .= "...";
+ }
+ print_red(sprintf(_("Can't remove the device '%s' it is still in use be this user(s) : %s"),$this->cn,$str));
+ }else{
+ $ldap->rmdir_recursive($this->dn);
+ }
+ }
+
public function save()
{
diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc
index 9d618039e01b61ea49e26b081859fad4a14e7c67..51f09c0d97280f029242ef590ede0b5ad48ea4b3 100644 (file)
/* Hotplug Devices */
var $gotoHotplugDevice = array(); // Selected hotplug
var $gotoHotplugDevices = array();// Already configured hotplug devices
+ var $gotoHotplugDeviceDN= array();
var $NewAddedPrinters = array();
var $NewDeletedPrinters = array();
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
for($i = 0 ; $i < $this->attrs['gotoHotplugDeviceDN']['count'] ; $i ++){
- $ldap->cat(base64_decode($this->attrs['gotoHotplugDeviceDN'][$i]));
+ $ldap->cat($this->attrs['gotoHotplugDeviceDN'][$i]);
$attrs = $ldap->fetch();
if(isset($attrs['gotoHotplugDevice'][0])){
/* Prepare HotPlug devices */
$this->attrs['gotoHotplugDevice'] = array();
foreach($this->gotoHotplugDevices as $name => $device){
- $this->attrs['gotoHotplugDeviceDN'][]= base64_encode($device['dn']);
+ $this->attrs['gotoHotplugDeviceDN'][]= $device['dn'];
}
/* Prepare LogonScripts */