Merge branch 'w49_MDL-37060_m25_sessinit' of git://github.com/skodak/moodle

This commit is contained in:
Sam Hemelryk 2012-12-11 15:27:26 +13:00
commit 7a6ef4ee8f

View File

@ -41,13 +41,13 @@ function session_get_instance() {
static $session = null;
if (!defined('NO_MOODLE_COOKIES')) {
// Moodle session was not initialised yet in lib/setup.php.
$session = new emergency_session();
return $session;
}
if (is_null($session)) {
if (!defined('NO_MOODLE_COOKIES') or empty($DB)) {
// Moodle was not initialised properly in lib/setup.php.
$session = new emergency_session();
return $session;
}
if (empty($CFG->sessiontimeout)) {
$CFG->sessiontimeout = 7200;
}