X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=15863bb1f96a6cef28bd294766a9fba2cfcc65a0;hb=8d2c9b91eb82ea74fac58b2541982f760d0f77fc;hp=28da47741c14c6558761fe525fc839b05ba15590;hpb=81a23e7474067304f572fb9f61cc069eb4952b0e;p=mailer.git
diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php
index 28da47741c..15863bb1f9 100644
--- a/inc/modules/guest/what-login.php
+++ b/inc/modules/guest/what-login.php
@@ -1,7 +1,7 @@
-
|
-
- ";
-
- switch ($ERROR) {
- case getCode('WRONG_PASS'):
- $message .= getMessage('LOGIN_WRONG_PASS');
- break;
-
- case getCode('WRONG_ID'):
- $message .= getMessage('LOGIN_WRONG_ID');
- break;
+// No problems, no output by detault
+$content['message'] = '';
- case getCode('ID_LOCKED'):
- $message .= getMessage('LOGIN_ID_LOCKED');
- break;
-
- case getCode('ID_UNCONFIRMED'):
- $message .= getMessage('LOGIN_ID_UNCONFIRMED');
- break;
-
- case getCode('NO_COOKIES'):
- $message .= getMessage('LOGIN_NO_COOKIES');
- break;
-
- case getCode('EXTENSION_PROBLEM'):
- if (IS_ADMIN()) {
- $message .= sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), "nickname");
- } else {
- $message .= getMessage('LOGIN_WRONG_ID');
- }
- break;
-
- default:
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR));
- $message .= getMessage('LOGIN_WRONG_ID');
- break;
- }
- $message .= "
+// Login problems?
+if (!empty($errorCode)) {
+ // Do we have a userid set?
+ if (isSessionVariableSet('current_userid')) {
+ // Then prefetch data for this account
+ fetchUserData(getSession('current_userid'));
+ } // END - if
+
+ // @TODO Move this HTML code into a template
+ $content['message'] = ' |
+
+ ' . getMessageFromErrorCode($errorCode) . '
|
- |
-
\n";
- define('LOGIN_FAILURE_MSG', $message);
-} else {
- // No problems, no output
- define('LOGIN_FAILURE_MSG', "");
-}
+';
+} // 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)) {
+if (!empty($url)) {
// URL was constructed
- if (getTotalFatalErrors()) {
- // Fatal errors!
- LOAD_INC_ONCE("inc/fatal_errors.php");
+ if (ifFatalErrorsDetected()) {
+ // Handle fatal errors
+ runFilterChain('handle_fatal_errors');
} else {
// Load URL
- LOAD_URL($URL);
+ redirectToUrl($url);
}
} // END - if
-//
+// [EOF]
?>