Skip to content

Commit

Permalink
Fix: Regression, so introduce option to restore old behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 12, 2014
1 parent e76f217 commit dd7970b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions htdocs/user/class/usergroup.class.php
Expand Up @@ -178,9 +178,10 @@ function listGroupsForUser($userid)
* Return array of users id for group this->id (or all if this->id not defined)
*
* @param string $excludefilter Filter to exclude
* @param int $mode 0=Return array of user instance, 1=Return array of users id only
* @return array Array of users
*/
function listUsersForGroup($excludefilter='')
function listUsersForGroup($excludefilter='', $mode=0)
{
global $conf, $user;

Expand Down Expand Up @@ -211,11 +212,15 @@ function listUsersForGroup($excludefilter='')
{
if (! array_key_exists($obj->rowid, $ret))
{
$newuser=new User($this->db);
$newuser->fetch($obj->rowid);
$ret[$obj->rowid]=$newuser;
if ($mode != 1)
{
$newuser=new User($this->db);
$newuser->fetch($obj->rowid);
$ret[$obj->rowid]=$newuser;
}
else $ret[$obj->rowid]=$obj->rowid;
}
if (! empty($obj->usergroup_entity))
if ($mode != 1 && ! empty($obj->usergroup_entity))
{
$ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity;
}
Expand Down Expand Up @@ -744,4 +749,4 @@ function initAsSpecimen()
}
}

?>
?>

0 comments on commit dd7970b

Please sign in to comment.