From 0c24aa192995f4cb4f9656c22498fa427e2df5c1 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:14:59 +0000 Subject: [PATCH] accesslib:require_capability() revamp to check for USER->access $USER->capabilities is deprecated. --- lib/accesslib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index aae7e8fd9a..66b5ba5a3e 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -661,7 +661,7 @@ function require_capability($capability, $context=NULL, $userid=NULL, $doanythin /// If the current user is not logged in, then make sure they are (if needed) - if (empty($userid) and empty($USER->capabilities)) { + if (is_null($userid) && !isset($USER->access)) { if ($context && ($context->contextlevel == CONTEXT_COURSE)) { require_login($context->instanceid); } else if ($context && ($context->contextlevel == CONTEXT_MODULE)) { -- 2.39.5