From: moodler Date: Wed, 13 Sep 2006 08:11:34 +0000 (+0000) Subject: Added forum_role_assign and forum_role_unassign X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d6cc763f732fe22e3bec63a5580efabcc85e9458;p=moodle.git Added forum_role_assign and forum_role_unassign --- diff --git a/mod/forum/lib.php b/mod/forum/lib.php index a38259d811..d24d3f66be 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3521,6 +3521,30 @@ function forum_update_subscriptions_button($courseid, $forumid) { ""; } +/* + * This function gets run whenever a role is assigned to a user in a context + * + * @param integer $userid + * @param object $context + * @return bool + */ +function forum_role_assign($userid, $context) { + return forum_add_user_default_subscriptions($userid, $context); +} + + +/* + * This function gets run whenever a role is assigned to a user in a context + * + * @param integer $userid + * @param object $context + * @return bool + */ +function forum_role_unassign($userid, $context) { + return forum_remove_user_subscriptions($userid, $context); +} + + function forum_add_user_default_subscriptions($userid, $context) { /// Add subscriptions for new users