* If $SITE global from {@link get_site()} is set then SITEID to $SITE->id, otherwise set to 1.
*/
define('SITEID', $SITE->id);
- define('COURSEID', SITEID); // For now. This will usually get reset later in require_login() etc.
} else {
/**
* @ignore
define('COURSEID', 1);
}
+$COURSE->id = SITEID; // For now. This will usually get reset later in require_login() etc.
+
/// FUNCTIONS FOR DATABASE HANDLING ////////////////////////////////
/**
* @uses $USER
* @uses $FULLME
* @uses SITEID
- * @uses COURSEID
+ * @uses $COURSE
* @uses $MoodleSession
* @param int $courseid id of the course
* @param bool $autologinguest
*/
function require_login($courseid=0, $autologinguest=true, $cm=null) {
- global $CFG, $SESSION, $USER, $FULLME, $MoodleSession;
+ global $CFG, $SESSION, $USER, $COURSE, $FULLME, $MoodleSession;
- // Redefine global COURSEID, this is a new idea in 1.6 Beta and not to be relied on yet
+ // Redefine global $COURSE, this is a new idea in 1.6 Beta and not to be relied on yet
if ($courseid) {
- define('COURSEID', $courseid);
+ $COURSE->id = $courseid;
}
// First check that the user is logged in to the site.