Fix cat_id select, and ldap filter

This commit is contained in:
Miles Lott 2001-03-29 16:07:34 +00:00
parent c4ebab9d28
commit a031515dbe
2 changed files with 8 additions and 21 deletions

View File

@ -174,40 +174,27 @@
$match = 0;
if($DEBUG) { echo "<br>"; }
for($i=0;$i<count($ldap_fields);$i++) {
$matched = "";
$allmatched = False;
reset($filterfields);
$yes = True;
reset($filterfields);
while (list($col,$filt) = each($filterfields))
{
if($DEBUG) { echo '&nbsp;&nbsp;Testing "'.$col.'" for "'.$filt.'"'; }
if ($ldap_fields[$i][$col][0] == $filt)
{
if($DEBUG) { echo ', and number '.$ldap_fields[$i]["uidnumber"][0].' matched.'."&nbsp;&nbsp;"; }
$matched[$col] = True;
$yes &= True;
$match++;
}
else
{
$matched[$col] = False;
if($DEBUG) { echo ', but number '.$ldap_fields[$i]["uidnumber"][0].' did not match.'."&nbsp;&nbsp;"; }
$yes &= False;
$match--;
}
while (list($colmatch) = each($matched))
{
if ($matched[$col])
{
$allmatched = True;
}
else
{
$allmatched = False;
}
}
}
if ($allmatched)
if ($yes)
{
if($DEBUG) { echo $ldap_fields[$i]["uidnumber"][0].' matched all!'."<br>"; }
$new_ldap[] = $ldap_fields[$i];

View File

@ -109,19 +109,19 @@
if (!$filter) { $filter = "none"; }
if ($filter == "none") {
if ($cat_id == "all") {
if (!$cat_id) {
$qfilter = 'tid=n';
} else {
$qfilter = 'tid=n,cat_id='.$cat_id;
}
} elseif($filter == "private") {
if ($cat_id == "all") {
if (!$cat_id) {
$qfilter = 'tid=n,access=private,owner='.$phpgw_info["user"]["account_id"];
} else {
$qfilter = 'tid=n,access=private,owner='.$phpgw_info["user"]["account_id"].',cat_id='.$cat_id;
}
} else {
if ($cat_id == "all") {
if (!$cat_id) {
$qfilter = 'tid=n,owner='.$filter;
} else {
$qfilter = 'tid=n,owner='.$filter.'cat_id='.$cat_id;