From c81e5bc9cc02c310cee0df08a3fe0dd4bd5d98dc Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 12 Mar 2012 13:58:01 +0100 Subject: [PATCH] MDL-31534 init PAGE before require_login() --- index.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index 99bae5f6d3c..cae43f9ddca 100644 --- a/index.php +++ b/index.php @@ -34,6 +34,13 @@ redirect_if_major_upgrade_required(); + $urlparams = array(); + if ($CFG->defaulthomepage == HOMEPAGE_MY && optional_param('redirect', 1, PARAM_BOOL) === 0) { + $urlparams['redirect'] = 0; + } + $PAGE->set_url('/', $urlparams); + $PAGE->set_course($SITE); + if ($CFG->forcelogin) { require_login(); } else { @@ -42,13 +49,6 @@ $hassiteconfig = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); - $urlparams = array(); - if ($CFG->defaulthomepage == HOMEPAGE_MY && optional_param('redirect', 1, PARAM_BOOL) === 0) { - $urlparams['redirect'] = 0; - } - $PAGE->set_url('/', $urlparams); - $PAGE->set_course($SITE); - /// If the site is currently under maintenance, then print a message if (!empty($CFG->maintenance_enabled) and !$hassiteconfig) { print_maintenance_message();