Permalink
Browse files

Merge branch 'm22_MDL-31360' of git://github.com/danmarsden/moodle in…

…to MOODLE_22_STABLE
  • Loading branch information...
2 parents be15c30 + 5245393 commit 6432e1b4e199d503931f707643c2339d66547a02 @nebgor nebgor committed Feb 2, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 lib/accesslib.php
View
@@ -6380,23 +6380,22 @@ public function get_capabilities() {
}
$modfile = "$CFG->dirroot/mod/$module->name/lib.php";
+ $extracaps = array();
if (file_exists($modfile)) {
include_once($modfile);
$modfunction = $module->name.'_get_extra_capabilities';
if (function_exists($modfunction)) {
$extracaps = $modfunction();
}
}
- if (empty($extracaps)) {
- $extracaps = array();
- }
$extracaps = array_merge($subcaps, $extracaps);
-
+ $extra = '';
list($extra, $params) = $DB->get_in_or_equal(
- $extracaps, SQL_PARAMS_NAMED, 'cap0');
- $extra = "OR name $extra";
-
+ $extracaps, SQL_PARAMS_NAMED, 'cap0', true, '');
+ if (!empty($extra)) {
+ $extra = "OR name $extra";
+ }
$sql = "SELECT *
FROM {capabilities}
WHERE (contextlevel = ".CONTEXT_MODULE."

0 comments on commit 6432e1b

Please sign in to comment.