Skip to content

Commit

Permalink
Merge branch 'wip-MDL-27767-m20' of git://github.com/samhemelryk/mood…
Browse files Browse the repository at this point in the history
…le into MOODLE_20_STABLE
  • Loading branch information
stronk7 committed Dec 14, 2011
2 parents 7e01298 + 6def225 commit 2ef91b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/db/install.php
Expand Up @@ -27,7 +27,7 @@
defined('MOODLE_INTERNAL') || die();

function xmldb_main_install() {
global $CFG, $DB, $SITE;
global $CFG, $DB, $SITE, $OUTPUT;

/// make sure system context exists
$syscontext = get_system_context(false);
Expand Down Expand Up @@ -152,7 +152,7 @@ function xmldb_main_install() {
$guest->timemodified= time();
$guest->id = $DB->insert_record('user', $guest);
if ($guest->id != 1) {
throw new moodle_exception('generalexceptionmessage', 'error', '', 'Unexpected new guest user id!');
echo $OUTPUT->notification('Unexpected id generated for the Guest account. Your database configuration or clustering setup may not be fully supported', 'notifyproblem');
}
// Store guest id
set_config('siteguest', $guest->id);
Expand All @@ -173,9 +173,14 @@ function xmldb_main_install() {
$admin->timemodified = time();
$admin->lastip = CLI_SCRIPT ? '0.0.0.0' : getremoteaddr(); // installation hijacking prevention
$admin->id = $DB->insert_record('user', $admin);

if ($admin->id != 2) {
throw new moodle_exception('generalexceptionmessage', 'error', '', 'Unexpected new admin user id!');
echo $OUTPUT->notification('Unexpected id generated for the Admin account. Your database configuration or clustering setup may not be fully supported', 'notifyproblem');
}
if ($admin->id != ($guest->id + 1)) {
echo $OUTPUT->notification('Nonconsecutive id generated for the Admin account. Your database configuration or clustering setup may not be fully supported.', 'notifyproblem');
}

/// Store list of admins
set_config('siteadmins', $admin->id);

Expand Down

0 comments on commit 2ef91b5

Please sign in to comment.