From 2b531945737f40e34f10e3ff8b6f29019eb5e157 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 31 Aug 2006 16:01:41 +0000 Subject: [PATCH] fixed riskbitmask problems, sorry :-( --- lib/accesslib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index e9226b3c57..b2db35c2e1 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1246,7 +1246,7 @@ function update_capabilities($component='moodle') { // update risk bitmasks in existing capabilitites if needed if (array_key_exists($cachedcap->name, $filecaps)) { if (!array_key_exists('riskbitmask', $filecaps[$cachedcap->name])) { - $filecaps[$cachedcap->name]['riskbitmask'] = 0; // no risk by default + $filecaps[$cachedcap->name]['riskbitmask'] = 0; // no risk if not specified } if ($cachedcap->riskbitmask != $filecaps[$cachedcap->name]['riskbitmask']) { $updatecap = new object; @@ -1266,6 +1266,9 @@ function update_capabilities($component='moodle') { foreach ($filecaps as $filecap => $def) { if (!$storedcaps || ($storedcaps && in_array($filecap, $storedcaps) === false)) { + if (!array_key_exists('riskbitmask', $def)) { + $def['riskbitmask'] = 0; // no risk if not specified + } $newcaps[$filecap] = $def; } } -- 2.39.5