From: skodak Date: Fri, 10 Jul 2009 08:03:06 +0000 (+0000) Subject: MDL-19010 fixed redirect at main page if upgrade required, otherwise it would end... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=80b3328712fc79251ea3d8e63df914a34c04a838;p=moodle.git MDL-19010 fixed redirect at main page if upgrade required, otherwise it would end with exception due to DB structure changes --- diff --git a/index.php b/index.php index d6b680c2f9..0b244e0c68 100644 --- a/index.php +++ b/index.php @@ -35,8 +35,11 @@ require_once($CFG->libdir .'/filelib.php'); // check if major upgrade needed - also present in login/index.php - if (empty($CFG->version) or (int)$CFG->version < 2009011900 or !empty($CFG->adminsetuppending)) { //1.9 or older - @require_logout(); + if (empty($CFG->version) or (int)$CFG->version < 2009071000 or !empty($CFG->adminsetuppending)) { //1.9 or older + try { + @require_logout(); + } catch (Exception $e) { + } redirect("$CFG->wwwroot/$CFG->admin/"); }