mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-47754 install: fix redirect loop
This commit is contained in:
parent
b49de5d930
commit
f1cac3d515
@ -41,6 +41,9 @@ $PAGE->set_url('/user/editadvanced.php', array('course' => $course, 'id' => $id)
|
||||
$course = $DB->get_record('course', array('id' => $course), '*', MUST_EXIST);
|
||||
|
||||
if (!empty($USER->newadminuser)) {
|
||||
// Ignore double clicks, we must finish all operations before cancelling request.
|
||||
ignore_user_abort(true);
|
||||
|
||||
$PAGE->set_course($SITE);
|
||||
$PAGE->set_pagelayout('maintenance');
|
||||
} else {
|
||||
@ -274,9 +277,14 @@ if ($usernew = $userform->get_data()) {
|
||||
if (!empty($USER->newadminuser)) {
|
||||
unset($USER->newadminuser);
|
||||
// Apply defaults again - some of them might depend on admin user info, backup, roles, etc.
|
||||
admin_apply_default_settings(null , false);
|
||||
admin_apply_default_settings(null, false);
|
||||
// Admin account is fully configured - set flag here in case the redirect does not work.
|
||||
unset_config('adminsetuppending');
|
||||
// Redirect to admin/ to continue with installation.
|
||||
redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
} else if (empty($SITE->fullname)) {
|
||||
// Somebody double clicked when editing admin user during install.
|
||||
redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
} else {
|
||||
redirect("$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user