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

@ -73,7 +73,7 @@
return $account_info; return $account_info;
} }
function account_read($method,$start,$sort,$order) function account_read($method,$start = 0,$sort,$order)
{ {
global $phpgw_info, $ldap; global $phpgw_info, $ldap;
@ -92,7 +92,28 @@
$sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid","uidnumber")); $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid","uidnumber"));
$info = ldap_get_entries($ldap, $sr); $info = ldap_get_entries($ldap, $sr);
for ($i=0; $i<$info["count"]; $i++) { $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=$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]]) { if (! $phpgw_info["server"]["global_denied_users"][$info[$i]["uid"][0]]) {
$account_info[$i]["account_id"] = rawurlencode($info[$i]["dn"]); $account_info[$i]["account_id"] = rawurlencode($info[$i]["dn"]);
$account_info[$i]["account_lid"] = $info[$i]["uid"][0]; $account_info[$i]["account_lid"] = $info[$i]["uid"][0];
@ -101,6 +122,7 @@
} }
} }
// echo " - order: $order"; // echo " - order: $order";
/* if ($order == "ASC") { /* if ($order == "ASC") {
sort($account_info[$sort]); sort($account_info[$sort]);