mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
upgrade: MDL-19763 Improve the redirect that forces a DB upgrade when there are major changes
Also fix redirect, so 303 redirects don't need to fully initialise $OUTPUT.
This commit is contained in:
parent
8dff48bf45
commit
5e39d7aa09
5 changed files with 55 additions and 31 deletions
|
@ -34,14 +34,7 @@
|
|||
require_once($CFG->dirroot .'/course/lib.php');
|
||||
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 < 2009071000 or !empty($CFG->adminsetuppending)) { //1.9 or older
|
||||
try {
|
||||
@require_logout();
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
redirect_if_major_upgrade_required();
|
||||
|
||||
if ($CFG->forcelogin) {
|
||||
require_login();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue