fetched properly from DB. Moving such block of code from datalib.php
to setup.php to execute it *after* 'set names'. Credit goes to Skodak B-)
/// GLOBAL CONSTANTS /////////////////////////////////////////////////////////
-if ($SITE = get_site()) {
- /**
- * If $SITE global from {@link get_site()} is set then SITEID to $SITE->id, otherwise set to 1.
- */
- define('SITEID', $SITE->id);
-} else {
- /**
- * @ignore
- */
- define('SITEID', 1);
- define('COURSEID', 1);
-}
-
-$COURSE->id = SITEID; // For now. This will usually get reset later in require_login() etc.
/// FUNCTIONS FOR DATABASE HANDLING ////////////////////////////////
/// work with the DB, but never before this!
+//// Defining the site
+ if ($SITE = get_site()) {
+ /**
+ * If $SITE global from {@link get_site()} is set then SITEID to $SITE->id, otherwise set to 1.
+ */
+ define('SITEID', $SITE->id);
+ } else {
+ /**
+ * @ignore
+ */
+ define('SITEID', 1);
+ define('COURSEID', 1);
+ }
+/// And the 'default' course
+ $COURSE->id = SITEID; // For now. This will usually get reset later in require_login() etc.
+
+
/// Set a default enrolment configuration (see bug 1598)
if (!isset($CFG->enrol)) {
$CFG->enrol = 'manual';