mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Fixed a possible notice
This commit is contained in:
parent
15a169222b
commit
bccdf22764
@ -2649,9 +2649,10 @@ function get_users_by_capability($context, $capability, $fields='', $sort='',
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$caps = role_context_capabilities($possiblerole->id, $context, $capability); // resolved list
|
||||
if ($caps[$capability] > 0) { // resolved capability > 0
|
||||
$validroleids[] = $possiblerole->id;
|
||||
if ($caps = role_context_capabilities($possiblerole->id, $context, $capability)) { // resolved list
|
||||
if (isset($caps[$capability]) && $caps[$capability] > 0) { // resolved capability > 0
|
||||
$validroleids[] = $possiblerole->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($validroleids)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user