mirror of
https://github.com/moodle/moodle.git
synced 2025-05-31 13:09:25 +02:00
Make $COURSE a full object for later use
This commit is contained in:
parent
3eabd4cf97
commit
45fc1f759e
@ -1505,9 +1505,12 @@ function require_login($courseid=0, $autologinguest=true, $cm=null) {
|
||||
|
||||
global $CFG, $SESSION, $USER, $COURSE, $FULLME, $MoodleSession;
|
||||
|
||||
// Redefine global $COURSE, this is a new idea in 1.6 Beta and not to be relied on yet
|
||||
if ($courseid) {
|
||||
$COURSE->id = $courseid;
|
||||
// Redefine global $COURSE if we can
|
||||
global $course; // We use the global hack once here so it doesn't need to be used again
|
||||
if (is_object($course)) {
|
||||
$COURSE = clone($course);
|
||||
} else if ($courseid) {
|
||||
$COURSE = get_record('course', 'id', $courseid);
|
||||
}
|
||||
|
||||
// First check that the user is logged in to the site.
|
||||
|
@ -233,7 +233,7 @@ global $HTTPSPAGEREQUIRED;
|
||||
define('COURSEID', 1);
|
||||
}
|
||||
/// And the 'default' course
|
||||
$COURSE->id = SITEID; // For now. This will usually get reset later in require_login() etc.
|
||||
$COURSE = clone($SITE); // For now. This will usually get reset later in require_login() etc.
|
||||
|
||||
|
||||
/// Set a default enrolment configuration (see bug 1598)
|
||||
|
Loading…
x
Reference in New Issue
Block a user