Code

Skip displaying winworkstations when using subsearch flag.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Jan 2007 05:42:34 +0000 (05:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Jan 2007 05:42:34 +0000 (05:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5627 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_userManagement.inc

index b1c2c1b2b519ec1cef8151cc422d19733a23ea76..55a79bc500c9a75bcbf12b53f282c638fd50186d 100644 (file)
@@ -728,16 +728,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())."/",$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);