[PHP] ldap_search(): Partial search results returned: Sizelimit exceeded

2007-07-17 Thread Jay Blanchard
Perhaps mistakenly for a project that I am trying to do I want to list
all users in the Active Directory. It works pretty well with one
exception, the error ldap_search(): Partial search results returned:
Sizelimit exceeded.

Now, I know that I can page through (I would have to figure out a clever
way to display to the user) these.

I have read some stuff that says the limit is hard coded in AD, so there
is no way around it. I just wanted to check with you folks to see if you
had any clever ideas on how to work around this.

TVMIA!

$username = $_SESSION['user'];
$password = $_SESSION['password'];
if(!$ds=ldap_connect(172.17.16.161)){
echo did not connect...please contact system administrator or
go back to try again;
}

$un = foobar\\.$username;
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ds, LDAP_OPT_SIZELIMIT, 2000);
if(!$r=ldap_bind($ds, $un, $password)){
echo 'You are not authorized and or, your login information was
incorrect';
} else {
$sr=ldap_search($ds, dc=domain, dc=local, mailnickname=);
$info = ldap_get_entries($ds, $sr);
$sr= ldap_search($ds, dc=domain, dc=local, mailnickname=*);
$info = ldap_get_entries($ds, $sr);
echo count($info) . br /;
for ($i=0; $icount($info); $i++) {
echo $info[$i][mailnickname][0] . br /;

}

}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ldap_search(): Partial search results returned: Sizelimit exceeded

2007-07-17 Thread Richard Lynch
On Tue, July 17, 2007 4:51 pm, Jay Blanchard wrote:
 Perhaps mistakenly for a project that I am trying to do I want to list
 all users in the Active Directory. It works pretty well with one
 exception, the error ldap_search(): Partial search results returned:
 Sizelimit exceeded.

 Now, I know that I can page through (I would have to figure out a
 clever
 way to display to the user) these.

 I have read some stuff that says the limit is hard coded in AD, so
 there
 is no way around it. I just wanted to check with you folks to see if
 you
 had any clever ideas on how to work around this.

Totally crude hack...

If you get that message, search for users whose username starts with
'A', then 'B', then 'C', ...

:-)

You could even provide an alpha index at the top/side navbar when
needed, and then have a more natural program flow.

You'd still have an issue if there were too many under any one
letter though... :-(

Maybe ask an ActiveDirectory mailing list, if one exists, since it's
really more in their ballpark than PHP's.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php