]> git.mjollnir.org Git - moodle.git/commitdiff
Added forum_role_assign and forum_role_unassign
authormoodler <moodler>
Wed, 13 Sep 2006 08:11:34 +0000 (08:11 +0000)
committermoodler <moodler>
Wed, 13 Sep 2006 08:11:34 +0000 (08:11 +0000)
mod/forum/lib.php

index a38259d8114491b6ec45eac350102abae66f5dcc..d24d3f66bea5d74e5e63e6e73db934cb7c245bc5 100644 (file)
@@ -3521,6 +3521,30 @@ function forum_update_subscriptions_button($courseid, $forumid) {
            "<input type=\"submit\" value=\"$string\" /></form>";
 }
 
+/*
+ * 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