Skip to content
Browse files

MDL-25068 forum: fixed error string usage

The string [cannotsubscribe,mod_forum] is supposed to be used for group
membership check only. I have fixed the two other usages of the string.
Note that the condition if (forum_subscribe()) was useless as the
function return true values only now after $DB conversion.
  • Loading branch information...
1 parent 9a3adb2 commit d1571da6c8d23f108e3246a1ff2b9a5d8df646fd @mudrd8mz mudrd8mz committed Dec 7, 2010
Showing with 4 additions and 8 deletions.
  1. +4 −8 mod/forum/subscribe.php
View
12 mod/forum/subscribe.php
@@ -132,13 +132,9 @@
print_error('disallowsubscribe', 'forum', $_SERVER["HTTP_REFERER"]);
}
if (!has_capability('mod/forum:viewdiscussion', $context)) {
- print_error('cannotsubscribe', 'forum', $_SERVER["HTTP_REFERER"]);
- }
- if (forum_subscribe($user->id, $forum->id) ) {
- add_to_log($course->id, "forum", "subscribe", "view.php?f=$forum->id", $forum->id, $cm->id);
- redirect($returnto, get_string("nowsubscribed", "forum", $info), 1);
- } else {
- print_error('cannotsubscribe', 'forum', $_SERVER["HTTP_REFERER"]);
+ print_error('noviewdiscussionspermission', 'forum', $_SERVER["HTTP_REFERER"]);
}
+ forum_subscribe($user->id, $forum->id);
+ add_to_log($course->id, "forum", "subscribe", "view.php?f=$forum->id", $forum->id, $cm->id);
+ redirect($returnto, get_string("nowsubscribed", "forum", $info), 1);
}
-

0 comments on commit d1571da

Please sign in to comment.
Something went wrong with that request. Please try again.