Skip to content

Commit e604fe0

Browse files
author
David Coutadeur
committed
first test of server-side pagination (#211)
1 parent c2760c4 commit e604fe0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

htdocs/searchdisabled.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88

99
[$ldap,$result,$nb_entries,$entries,$size_limit_reached] = $ldapInstance->search($ldap_user_filter, array(), $attributes_map, $search_result_title, $search_result_sortby, $search_result_items, $ldap_scope);
1010

11+
$ldapInstance->ldapSort($entries, $attributes_map['identifier']['attribute']);
12+
13+
$page_nb = 1;
14+
$page_size = isset($default_page_size) ? $default_page_size : 25;
15+
if (isset($_GET["page_nb"]) and $_GET["page_nb"])
16+
{
17+
$page_nb = $_GET["page_nb"];
18+
}
19+
if (isset($_GET["page_size"]) and $_GET["page_size"])
20+
{
21+
$page_size = $_GET["page_size"];
22+
}
23+
$entries = array_slice($entries, ($page_size * ($page_nb - 1)), $page_size );
24+
1125
if ( !empty($entries) )
1226
{
1327

0 commit comments

Comments
 (0)