From c8ae55e9201d447a24fa6dc024a48ad7671fcc1d Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 18 Sep 2010 22:54:46 +0000 Subject: [PATCH] MDL-24277 allow changing of username during install --- admin/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index 37985c77c4e..aa95edb87c0 100644 --- a/admin/index.php +++ b/admin/index.php @@ -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