diff --git a/langs/en/login.json b/langs/en/login.json index b6adfed..b4d14ba 100644 --- a/langs/en/login.json +++ b/langs/en/login.json @@ -17,7 +17,6 @@ "2fa prompt": "Enter the six-digit code from your mobile authenticator app.", "2fa incorrect": "Authentication code incorrect.", "login incorrect": "Login incorrect.", - "login server unavailable": "Login server unavailable. Try again later or contact technical support.", "account locked": "This account has been disabled. Contact technical support.", "password expired": "You must change your password before continuing.", "account terminated": "Account terminated. Access denied.", diff --git a/lib/User.lib.php b/lib/User.lib.php index 7f7d4c8..2cc017d 100644 --- a/lib/User.lib.php +++ b/lib/User.lib.php @@ -162,7 +162,7 @@ class User { return true; } - + function check2fa(string $code): bool { if (!$this->has2fa) { return true; @@ -237,10 +237,10 @@ class User { if (is_null($appname)) { $appname = $SETTINGS['site_title']; } - if (empty(ADMIN_EMAIL) || filter_var(ADMIN_EMAIL, FILTER_VALIDATE_EMAIL) === FALSE) { + if (empty($SETTINGS["email"]["admin_email"]) || filter_var($SETTINGS["email"]["admin_email"], FILTER_VALIDATE_EMAIL) === FALSE) { return "invalid_to_email"; } - if (empty(FROM_EMAIL) || filter_var(FROM_EMAIL, FILTER_VALIDATE_EMAIL) === FALSE) { + if (empty($SETTINGS["email"]["from"]) || filter_var($SETTINGS["email"]["from"], FILTER_VALIDATE_EMAIL) === FALSE) { return "invalid_from_email"; } @@ -269,8 +269,8 @@ class User { } } - $mail->setFrom(FROM_EMAIL, 'Account Alerts'); - $mail->addAddress(ADMIN_EMAIL, "System Admin"); + $mail->setFrom($SETTINGS["email"]["from"], 'Account Alerts'); + $mail->addAddress($SETTINGS["email"]["admin_email"], "System Admin"); $mail->isHTML(false); $mail->Subject = $Strings->get("admin alert email subject", false); $mail->Body = $Strings->build("admin alert email message", ["username" => $this->username, "datetime" => date("Y-m-d H:i:s"), "ipaddr" => IPUtils::getClientIP(), "appname" => $appname], false);