Skip to content

Commit

Permalink
MDL-15883 initialise mnet from admin/index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 30, 2008
1 parent 43ec99a commit 7b3c273
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/index.php
Expand Up @@ -501,14 +501,19 @@
set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
}

/// ugly hack - if mnet is not initialised include the mnet lib, it adds needed mnet records and configures config options
/// we should not do such crazy stuff in lib functions!!!
if (empty($CFG->mnet_localhost_id)) {
require_once $CFG->dirroot.'/mnet/lib.php';
}

/// Check if the guest user exists. If not, create one.
if (!$DB->record_exists('user', array('username'=>'guest'))) {
if (! $guest = create_guest_record()) {
notify("Could not create guest user record !!!");
}
}


/// Set up the admin user
if (empty($CFG->rolesactive)) {
build_context_path(); // just in case - should not be needed
Expand Down

0 comments on commit 7b3c273

Please sign in to comment.