diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index ab077213b4f..84240166a63 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -296,11 +296,9 @@ class auth_plugin_mnet extends auth_plugin_base { } $remoteuser->mnethostid = $remotehost->id; $remoteuser->firstaccess = time(); // First time user in this server, grab it here - $DB->insert_record('user', $remoteuser); + $remoteuser->id = $DB->insert_record('user', $remoteuser); $firsttime = true; - if (! $localuser = $DB->get_record('user', array('username'=>$remoteuser->username, 'mnethostid'=>$remotehost->id))) { - print_error('nolocaluser', 'mnet'); - } + $localuser = $remoteuser; } // check sso access control list for permission first diff --git a/lang/en_utf8/mnet.php b/lang/en_utf8/mnet.php index 4fb35a5f81a..b1824dc1b83 100644 --- a/lang/en_utf8/mnet.php +++ b/lang/en_utf8/mnet.php @@ -216,7 +216,7 @@ $string['authfail_usermismatch'] = 'Authorisation failed: the user does not matc $string['hostnotconfiguredforsso'] = 'This remote Moodle Hub is not configured for remote login.'; $string['authmnetdisabled'] = 'Moodle Networking authentication is disabled.'; $string['unknownerror'] = 'Unknown error occurred during negotiation.'; -$string['nolocaluser'] = 'No local record exists for remote user.'; +$string['nolocaluser'] = 'No local record exists for remote user, and it could not be created, as this host will not auto create users. Please contact your administrator!'; $string['databaseerror'] = 'Could not write details to the database.'; $string['ssoacldescr'] = 'Use this page to grant/deny access to specific users from remote Moodle Network hosts. This is functional when you are offering SSO services to remote users. To control your local users\' ability to roam to other Moodle Network hosts, use the roles system to grant them the mnetlogintoremote capability.'; $string['ssoaclneeds'] = 'For this functionality to work, you must have Moodle Networking On, plus the Moodle Network authentication plugin enabled with auto-add users enabled .';