mnet: MDL-21298 fixed a very unhelpful error message (and saved a db query)

this adds a new string for nolocaluser - nolocaluser2 (it's just nolocaluser in head)
This commit is contained in:
Penny Leach
2010-01-11 22:20:14 +00:00
parent decbf994c0
commit 8901f90395
2 changed files with 4 additions and 5 deletions
+3 -5
View File
@@ -291,18 +291,16 @@ class auth_plugin_mnet extends auth_plugin_base {
// TODO: refactor into a separate function
if (empty($localuser) || ! $localuser->id) {
if (empty($this->config->auto_add_remote_users)) {
print_error('nolocaluser', 'mnet');
print_error('nolocaluser2', 'mnet');
}
$remoteuser->mnethostid = $remotehost->id;
$remoteuser->firstaccess = time(); // First time user in this server, grab it here
if (! insert_record('user', addslashes_recursive($remoteuser))) {
if (!$remoteuser->id = insert_record('user', addslashes_recursive($remoteuser))) {
print_error('databaseerror', 'mnet');
}
$firsttime = true;
if (! $localuser = get_record('user', 'username', addslashes($remoteuser->username), 'mnethostid', $remotehost->id)) {
print_error('nolocaluser', 'mnet');
}
$localuser = $remoteuser;
}
// check sso access control list for permission first
+1
View File
@@ -216,6 +216,7 @@ $string['hostnotconfiguredforsso'] = 'This remote Moodle Hub is not configured f
$string['authmnetdisabled'] = 'Moodle Networking authentication is disabled.';
$string['unknownerror'] = 'Unknown error occurred during negotiation.';
$string['nolocaluser'] = 'No local record exists for remote user.';
$string['nolocaluser2'] = '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 <em>local</em> users\' ability to roam to other Moodle Network hosts, use the roles system to grant them the <em>mnetlogintoremote</em> 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 .';