From f7b69afc0dc056d887b61df9714f2cf5894a0743 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 26 Jan 2007 05:42:34 +0000 Subject: [PATCH] Skip displaying winworkstations when using subsearch flag. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5627 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/users/class_userManagement.inc | 27 +++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index b1c2c1b2b..55a79bc50 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -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); -- 2.30.2