replace all uses of isset($USER->id) with empty() to allow proper operation of $CFG->notloggedinroleid hack