Permalink
Browse files

mnet: MDL-20059 fix up login/mnet_email.php in a few places

Merged (belatedly from HEAD)
  • Loading branch information...
1 parent 3022e49 commit 1ddd8283f94d2644d9eee0015da7944e1f9b1e6f Penny Leach committed Jan 13, 2010
Showing with 7 additions and 1 deletion.
  1. +2 −0 lang/en_utf8/mnet.php
  2. +5 −1 login/mnet_email.php
View
@@ -242,6 +242,8 @@
$string['loginlinkmnetuser'] = '<br />If you are a Moodle Network remote user and can <a href=\"$a\">confirm your email address here</a>, you can be redirected to your login page.<br />';
$string['mnetidprovider'] = 'MNET ID Provider';
$string['mnetidprovidermsg'] = 'You should be able to login at your $a provider.';
+$string['mnetidproviderdesc'] = 'You can use this facility to retrieve a link that you can log in at, if you can provide the correct email address to match the username you previously tried to log in with.';
+$string['mnetidprovidernotfound'] = 'Sorry, but no further information could be found.';
$string['findlogin'] = 'Find Login';
$string['error7020'] = 'This error normally occurs if the remote site has created a record for you with the wrong wwwroot, for example, http://yoursite.com instead of http://www.yoursite.com. You should contact the administrator of the remote site with your wwwroot (as specified in config.php) asking her to update her record for your host.';
View
@@ -14,14 +14,18 @@
$navigation = build_navigation(array(array('name' => $mnetidprovider, 'link' => null, 'type' => 'misc')));
print_header($mnetidprovider, $mnetidprovider, $navigation, 'form.email' );
+notify(get_string('mnetidproviderdesc', 'mnet'));
if ($form = data_submitted() and confirm_sesskey()) {
- if ($user = get_record('user', 'username', $username, 'email', $form->email)) {
+ if ($user = get_record_select('user', "username = '$username' AND email = '$form->email' AND mnethostid != $CFG->mnet_localhost_id")) {
if (!empty($user->mnethostid) and $host = get_record('mnet_host', 'id', $user->mnethostid)) {
$link = "<a href=\"{$host->wwwroot}/login/\">{$host->name}</a>";
notice(get_string('mnetidprovidermsg','mnet',$link));
}
}
+ if (empty($link)) {
+ notice(get_string('mnetidprovidernotfound', 'mnet'));
+ }
}
echo '<p>&nbsp;</p>';

0 comments on commit 1ddd828

Please sign in to comment.