Merge pull request #231 from marc1706/ticket/229

[ticket/229] Display all groups in who is online module
This commit is contained in:
Marc Alexander
2014-04-06 01:39:12 +02:00
2 changed files with 11 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ class whois_online extends module_base
{
$sql = 'SELECT group_id, group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
WHERE group_legend > 0
ORDER BY group_name ASC';
}
else
@@ -108,7 +108,7 @@ class whois_online extends module_base
AND ug.user_id = ' . $this->user->data['user_id'] . '
AND ug.user_pending = 0
)
WHERE g.group_legend = 1
WHERE g.group_legend > 0
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $this->user->data['user_id'] . ')
ORDER BY g.group_name ASC';
}

View File

@@ -97,4 +97,13 @@ class phpbb_functional_portal_visit_registered_test extends \board3\portal\tests
$this->logout();
$crawler = self::request('GET', 'app.php/portal');
}
public function test_whois_online_legend()
{
$crawler = self::request('GET', 'app.php/portal');
$legend = $crawler->filter('dd.portal-responsive-show p em')->text();
$this->assertContains('Administrators', $legend);
$this->assertContains('Global moderators', $legend);
}
}