Fixed warning

This commit is contained in:
vyshane 2006-09-05 03:07:56 +00:00
parent c572cc4dc6
commit 4729012f4c

View file

@ -1592,9 +1592,9 @@ function role_context_capabilities($roleid, $context, $cap='') {
and rc.contextid = c.id $search and rc.contextid = c.id $search
ORDER BY c.aggregatelevel DESC, rc.capability DESC"; ORDER BY c.aggregatelevel DESC, rc.capability DESC";
$records = get_records_sql($SQL);
$capabilities = array(); $capabilities = array();
if ($records = get_records_sql($SQL)) {
// We are traversing via reverse order. // We are traversing via reverse order.
foreach ($records as $record) { foreach ($records as $record) {
// If not set yet (i.e. inherit or not set at all), or currently we have a prohibit // If not set yet (i.e. inherit or not set at all), or currently we have a prohibit
@ -1602,6 +1602,7 @@ function role_context_capabilities($roleid, $context, $cap='') {
$capabilities[$record->capability] = $record->permission; $capabilities[$record->capability] = $record->permission;
} }
} }
}
return $capabilities; return $capabilities;
} }