Don't maintain a membership for the 'all' group when it includes everyone. Just return it for everyone if the 'all' group is requested. For the count of the 'all' group, just return a count of all the users on the system. Fixes #613

This commit is contained in:
jim-p 2010-07-28 13:41:11 -04:00
parent 1295e7691a
commit b0c231e4f3
2 changed files with 7 additions and 1 deletions

View File

@ -417,6 +417,9 @@ function local_user_get_groups($user, $all = false) {
if (in_array($user['uid'], $group['member']))
$groups[] = $group['name'];
if ( $all )
$groups[] = "all";
sort($groups);
return $groups;

View File

@ -412,6 +412,9 @@ function presubmit() {
$grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group-grey.png";
else
$grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png";
$groupcount = count($group['member']);
if ($group["name"] == "all")
$groupcount = count($config['system']['user']);
?>
<tr ondblclick="document.location='system_groupmanager.php?act=edit&id=<?=$i;?>'">
<td class="listlr">
@ -431,7 +434,7 @@ function presubmit() {
<?=htmlspecialchars($group['description']);?>&nbsp;
</td>
<td class="listbg">
<?=count($group['member'])?>
<?=$groupcount;?>
</td>
<td valign="middle" nowrap class="list">
<a href="system_groupmanager.php?act=edit&id=<?=$i;?>">