SITE and SITEID were calculated *before* 'set names' so they weren't

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-)
This commit is contained in:
stronk7
2006-03-29 23:38:46 +00:00
parent dfa76a46e3
commit 475e9de86f
2 changed files with 17 additions and 14 deletions
-14
View File
@@ -15,20 +15,6 @@
/// 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 ////////////////////////////////
+17
View File
@@ -216,6 +216,23 @@ global $HTTPSPAGEREQUIRED;
/// 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';