Code

Apply fix for #3672
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Feb 2010 16:46:43 +0000 (16:46 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Feb 2010 16:46:43 +0000 (16:46 +0000)
- When getting a list of departments do consider the
  unittag and honour unittag configuration.
- When getting a list of hotplug devices filter them by
  the unittag of the user, so that only devices with the
  same gosa unittag are used.

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

trunk/gosa-core/include/class_config.inc
trunk/gosa-plugins/goto/personal/environment/class_hotplugDialog.inc

index 2338ce7aac8ffd84a71e65bcbabd1b2f44218dc3..1185d28d0a9cf860d6798af07410bb6bb229bf30 100644 (file)
@@ -792,7 +792,7 @@ class config  {
             $this->tdepartments[$val] != $ui->gosaUnitTag){
 
                                                #TODO: link with strict*
-                                               #continue;
+                                               continue;
         }
       }
 
index 2fd7c342e8683fc6b07c81755409c3cb1f16f650..04a6c21c1a789f0226c82ef92189a2504fad2b76 100644 (file)
@@ -84,9 +84,10 @@ class hotplugDialog extends plugin
 
   function getHotplugs()
   {
+    $ui = get_userinfo();
     $filter = "(&(objectClass=gotoDevice)(|(cn=".$this->regex.")(description=".$this->regex.")))";
     $base = get_ou('deviceRDN').$this->depselect;
-    $attrs = array("gotoHotplugDevice", "cn", "dn");
+    $attrs = array("gotoHotplugDevice", "cn", "dn", "gosaUnitTag");
     $cat = "devices";
 
     if ($this->subtree) {
@@ -98,6 +99,10 @@ class hotplugDialog extends plugin
     $a_return = array();  
     $this->hotplugDeviceList = array();
     foreach ($res as $device) {
+      /* Skip devices with a different unittag as those of the user */
+      if ($device['gosaUnitTag'][0] != $ui->gosaUnitTag) {
+        continue;
+      }
 
       if(isset($device['gotoHotplugDevice'][0])){