Fix some incorrect responses for account list:

- owngroups included members
- groupmembers was empty
This commit is contained in:
Nathan Gray 2015-12-09 18:55:57 +00:00
parent 0e834e372c
commit d9b43423a7
3 changed files with 7 additions and 5 deletions

View File

@ -390,11 +390,13 @@ class accounts
$type = $only_own ? 'groupmembers' : 'accounts'; $type = $only_own ? 'groupmembers' : 'accounts';
break; break;
case 'groups': case 'groups':
$type = $only_own ? 'memberships' : 'groups'; $type = $only_own ? 'owngroups' : 'groups';
break;
case 'memberships':
$type = 'owngroups';
break; break;
case 'owngroups': case 'owngroups':
case 'groupmembers': case 'groupmembers':
case 'memberships':
$type = $options['account_type']; $type = $options['account_type'];
break; break;
case 'both': case 'both':

View File

@ -447,9 +447,9 @@ class accounts_sql
case 'groupmembers': case 'groupmembers':
case 'groupmembers+memberships': case 'groupmembers+memberships':
$members = array(); $members = array();
foreach((array)$this->memberships($GLOBALS['egw_info']['user']['account_id'], true) as $grp) foreach((array)$this->memberships($GLOBALS['egw_info']['user']['account_id'], true) as $grp => $name)
{ {
$members = array_unique(array_merge($members, (array)$this->members($grp,true))); $members = array_unique(array_merge($members, array_keys((array)$this->members($grp))));
if ($param['type'] == 'groupmembers+memberships') $members[] = abs($grp); if ($param['type'] == 'groupmembers+memberships') $members[] = abs($grp);
} }
$filter['account_id'] = $members; $filter['account_id'] = $members;

View File

@ -1097,7 +1097,7 @@ class egw_session
*/ */
public static function link($url, $extravars = '') public static function link($url, $extravars = '')
{ {
//echo '<p>'.__METHOD__."(url='$url',extravars='".array2string($extravars)."')"; //error_log(_METHOD__."(url='$url',extravars='".array2string($extravars)."')");
if ($url[0] != '/') if ($url[0] != '/')
{ {