Permalink
Browse files

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

…into MOODLE_24_STABLE
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Mar 3, 2013
2 parents d2dbe64 + 4451465 commit b62c8a06ad16f265362c1a20463e91ccf41dc582
Showing with 14 additions and 0 deletions.
  1. +8 −0 mod/forum/lib.php
  2. +6 −0 mod/forum/subscribe.php
View
@@ -208,6 +208,14 @@ function forum_update_instance($forum, $mform) {
$DB->update_record('forum', $forum);
+ $modcontext = context_module::instance($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 b62c8a0

Please sign in to comment.