From 6b643729d058ba2353ac39963cb60e027b39751d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 7 Jan 2017 19:14:29 +0100 Subject: [PATCH] new type API --- lam/lib/account.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index ec489529..e725e90f 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2003 - 2006 Tilo Lutz - 2009 - 2016 Roland Gruber + 2009 - 2017 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -704,9 +704,14 @@ function searchLDAPByFilter($filter, $attributes, $scopes, $attrsOnly = false) { if ($attrsOnly) { $readAttributesOnly = 1; } - for ($s = 0; $s < sizeof($scopes); $s++) { + $typeManager = new \LAM\TYPES\TypeManager(); + $types = $typeManager->getConfiguredTypes(); + foreach ($types as $type) { + if (!in_array($type->getScope(), $scopes)) { + continue; + } // search LDAP - $entries = searchLDAPPaged($_SESSION['ldap']->server(), escapeDN($_SESSION['config']->get_Suffix($scopes[$s])), + $entries = searchLDAPPaged($_SESSION['ldap']->server(), escapeDN($type->getSuffix()), $filter, $attributes, $readAttributesOnly, $_SESSION['config']->get_searchLimit()); if (ldap_errno($_SESSION['ldap']->server()) == 4) { logNewMessage(LOG_WARNING, 'LDAP size limit exeeded. Please increase the limit on your server.');