sql_search works again

This commit is contained in:
skeeter 2001-02-07 11:52:19 +00:00
parent 65f1101563
commit ae028712f2

View File

@ -62,16 +62,16 @@
// This is used for searching the access fields // This is used for searching the access fields
function sql_search($table,$owner=0) function sql_search($table,$owner=0)
{ {
global $phpgw_info; global $phpgw, $phpgw_info;
$s = ""; $s = "";
if (!$owner) { if (!$owner) {
$owner = $phpgw_info["user"]["account_id"]; $owner = $phpgw_info["user"]["account_id"];
} }
$groups = $this->read_groups(intval($owner)); $groups = $phpgw->accounts->memberships(intval($owner));
if (gettype($groups) == "array") { if (gettype($groups) == "array") {
while ($group = each($groups)) { while ($group = each($groups)) {
$s .= " or $table like '%," . $group[0] . ",%'"; $s .= " or $table like '%," . $group[2] . ",%'";
} }
} }
return $s; return $s;