diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index 78eb404dba40dfd11aa8d6ca7a574f77903844c9..e77badd5531abb7be536650c30b4bdf3717fe15e 100644 (file)
*/
/* Create base to search in */
- $base2 = preg_replace("/ou=people,/i","",$base);
+
+ $peopleOU = get_people_ou();
+ if(empty($peopleOU)) {
+ $base2 = $base;
+ }else{
+ $base2 = preg_replace("/".$peopleOU."/i","",$base);
+ }
/* Get all departments within this subtree */
$res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",