Working on nextmatchs for LDAP

This commit is contained in:
jengo 2000-11-18 01:18:31 +00:00
parent e35f536961
commit f888b16943
2 changed files with 26 additions and 4 deletions

View File

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

View File

@ -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<count($info); $i++,$j++) {
if (! $phpgw_info["server"]["global_denied_users"][$info[$i]["uid"][0]]) {
$account_info[$i]["account_id"] = rawurlencode($info[$i]["dn"]);
$account_info[$i]["account_lid"] = $info[$i]["uid"][0];
@ -100,6 +121,7 @@
$account_info[$i]["account_firstname"] = $info[$i]["sn"][0];
}
}
// echo " - order: $order";
/* if ($order == "ASC") {