Fix: Regression, so introduce option to restore old behaviour.
This commit is contained in:
parent
e76f2170b3
commit
dd7970b549
@ -178,9 +178,10 @@ class UserGroup extends CommonObject
|
|||||||
* Return array of users id for group this->id (or all if this->id not defined)
|
* Return array of users id for group this->id (or all if this->id not defined)
|
||||||
*
|
*
|
||||||
* @param string $excludefilter Filter to exclude
|
* @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
|
* @return array Array of users
|
||||||
*/
|
*/
|
||||||
function listUsersForGroup($excludefilter='')
|
function listUsersForGroup($excludefilter='', $mode=0)
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
@ -210,12 +211,16 @@ class UserGroup extends CommonObject
|
|||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
if (! array_key_exists($obj->rowid, $ret))
|
if (! array_key_exists($obj->rowid, $ret))
|
||||||
|
{
|
||||||
|
if ($mode != 1)
|
||||||
{
|
{
|
||||||
$newuser=new User($this->db);
|
$newuser=new User($this->db);
|
||||||
$newuser->fetch($obj->rowid);
|
$newuser->fetch($obj->rowid);
|
||||||
$ret[$obj->rowid]=$newuser;
|
$ret[$obj->rowid]=$newuser;
|
||||||
}
|
}
|
||||||
if (! empty($obj->usergroup_entity))
|
else $ret[$obj->rowid]=$obj->rowid;
|
||||||
|
}
|
||||||
|
if ($mode != 1 && ! empty($obj->usergroup_entity))
|
||||||
{
|
{
|
||||||
$ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity;
|
$ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user