Permalink
Browse files

Merge branch 'MDL-32125-moodle23' of git://github.com/StudiUM/moodle …

…into MOODLE_23_STABLE
  • Loading branch information...
2 parents 69313ec + d6c3051 commit 0897b1eab1b70e326c7c002b6fed211a93dc287c Sam Hemelryk committed Mar 3, 2013
Showing with 14 additions and 0 deletions.
  1. +8 −0 mod/forum/lib.php
  2. +6 −0 mod/forum/subscribe.php
View
@@ -214,6 +214,14 @@ function forum_update_instance($forum, $mform) {
$DB->update_record('forum', $forum);
+ $modcontext = get_context_instance(CONTEXT_MODULE, $forum->coursemodule);
+ if (($forum->forcesubscribe == FORUM_INITIALSUBSCRIBE) && ($oldforum->forcesubscribe <> $forum->forcesubscribe)) {
+ $users = forum_get_potential_subscribers($modcontext, 0, 'u.id, u.email', '');
+ foreach ($users as $user) {
+ forum_subscribe($user->id, $forum->id);
+ }
+ }
+
forum_grade_item_update($forum);
return true;
View
@@ -111,6 +111,12 @@
redirect($returnto, get_string("everyoneisnowsubscribed", "forum"), 1);
break;
case FORUM_INITIALSUBSCRIBE : // 2
+ if ($forum->forcesubscribe <> FORUM_INITIALSUBSCRIBE) {
+ $users = forum_get_potential_subscribers($context, 0, 'u.id, u.email', '');
+ foreach ($users as $user) {
+ forum_subscribe($user->id, $forum->id);
+ }
+ }
forum_forcesubscribe($forum->id, FORUM_INITIALSUBSCRIBE);
redirect($returnto, get_string("everyoneisnowsubscribed", "forum"), 1);
break;

0 comments on commit 0897b1e

Please sign in to comment.