X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=8fca859c58464bcb5f41d29c7c57a68ce4d8053f;hp=cd575419ea0ab085828403e2a57c63c62113c89d;hb=263a089d8a499e0e26d0af9e7aa7639f88b8ca60;hpb=77cdaff2afb97ed32985ced906a3a95ee078c2ef
diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php
index cd575419ea..8fca859c58 100644
--- a/inc/modules/guest/what-login.php
+++ b/inc/modules/guest/what-login.php
@@ -1,7 +1,7 @@
+if (!empty($errorCode)) {
+ // @TODO Move this HTML code into a template
+ $message = "
|
";
- switch ($ERROR) {
- case constant('CODE_WRONG_PASS'):
- $MSG .= getMessage('LOGIN_WRONG_PASS');
- break;
-
- case constant('CODE_WRONG_ID'):
- $MSG .= getMessage('LOGIN_WRONG_ID');
- break;
+ // Convert the code to message
+ $message .= getMessageFromErrorCode($errorCode);
- case constant('CODE_ID_LOCKED'):
- $MSG .= getMessage('LOGIN_ID_LOCKED');
- break;
-
- case constant('CODE_ID_UNCONFIRMED'):
- $MSG .= getMessage('LOGIN_ID_UNCONFIRMED');
- break;
-
- case constant('CODE_NO_COOKIES'):
- $MSG .= getMessage('LOGIN_NO_COOKIES');
- break;
-
- case constant('CODE_EXTENSION_PROBLEM'):
- if (IS_ADMIN()) {
- $MSG .= sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), "nickname");
- } else {
- $MSG .= getMessage('LOGIN_WRONG_ID');
- }
- break;
-
- default:
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR));
- $MSG .= getMessage('LOGIN_WRONG_ID');
- break;
- }
- $MSG .= "
+ // Continue with HTML
+ $message .= "
|
|
\n";
- define('LOGIN_FAILURE_MSG', $MSG);
-} else {
- // No problems, no output
- define('LOGIN_FAILURE_MSG', "");
-}
+ $content['message'] = $message;
+} // END - if
// Display login form with resend-password form
-if (EXT_IS_ACTIVE("nickname")) {
- LOAD_TEMPLATE("guest_nickname_login");
+if (isExtensionActive('nickname')) {
+ loadTemplate('guest_nickname_login', false, $content);
} else {
- LOAD_TEMPLATE("guest_login");
+ loadTemplate('guest_login', false, $content);
}
// Was an URL constructed?
if (!empty($URL)) {
// URL was constructed
- if (getTotalFatalErrors()) {
- // Fatal errors!
- LOAD_INC_ONCE("inc/fatal_errors.php");
+ if (getTotalFatalErrors() > 0) {
+ // Handle fatal errors
+ runFilterChain('handle_fatal_errors');
} else {
// Load URL
- LOAD_URL($URL);
+ redirectToUrl($URL);
}
} // END - if
-//
+// [EOF]
?>