mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
Fix cat_id select, and ldap filter
This commit is contained in:
parent
c4ebab9d28
commit
a031515dbe
@ -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 ' Testing "'.$col.'" for "'.$filt.'"'; }
|
||||
if ($ldap_fields[$i][$col][0] == $filt)
|
||||
{
|
||||
if($DEBUG) { echo ', and number '.$ldap_fields[$i]["uidnumber"][0].' matched.'." "; }
|
||||
$matched[$col] = True;
|
||||
$yes &= True;
|
||||
$match++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$matched[$col] = False;
|
||||
if($DEBUG) { echo ', but number '.$ldap_fields[$i]["uidnumber"][0].' did not match.'." "; }
|
||||
$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];
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user