Permalink
Browse files

MDL-31534 init PAGE before require_login()

  • Loading branch information...
skodak committed Mar 12, 2012
1 parent 5f51b09 commit c81e5bc9cc02c310cee0df08a3fe0dd4bd5d98dc
Showing with 7 additions and 7 deletions.
  1. +7 −7 index.php
View
@@ -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();

0 comments on commit c81e5bc

Please sign in to comment.