From: moodler Date: Fri, 15 Sep 2006 13:42:40 +0000 (+0000) Subject: Fixed some SQL error X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=405f64c7fde7c67786484ac1bdea9b0ec86a56bd;p=moodle.git Fixed some SQL error --- diff --git a/lib/accesslib.php b/lib/accesslib.php index cf42c8142c..0986592dfa 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2312,12 +2312,14 @@ function get_users_by_capability($context, $capability, $fields='u.*, ul.timeacc /// sorting out exceptions if ($exceptions) { $exceptionsql = "AND u.id NOT IN ($exceptions)"; + } else { + $exceptionsql = ''; } - /// if context is a course, then constrct sql for ul + /// if context is a course, then construct sql for ul if ($context->aggregatelevel == CONTEXT_COURSE) { $courseid = $context->instanceid; - $coursesql = "AND (ul.courseid = $courseid OR ISNULL(ul.courseid)"; + $coursesql = "AND (ul.courseid = $courseid OR ISNULL(ul.courseid))"; } /// sorting out roles with this capability set