Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'w27_MDL-34036_m23_bulkrole' of git://github.com/skodak/…

…moodle into MOODLE_23_STABLE
  • Loading branch information...
commit e570ee4b6351df2f61efdbc879b4f240bfefbcb1 2 parents 0afd953 + 5df5bcb
@danpoltawski danpoltawski authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 user/filters/courserole.php
View
15 user/filters/courserole.php
@@ -84,7 +84,7 @@ function check_data($formdata) {
function get_sql_filter($data) {
global $CFG, $DB;
static $counter = 0;
- $name = 'ex_courserole'.$counter++;
+ $pref = 'ex_courserole'.($counter++).'_';
$value = $data['value'];
$roleid = $data['roleid'];
@@ -98,17 +98,16 @@ function get_sql_filter($data) {
$where = "b.contextlevel=50";
if ($roleid) {
- $where .= " AND a.roleid = :roleid";
- $params['roleid'] = $roleid;
-
+ $where .= " AND a.roleid = :{$pref}roleid";
+ $params[$pref.'roleid'] = $roleid;
}
if ($categoryid) {
- $where .= " AND c.category = :categoryid";
- $params['categoryid'] = $categoryid;
+ $where .= " AND c.category = :{$pref}categoryid";
+ $params[$pref.'categoryid'] = $categoryid;
}
if ($value) {
- $where .= " AND c.shortname = :$name";
- $params[$name] = $value;
+ $where .= " AND c.shortname = :{$pref}course";
+ $params[$pref.'course'] = $value;
}
return array("id IN (SELECT userid
FROM {role_assignments} a
Please sign in to comment.
Something went wrong with that request. Please try again.