(keeping the site URL stored in the USER session object) but forgot
to add this to the brand new admin user - causing it to fail.
Fixed.
$user->firstname = "Admin";
$user->lastname = "User";
$user->username = "admin";
- $user->password = "";
+ $user->password = md5("admin");
$user->email = "root@localhost";
$user->confirmed = 1;
$user->maildisplay = 1;
$USER = $user;
$USER->loggedin = true;
+ $USER->site = $CFG->wwwroot;
$USER->admin = true;
$USER->teacher["$site->id"] = true;
save_session("USER");