From 7b3c273b1d1cb5124de30506278c0acee1dd282d Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 30 Jul 2008 09:10:02 +0000 Subject: [PATCH] MDL-15883 initialise mnet from admin/index.php --- admin/index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/admin/index.php b/admin/index.php index 1cc36e72e8..13ab66473a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -501,6 +501,12 @@ 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()) { @@ -508,7 +514,6 @@ } } - /// Set up the admin user if (empty($CFG->rolesactive)) { build_context_path(); // just in case - should not be needed -- 2.39.5