]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15883 initialise mnet from admin/index.php
authorskodak <skodak>
Wed, 30 Jul 2008 09:10:02 +0000 (09:10 +0000)
committerskodak <skodak>
Wed, 30 Jul 2008 09:10:02 +0000 (09:10 +0000)
admin/index.php

index 1cc36e72e840891511b6b96f5740811b2efda08a..13ab66473a56bd1dfff0a896735d2d355ff68b0e 100644 (file)
         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()) {
         }
     }
 
-
 /// Set up the admin user
     if (empty($CFG->rolesactive)) {
         build_context_path(); // just in case - should not be needed