From: hickert Date: Fri, 26 Jan 2007 05:42:34 +0000 (+0000) Subject: Skip displaying winworkstations when using subsearch flag. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7b69afc0dc056d887b61df9714f2cf5894a0743;p=gosa.git 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 --- 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);