(MDL-8973) Fix OOP model of new multi auth plugins + some other auth related fixes, fixed change_password, ldap updates, etc.; TODO: fix docs
This commit is contained in:
+5
-1
@@ -2194,9 +2194,10 @@ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $time
|
||||
* @param $userid
|
||||
* @param $groupid
|
||||
* @param $contextid
|
||||
* @param $enrol unassign only if enrolment type matches, NULL means anything
|
||||
* @return boolean - success or failure
|
||||
*/
|
||||
function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0) {
|
||||
function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0, $enrol=NULL) {
|
||||
|
||||
global $USER, $CFG;
|
||||
|
||||
@@ -2209,6 +2210,9 @@ function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0) {
|
||||
$select[] = $arg.' = '.$$arg;
|
||||
}
|
||||
}
|
||||
if (!empty($enrol)) {
|
||||
$select[] = "enrol='$enrol'";
|
||||
}
|
||||
|
||||
if ($select) {
|
||||
if ($ras = get_records_select('role_assignments', implode(' AND ', $select))) {
|
||||
|
||||
Reference in New Issue
Block a user