Fix backup & restore errors with temporary users
authorDavo Smith <git@davosmith.co.uk>
Mon, 13 Jul 2015 10:51:47 +0000 (11:51 +0100)
committerDavo Smith <git@davosmith.co.uk>
Mon, 13 Jul 2015 10:52:12 +0000 (11:52 +0100)
tempusers.php

index df1733f..8fc2a3d 100644 (file)
@@ -64,6 +64,7 @@ if ($data = $mform->get_data()) {
     $user->email = time().'@ghost.user.de';
     $user->username = time().'@ghost.user.de';
     $user->idnumber = 'tempghost';
+    $user->mnethostid = $CFG->mnet_localhost_id;
     $studentid = $DB->insert_record('user', $user);
 
     // Create the temporary user record.