mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'w16_MDL-27148_m21_stringinc' of git://github.com/skodak/moodle
This commit is contained in:
commit
97fefd2386
32 changed files with 173 additions and 135 deletions
|
@ -111,7 +111,7 @@ class enrol_category_handler {
|
|||
$params = array('courselevel'=>CONTEXT_COURSE, 'match'=>$parentcontext->path.'/%', 'userid'=>$ra->userid);
|
||||
$rs = $DB->get_recordset_sql($sql, $params);
|
||||
|
||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
|
||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r');
|
||||
$params['userid'] = $ra->userid;
|
||||
|
||||
foreach ($rs as $instance) {
|
||||
|
@ -119,7 +119,7 @@ class enrol_category_handler {
|
|||
$contextids = get_parent_contexts($coursecontext);
|
||||
array_pop($contextids); // remove system context, we are interested in categories only
|
||||
|
||||
list($contextids, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED, 'c000');
|
||||
list($contextids, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED, 'c');
|
||||
$params = array_merge($params, $contextparams);
|
||||
|
||||
$sql = "SELECT ra.id
|
||||
|
@ -168,8 +168,8 @@ function enrol_category_sync_course($course) {
|
|||
$contextids = get_parent_contexts($coursecontext);
|
||||
array_pop($contextids); // remove system context, we are interested in categories only
|
||||
|
||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
|
||||
list($contextids, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED, 'c000');
|
||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r');
|
||||
list($contextids, $contextparams) = $DB->get_in_or_equal($contextids, SQL_PARAMS_NAMED, 'c');
|
||||
$params = array_merge($params, $contextparams);
|
||||
$params['courseid'] = $course->id;
|
||||
|
||||
|
@ -257,7 +257,7 @@ function enrol_category_sync_full() {
|
|||
return;
|
||||
}
|
||||
|
||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
|
||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r');
|
||||
$params['courselevel'] = CONTEXT_COURSE;
|
||||
$params['catlevel'] = CONTEXT_COURSECAT;
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ class enrol_ldap_plugin extends enrol_plugin {
|
|||
WHERE u.deleted = 0 AND e.courseid = :courseid ";
|
||||
$params = array('roleid'=>$role->id, 'courseid'=>$course_obj->id);
|
||||
if (!empty($ldapmembers)) {
|
||||
list($ldapml, $params2) = $DB->get_in_or_equal($ldapmembers, SQL_PARAMS_NAMED, 'm0', false);
|
||||
list($ldapml, $params2) = $DB->get_in_or_equal($ldapmembers, SQL_PARAMS_NAMED, 'm', false);
|
||||
$sql .= "AND u.idnumber $ldapml";
|
||||
$params = array_merge($params, $params2);
|
||||
unset($params2);
|
||||
|
|
|
@ -141,7 +141,7 @@ class course_enrolment_manager {
|
|||
public function get_total_other_users() {
|
||||
global $DB;
|
||||
if ($this->totalotherusers === null) {
|
||||
list($ctxcondition, $params) = $DB->get_in_or_equal(get_parent_contexts($this->context, true), SQL_PARAMS_NAMED, 'ctx00');
|
||||
list($ctxcondition, $params) = $DB->get_in_or_equal(get_parent_contexts($this->context, true), SQL_PARAMS_NAMED, 'ctx');
|
||||
$params['courseid'] = $this->course->id;
|
||||
$sql = "SELECT COUNT(DISTINCT u.id)
|
||||
FROM {role_assignments} ra
|
||||
|
@ -222,7 +222,7 @@ class course_enrolment_manager {
|
|||
}
|
||||
$key = md5("$sort-$direction-$page-$perpage");
|
||||
if (!array_key_exists($key, $this->otherusers)) {
|
||||
list($ctxcondition, $params) = $DB->get_in_or_equal(get_parent_contexts($this->context, true), SQL_PARAMS_NAMED, 'ctx00');
|
||||
list($ctxcondition, $params) = $DB->get_in_or_equal(get_parent_contexts($this->context, true), SQL_PARAMS_NAMED, 'ctx');
|
||||
$params['courseid'] = $this->course->id;
|
||||
$params['cid'] = $this->course->id;
|
||||
$sql = "SELECT ra.id as raid, ra.contextid, ra.component, ctx.contextlevel, ra.roleid, u.*, ue.lastseen
|
||||
|
|
|
@ -208,7 +208,7 @@ function enrol_meta_sync($courseid = NULL) {
|
|||
|
||||
// iterate through all not enrolled yet users
|
||||
if (enrol_is_enabled('meta')) {
|
||||
list($enabled, $params) = $DB->get_in_or_equal(explode(',', $CFG->enrol_plugins_enabled), SQL_PARAMS_NAMED, 'e00');
|
||||
list($enabled, $params) = $DB->get_in_or_equal(explode(',', $CFG->enrol_plugins_enabled), SQL_PARAMS_NAMED, 'e');
|
||||
$onecourse = "";
|
||||
if ($courseid) {
|
||||
$params['courseid'] = $courseid;
|
||||
|
@ -267,7 +267,7 @@ function enrol_meta_sync($courseid = NULL) {
|
|||
}
|
||||
$enabled[] = $DB->sql_empty(); // manual assignments are replicated too
|
||||
|
||||
list($enabled, $params) = $DB->get_in_or_equal($enabled, SQL_PARAMS_NAMED, 'e00');
|
||||
list($enabled, $params) = $DB->get_in_or_equal($enabled, SQL_PARAMS_NAMED, 'e');
|
||||
$sql = "SELECT DISTINCT pra.roleid, pra.userid, c.id AS contextid, e.id AS enrolid
|
||||
FROM {role_assignments} pra
|
||||
JOIN {user} u ON (u.id = pra.userid AND u.deleted = 0)
|
||||
|
@ -281,7 +281,7 @@ function enrol_meta_sync($courseid = NULL) {
|
|||
$params['courseid'] = $courseid;
|
||||
|
||||
if ($ignored = $meta->get_config('nosyncroleids')) {
|
||||
list($notignored, $xparams) = $DB->get_in_or_equal(explode(',', $ignored), SQL_PARAMS_NAMED, 'i00', false);
|
||||
list($notignored, $xparams) = $DB->get_in_or_equal(explode(',', $ignored), SQL_PARAMS_NAMED, 'ig', false);
|
||||
$params = array_merge($params, $xparams);
|
||||
$sql = "$sql AND pra.roleid $notignored";
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ function enrol_meta_sync($courseid = NULL) {
|
|||
// remove unwanted roles - include ignored roles and disabled plugins too
|
||||
$params = array('coursecontext' => CONTEXT_COURSE, 'courseid' => $courseid);
|
||||
if ($ignored = $meta->get_config('nosyncroleids')) {
|
||||
list($notignored, $xparams) = $DB->get_in_or_equal(explode(',', $ignored), SQL_PARAMS_NAMED, 'i00', false);
|
||||
list($notignored, $xparams) = $DB->get_in_or_equal(explode(',', $ignored), SQL_PARAMS_NAMED, 'ig', false);
|
||||
$params = array_merge($params, $xparams);
|
||||
$notignored = "AND pra.roleid $notignored";
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue