fix language reference

it was the case that the language string for Exceptions was not
resolved successfully in some cases.
Now we switch to passing the internal string via Exceptions which
then will be used to translate to the correct language when needed
This commit is contained in:
2018-03-19 14:40:20 +01:00
parent d5c18c2f2e
commit facdad126b
4 changed files with 31 additions and 21 deletions

View File

@@ -172,12 +172,10 @@ class mxDatabase
*/
function addRegistration($first_name, $last_name, $username, $note, $email) {
if ($this->userPendingRegistrations($username)) {
require_once("language.php");
throw new Exception($language["USERNAME_PENDING_REGISTRATION"]." (requested)");
throw new Exception("USERNAME_PENDING_REGISTRATION");
}
if ($this->userRegistered($username)) {
require_once("language.php");
throw new Exception($language["USERNAME_REGISTERED"] . " (registered)");
throw new Exception("USERNAME_REGISTERED");
}
$verify_token = bin2hex(random_bytes(16));