MDL-24277 allow changing of username during install

This commit is contained in:
Petr Skoda
2010-09-18 22:54:46 +00:00
parent 209e00185b
commit c8ae55e920
+3 -2
View File
@@ -293,7 +293,7 @@ if (moodle_needs_upgrading()) {
if (during_initial_install()) {
set_config('rolesactive', 1); // after this, during_initial_install will return false.
set_config('adminsetuppending', 1);
// we neeed this redirect to setup proper session
// we need this redirect to setup proper session
upgrade_finished("index.php?sessionstarted=1&lang=$CFG->lang");
}
@@ -316,7 +316,8 @@ if (during_initial_install()) {
}
}
$adminuser = get_complete_user_data('username', 'admin');
// at this stage there can be only one admin - users may change username, so do not rely on that
$adminuser = get_complete_user_data('id', $CFG->siteadmins);
if ($adminuser->password === 'adminsetuppending') {
// prevent installation hijacking