Commit c817c625 authored by Francois Marier's avatar Francois Marier
Browse files

auth/browserid: create langstrings for all exceptions (bug #931399)



Change-Id: I4950f3ffc24d8839920c7c999cbe650ff0885959
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent 6d0ad109
......@@ -31,3 +31,8 @@ $string['badassertion'] = 'The given BrowserID assertion is not valid: %s';
$string['badverification'] = 'Mahara did not receive valid JSON output from the BrowserID verifier.';
$string['login'] = 'BrowserID Login';
$string['missingassertion'] = 'BrowserID did not return an alpha-numeric assertion.';
$string['emailalreadyclaimed'] = "Another user account has already claimed the email address '%s'.";
$string['emailclaimedasusername'] = "Another user account has already claimed the email address '%s' as a username.";
$string['browseridnotenabled'] = "The BrowserID authentication plugin is not enabled in any active institution.";
$string['emailnotfound'] = "A user account with an email address of '%s' was not found in any of the institutions where BrowserID is enabled.";
......@@ -58,11 +58,11 @@ class AuthBrowserid extends Auth {
}
if (record_exists('artefact_internal_profile_email', 'email', $email)) {
throw new AccountAutoCreationException("Another user account has already claimed the email address '$email'.");
throw new AccountAutoCreationException(get_string('emailalreadyclaimed', 'auth.browserid', $email));
}
if (record_exists('usr', 'username', $email)) {
throw new AccountAutoCreationException("Another user account has already claimed the email address '$email' as a username.");
throw new AccountAutoCreationException(get_string('emailclaimedasusername', 'auth.browserid', $email));
}
// Personal details are currently not provided by the BrowserID API.
......@@ -270,7 +270,7 @@ class BrowserIDUser extends LiveUser {
i.suspended = 0";
$authinstances = get_records_sql_array($sql, null);
if (!$authinstances) {
throw new ConfigException('The BrowserID authentication plugin is not enabled in any active institution.');
throw new ConfigException(get_string('browseridnotenabled', 'auth.browserid'));
}
foreach ($authinstances as $authinstance) {
......@@ -322,7 +322,7 @@ class BrowserIDUser extends LiveUser {
$this->authenticate($user, $auth->instanceid);
}
else {
throw new AuthUnknownUserException("A user account with an email address of '$email' was not found in any of the institutions where BrowserID is enabled.");
throw new AuthUnknownUserException(get_string('emailnotfound', 'auth.browserid', $email));
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment