From f888b169430592923ded8df9f6688a5ab9720683 Mon Sep 17 00:00:00 2001 From: jengo Date: Sat, 18 Nov 2000 01:18:31 +0000 Subject: [PATCH] Working on nextmatchs for LDAP --- admin/accounts.php | 4 ++-- admin/inc/accounts_ldap.inc.php | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/admin/accounts.php b/admin/accounts.php index 0878fa5188..9f16ef2496 100755 --- a/admin/accounts.php +++ b/admin/accounts.php @@ -17,8 +17,8 @@ . $phpgw_info["server"]["auth_type"] . ".inc.php"); $phpgw->template->set_file(array("header" => "accounts.tpl", - "row" => "accounts.tpl", - "footer" => "accounts.tpl")); + "row" => "accounts.tpl", + "footer" => "accounts.tpl")); $phpgw->template->set_block("header","row","footer"); diff --git a/admin/inc/accounts_ldap.inc.php b/admin/inc/accounts_ldap.inc.php index 59b8c0fa43..f552be1ddc 100644 --- a/admin/inc/accounts_ldap.inc.php +++ b/admin/inc/accounts_ldap.inc.php @@ -73,7 +73,7 @@ return $account_info; } - function account_read($method,$start,$sort,$order) + function account_read($method,$start = 0,$sort,$order) { global $phpgw_info, $ldap; @@ -91,8 +91,29 @@ $filter = "(|(uid=*))"; $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid","uidnumber")); $info = ldap_get_entries($ldap, $sr); + + $nummsg = $start; + + if ($nummsg < $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]) { + $totaltodisplay = $nummsg; + } else if (($nummsg - $start) > $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]) { + $totaltodisplay = $start + $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]; + } else { + $totaltodisplay = $nummsg; + } - for ($i=0; $i<$info["count"]; $i++) { +/* + for ($i=$start, $j=0; $i<$totaltodisplay; $i++,$j++) { + if (! $phpgw_info["server"]["global_denied_users"][$info[$j]["uid"][0]]) { + $account_info[$j]["account_id"] = rawurlencode($info[$j]["dn"]); + $account_info[$j]["account_lid"] = $info[$j]["uid"][0]; + $account_info[$j]["account_lastname"] = $info[$j]["givenname"][0]; + $account_info[$j]["account_firstname"] = $info[$j]["sn"][0]; + } + } +*/ + + for ($i=0, $j=0; $i