new type API

This commit is contained in:
Roland Gruber 2017-01-07 19:14:29 +01:00
parent 7d60eba628
commit 6b643729d0
1 changed files with 8 additions and 3 deletions

View File

@ -4,7 +4,7 @@ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2006 Tilo Lutz 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 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 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) { if ($attrsOnly) {
$readAttributesOnly = 1; $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 // 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()); $filter, $attributes, $readAttributesOnly, $_SESSION['config']->get_searchLimit());
if (ldap_errno($_SESSION['ldap']->server()) == 4) { if (ldap_errno($_SESSION['ldap']->server()) == 4) {
logNewMessage(LOG_WARNING, 'LDAP size limit exeeded. Please increase the limit on your server.'); logNewMessage(LOG_WARNING, 'LDAP size limit exeeded. Please increase the limit on your server.');