]> git.mjollnir.org Git - moodle.git/commitdiff
mnet: MDL-20059 fix up login/mnet_email.php in a few places
authorPenny Leach <penny@liip.ch>
Mon, 11 Jan 2010 22:34:02 +0000 (22:34 +0000)
committerPenny Leach <penny@liip.ch>
Mon, 11 Jan 2010 22:34:02 +0000 (22:34 +0000)
lang/en_utf8/mnet.php
login/mnet_email.php

index b1824dc1b83e139efd172afc6bd3d3013c3308f9..ec8751b66697efe40f665fc9919643403276d0cb 100644 (file)
@@ -243,6 +243,8 @@ $string['loginlinkmnetuser'] = '<br />If you are a Moodle Network remote user an
 $string['certdetails'] = 'Cert Details';
 $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.';
index 5ba65057a193ee504c105f6cb614bca296506237..76bff2f41457b67550c1ce739c596565254f95a9 100644 (file)
@@ -20,14 +20,18 @@ $PAGE->set_heading($mnetidprovider);
 $PAGE->set_focuscontrol('email');
 
 echo $OUTPUT->header();
+echo $OUTPUT->notification(get_string('mnetidproviderdesc', 'mnet'));
 
 if ($form = data_submitted() and confirm_sesskey()) {
-    if ($user = $DB->get_record('user', array('username'=>$username, 'email'=>$form->email))) {
+    if ($user = $DB->get_record_select('user', 'username = ? AND email = ? AND mnethostid != ?', array($username,$form->email, $CFG->mnet_localhost_id))) {
         if (!empty($user->mnethostid) and $host = $DB->get_record('mnet_host', array('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>';