6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/15/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#5258] Make use of LDAP pagination if available
*
Your Email Address
*
Spam protection
Enter the letters below:
. . .. ..___.___. | |\ ||_/ [__ _/ |___| \|| \| ./__.
Comment
> From the nyphp-talk list: > > > > The below code demonstrates how to use the pagedResultsControl. The PHP > > LDAP API is somewhat course but it should work. > > > > Mike > > > > $continue = true; > > while ($continue) { > > $paged_control = array( > > array( > > 'oid' => PAGED_CONTROL_OID, > > 'iscritical' => true, > > 'value' => ldap_ber_printf ('{iO}', > > PAGE_SIZE, $cookie) > > ) > > ); > > if (!ldap_set_option($l, LDAP_OPT_SERVER_CONTROLS, $paged_control)) { > > echo "Not OK: ldap_set_option (controls)\n"; > > exit; > > } > > > > $sr = ldap_search($l, $query, $query_filter, $query_attribs, 0, 0, 0, > > LDAP_DEREF_NEVER); > > > > if ($sr === FALSE) { > > echo "Not OK: ldap_search\n"; > > exit; > > } > > > > if (!ldap_parse_result ($l, $sr, &$errcode, &$matcheddn, &$errmsg, > > &$referrals, &$serverctrls)) { > > echo "Not OK: ldap_parse_result\n"; > > exit; > > } > > > > $paged_control_found = FALSE; > > if (isset($serverctrls)) { > > foreach ($serverctrls as $i) { > > if ($i['oid'] == PAGED_CONTROL_OID) { > > ldap_ber_scanf($i['value'], '{iO}', &$pagesize, &$cookie); > > $paged_control_found = TRUE; > > break; > > } > > } > > } > > if (!$paged_control_found) { > > echo "Not OK: paged control not found in response \n"; > > exit; > > } > > > > // process entries as usual here ... > > > > if ($cookie == '') { > > $continue = false; > > } > > }
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers