From: skodak Date: Sun, 7 Oct 2007 13:46:46 +0000 (+0000) Subject: MDL-11568 prevent warning from $USER->mnehostid when not logged in X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1d19804aa311c0e43bdb350d1eed3721bec543fd;p=moodle.git MDL-11568 prevent warning from $USER->mnehostid when not logged in --- diff --git a/lib/setup.php b/lib/setup.php index d1fcc9dd50..3fd5267580 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -519,6 +519,9 @@ global $HTTPSPAGEREQUIRED; $SESSION = NULL; $USER = new object(); $USER->id = 0; // user not logged in when session disabled + if (isset($CFG->mnet_localhost_id)) { + $USER->mnethostid = $CFG->mnet_localhost_id; + } } if (defined('FULLME')) { // Usually in command-line scripts like admin/cron.php