searchfilter in loaduser is now limited to 1024 characters

This commit is contained in:
katagia 2003-11-12 10:46:13 +00:00
parent e9ad4e446a
commit 6e87054468
1 changed files with 5 additions and 2 deletions

View File

@ -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;