MDL-11568 prevent warning from $USER->mnehostid when not logged in

This commit is contained in:
skodak 2007-10-07 13:46:46 +00:00
parent 8ce8fc85fc
commit 1d19804aa3

View File

@ -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