Skip to content

Commit

Permalink
Merge branch 'MDL-45059-master' of https://github.com/sammarshallou/m…
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 18, 2014
2 parents 2e6b251 + 02dd7ac commit 166dfd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions availability/condition/group/classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ protected function allow_add($course, \cm_info $cm = null,
\section_info $section = null) {
global $CFG;

// Group option can be used on sections, and on modules but only
// if groupmembersonly is turned off. (To avoid confusion.)
if (!is_null($cm) && $CFG->enablegroupmembersonly) {
// If groupmembersonly is turned on, then you can only add group
// restrictions on sections (which don't use groupmembersonly) and
// not on modules. This is to avoid confusion - otherwise
// there would be two ways to add restrictions based on groups.
if (is_null($section) && $CFG->enablegroupmembersonly) {
return false;
}

Expand Down
8 changes: 5 additions & 3 deletions availability/condition/grouping/classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ protected function allow_add($course, \cm_info $cm = null,
\section_info $section = null) {
global $CFG, $DB;

// Grouping option can be used on sections, and on modules but only
// if groupmembersonly is turned off. (To avoid confusion.)
if (!is_null($cm) && $CFG->enablegroupmembersonly) {
// If groupmembersonly is turned on, then you can only add group
// restrictions on sections (which don't use groupmembersonly) and
// not on modules. This is to avoid confusion - otherwise
// there would be two ways to add restrictions based on groups.
if (is_null($section) && $CFG->enablegroupmembersonly) {
return false;
}

Expand Down

0 comments on commit 166dfd5

Please sign in to comment.