Fixed a possible notice

This commit is contained in:
moodler 2006-09-27 08:01:22 +00:00
parent 15a169222b
commit bccdf22764

View File

@ -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)) {