From f44152f44cce506538d916c3dad4cf9f242fc0e8 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 31 Aug 2006 07:58:53 +0000 Subject: [PATCH] Added "enrol" parameter to role_assign which records how this assignment was made --- lib/accesslib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index 36c62f1a57..d806ce08b7 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1093,7 +1093,7 @@ function get_roles_with_capability($capability, $permission=NULL) { * @uses $USER * @return id - new id of the assigment */ -function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $timeend=0, $hidden=0) { +function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $timeend=0, $hidden=0, $enrol='manual') { global $USER, $CFG; if ($CFG->debug > 7) { @@ -1138,6 +1138,7 @@ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $time $newra->groupid = $groupid; $newra->hidden = $hidden; + $newra->enrol = $enrol; $newra->timestart = $timestart; $newra->timeend = $timeend; $newra->timemodified = time(); @@ -1149,6 +1150,7 @@ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $time $newra->id = $ra->id; $newra->hidden = $hidden; + $newra->enrol = $enrol; $newra->timestart = $timestart; $newra->timeend = $timeend; $newra->timemodified = time(); -- 2.39.5