Browse files

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)
  • Loading branch information...
1 parent decbf99 commit 8901f90395ddc4985dbb96d5b3d1eda1facc3746 Penny Leach committed Jan 11, 2010
Showing with 4 additions and 5 deletions.
  1. +3 −5 auth/mnet/auth.php
  2. +1 −0 lang/en_utf8/mnet.php
View
8 auth/mnet/auth.php
@@ -291,18 +291,16 @@ function confirm_mnet_session($token, $remotewwwroot) {
// 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
View
1 lang/en_utf8/mnet.php
@@ -216,6 +216,7 @@
$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 .';

0 comments on commit 8901f90

Please sign in to comment.