From 6e870544689803d9fc28e28c1cbdc22221500464 Mon Sep 17 00:00:00 2001 From: katagia Date: Wed, 12 Nov 2003 10:46:13 +0000 Subject: [PATCH] searchfilter in loaduser is now limited to 1024 characters --- lam/lib/account.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index d4d318e0..f12e4e7f 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -941,8 +941,11 @@ function loaduser($dns) { $search .= ")"; } else $search = substr($dns, 0, strpos($dns, ',')); - // search for users - $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), $search); + /* if string is langer then 1024 characters we have to search for all users and + * output only the selcted users because searchfilter would be too big + */ + if (strlen($search<1024)) $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix(), $search); + else $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_UserSuffix()); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); // loop for every found user $i=0;