diff --git a/lang/en_utf8/mnet.php b/lang/en_utf8/mnet.php
index 37829e0b7e2..a25f9babea8 100644
--- a/lang/en_utf8/mnet.php
+++ b/lang/en_utf8/mnet.php
@@ -226,4 +226,6 @@ $string['enrolcourseenrol_desc'] = 'Enrol/unenrol users from this course using M
methods if the remote hosts allows them. Such enrolments are listed under
Other enrolled users';
$string['host'] = 'host';
+$string['loginlinkmnetuser'] = '
If you are a Moodle Network remote user and can confirm your email address here, you can be redirected to your login page.
';
+
?>
diff --git a/login/index.php b/login/index.php
index 51189407942..7399e8e7163 100644
--- a/login/index.php
+++ b/login/index.php
@@ -226,8 +226,9 @@ if ($authsequence[0] == 'cas' and !empty($CFG->cas_enabled)) {
}
// TODO: if the user failed to authenticate, check if the username corresponds to a remote mnet user
- if ($users = get_records('user', 'username', $frm->username)) {
- $errormsg .= "
If you are a Moodle Network remote user and can username\">confirm your email address here, you can be redirected to your login page.
";
+ if ( $CFG->mnet_dispatcher_mode === 'strict'
+ && is_enabled_auth('mnet')) {
+ $errormsg .= get_string('loginlinkmnetuser', 'mnet', "mnet_email.php?u=$frm->username");
}
}
}