MDL-31607 use full course object for require_login() if already available

This eliminates 1 db query.
This commit is contained in:
Petr Skoda
2012-04-22 17:41:47 +02:00
parent ead4f180a0
commit cdbea7eed1
85 changed files with 88 additions and 88 deletions
+1 -1
View File
@@ -60,7 +60,7 @@
if (is_array($aroles) && isset($aroles[$switchrole])) {
role_switch($switchrole, $context);
// Double check that this role is allowed here
require_login($course->id);
require_login($course);
}
// reset course page state - this prevents some weird problems ;-)
$USER->activitycopy = false;