Code

Several winstation fixes from 2.5
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Jan 2007 06:07:22 +0000 (06:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Jan 2007 06:07:22 +0000 (06:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5629 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_systemManagement.inc
plugins/admin/systems/class_winGeneric.inc
plugins/admin/systems/tabs_winstation.inc
plugins/admin/users/class_userManagement.inc

index 7adac6abc999605cd92b9abcae71e6bf919842bd..17a371c1937d642f9ba1af14322ada4d754acba9 100644 (file)
@@ -819,7 +819,7 @@ class systems extends plugin
       if($this->DivListSystem->$checkBox){
         if($this->DivListSystem->SubSearch){
           if($oc['CLASS'] != ""){
-            $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
+            $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
             $new_res = get_list($filter, $sys_categories , $base,$sys_attrs, GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT);
       
             /* Remove all objects that are not in the expected sub department */
@@ -832,7 +832,7 @@ class systems extends plugin
         }else{
           /* User filter? */
           if($oc['CLASS'] != ""){
-            $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
+            $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
             $res = array_merge($res,get_list($filter,$sys_categories,$oc['TREE'].$base, $sys_attrs, GL_NONE | GL_SIZELIMIT));
           }
         }
index fd57c3a642616bee194f02ab3f865e87bf9280c5..4eb61c7c6ce794711b1bee059dc6af286beadc87 100644 (file)
@@ -55,7 +55,7 @@ class wingeneric extends plugin
       $this->base= dn2base($ui->dn);
       $this->cn= "";
     } else {
-      $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_winstations_ou())."/", "", $this->dn);
     }
 
     /* Save dn for later references */
index 73cd77f4dca5c1745942a07b8b961c99ca8b5b04..2b884c1d83fcbfac2dbdb47381f0ffff1c8fcaa7 100644 (file)
@@ -22,7 +22,7 @@ class wintabs extends tabs
     /* Check for new 'dn', in order to propagate the
        'dn' to all plugins */
     $baseobject= $this->by_object['wingeneric'];
-    $this->dn= "uid=$baseobject->cn,ou=winstations,ou=systems,".$baseobject->base;
+    $this->dn= "uid=$baseobject->cn,".get_winstations_ou().$baseobject->base;
     $baseobject->dn= $this->dn;
 
     foreach ($this->by_object as $key => $obj){
index c0042797a60a184c1b8ec58f9e99d9cff82d85f2..1153026436463c0a065032114b9abc51bf1614a6 100644 (file)
@@ -751,16 +751,25 @@ class userManagement extends plugin
     $SortTemp = array();
     $List = array();
     foreach($ListTemp as $Key => $Entry){
-       // Generate caption for rows
-      if (isset($Entry["sn"]) && isset($Entry["givenName"])){
-        $display= $Entry["sn"][0].", ".$Entry["givenName"][0]." [".$Entry["uid"][0]."]";
-      } else {
-        $display= "[".$Entry["uid"][0]."]";
-      }
 
-      $display = strtolower($display);
-      $List[$display] = $Entry;
-      $SortTemp[$display] = $display;
+      /* Skip entries that are not located under the people ou (normaly 'ou=people,')
+       * Else winstations will be listed too, if you use the subtree flag. 
+       */
+      if(!preg_match("/".normalizePreg(get_people_ou())."/i",$Entry['dn'])){
+        continue;
+      }else{
+
+        // Generate caption for rows
+        if (isset($Entry["sn"]) && isset($Entry["givenName"])){
+          $display= $Entry["sn"][0].", ".$Entry["givenName"][0]." [".$Entry["uid"][0]."]";
+        } else {
+          $display= "[".$Entry["uid"][0]."]";
+        }
+
+        $display = strtolower($display);
+        $List[$display] = $Entry;
+        $SortTemp[$display] = $display;
+      }
     }
     sort($SortTemp);
     reset($SortTemp);