From 5b6af116c13595ae55cda538db8869d950c7e42a Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 16 Feb 2007 01:24:30 +0000 Subject: [PATCH] fixed wrong context, it should be possible to manage a single block --- blocks/moodleblock.class.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index d37cd9ce3eb..b712e2dd467 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -303,13 +303,7 @@ class block_base { switch ($this->instance->pagetype) { case 'course-view': - if ($this->instance->pageid == SITEID) { - $context = get_context_instance(CONTEXT_SYSTEM, $this->instance->pageid); - } else { - $context = get_context_instance(CONTEXT_COURSE, $this->instance->pageid); - } - - if (!has_capability('moodle/site:manageblocks', $context)) { + if (!has_capability('moodle/site:manageblocks', $blockcontext)) { return null; } break; @@ -706,4 +700,4 @@ class block_list extends block_base { } -?> \ No newline at end of file +?>