mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
Hopefully fixes sql search bug that showed other's private entries
This commit is contained in:
parent
ebd58d40af
commit
8a69409111
@ -373,16 +373,18 @@
|
||||
|
||||
if ($filterlist) {
|
||||
$filtermethod = '('.$filterlist.') ';
|
||||
$fwhere = ' WHERE '; $fand = '';
|
||||
$fwhere = ' WHERE '; $fand = ' AND ';
|
||||
}
|
||||
} else {
|
||||
$filtermethod = "WHERE (tid='n' OR tid is null)";
|
||||
}
|
||||
|
||||
if (!$filtermethod) {
|
||||
$fwhere .= " WHERE (owner=" . $phpgw_info['user']['account_id'];
|
||||
$fwhere .= " (owner=" . $phpgw_info['user']['account_id'];
|
||||
$fand .= " (owner=" . $phpgw_info['user']['account_id'];
|
||||
} else {
|
||||
$fwhere .= $filtermethod . " AND (owner=" . $phpgw_info['user']['account_id'];
|
||||
$fand .= $filtermethod . " AND (owner=" . $phpgw_info['user']['account_id'];
|
||||
}
|
||||
|
||||
if (is_array($this->grants))
|
||||
@ -394,10 +396,11 @@
|
||||
}
|
||||
reset($public_user_list);
|
||||
$fwhere .= " OR (access='public' AND owner in(" . implode(',',$public_user_list) . "))) ";
|
||||
$fand .= " OR (access='public' AND owner in(" . implode(',',$public_user_list) . "))) ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$fwhere .= ') '; $fand = '';
|
||||
$fwhere .= ') '; $fand .= ') ';
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,6 +120,12 @@
|
||||
} else {
|
||||
$qfilter = 'tid=n,access=private,owner='.$phpgw_info["user"]["account_id"].',cat_id='.$cat_id;
|
||||
}
|
||||
} elseif($filter == "yours") {
|
||||
if (!$cat_id) {
|
||||
$qfilter = 'tid=n,owner='.$phpgw_info["user"]["account_id"];
|
||||
} else {
|
||||
$qfilter = 'tid=n,owner='.$phpgw_info["user"]["account_id"].',cat_id='.$cat_id;
|
||||
}
|
||||
} else {
|
||||
if (!$cat_id) {
|
||||
$qfilter = 'tid=n,owner='.$filter;
|
||||
@ -159,7 +165,7 @@
|
||||
|
||||
$search_filter = $phpgw->nextmatchs->show_tpl("/addressbook/index.php",
|
||||
$start, $this->total_records,"&order=$order&filter=$filter&sort=$sort&query=$query&cat_id=$cat_id","75%",
|
||||
$phpgw_info["theme"]["th_bg"]);
|
||||
$phpgw_info["theme"]["th_bg"],1,1,1,1);
|
||||
|
||||
if ($this->total_records > $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]) {
|
||||
if ($start + $phpgw_info["user"]["preferences"]["common"]["maxmatchs"] > $this->total_records) {
|
||||
|
Loading…
Reference in New Issue
Block a user