Commit 1e39fa77 authored by Robert Lyon's avatar Robert Lyon Committed by Jinelle Foley-Barnes
Browse files

Allowing admin users see all activity filter types in inbox/outbox



Bug 1433342

Also letting the users that are group admins of at least one group to
be able to see the 'objectional content in forum' and 'new posts'
filter as well.

Change-Id: Ie70f7af13f2b266ed77e6504dea30bb635939e59
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 135a4d88
......@@ -36,9 +36,15 @@ $installedtypes = get_records_assoc(
);
$options = array();
// check if user is an admin in at least one group and if so they can see group admin filter options
$groupadmin = false;
$grouproles = $USER->get('grouproles');
if (array_search('admin', $grouproles) !== false) {
$groupadmin = true;
}
foreach ($installedtypes as &$t) {
if (!$t->admin) {
foreach ($installedtypes as $t) {
if (!$t->admin || $USER->get('admin') || ($groupadmin && $t->pluginname == 'forum')) {
$section = $t->pluginname ? "{$t->plugintype}.{$t->pluginname}" : 'activity';
$options[$t->name] = get_string('type' . $t->name, $section);
}
......
......@@ -35,10 +35,10 @@ $installedtypes = get_records_assoc(
);
$options = array();
foreach ($installedtypes as &$t) {
foreach ($installedtypes as $t) {
// ignore activity type newpost, as each recipients notification appears
// as a single entry for the poster and thus floods his outbox
if ((!$t->admin) && ('newpost' !== $t->name)) {
if ((!$t->admin || $USER->get('admin')) && ('newpost' !== $t->name)) {
$section = $t->pluginname ? "{$t->plugintype}.{$t->pluginname}" : 'activity';
$options[$t->name] = get_string('type' . $t->name, $section);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment