X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=15863bb1f96a6cef28bd294766a9fba2cfcc65a0;hb=8d2c9b91eb82ea74fac58b2541982f760d0f77fc;hp=0c942a81ee5558fcea3461e88ba57e6caa934fb2;hpb=21a24662ddc70624c27c607e3904aab23e893898;p=mailer.git
diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php
index 0c942a81ee..15863bb1f9 100644
--- a/inc/modules/guest/what-login.php
+++ b/inc/modules/guest/what-login.php
@@ -1,7 +1,7 @@
-
|
-
- ";
-
- switch ($ERROR) {
- case constant('CODE_WRONG_PASS'):
- $MSG .= getMessage('LOGIN_WRONG_PASS');
- break;
-
- case constant('CODE_WRONG_ID'):
- $MSG .= getMessage('LOGIN_WRONG_ID');
- break;
+// No problems, no output by detault
+$content['message'] = '';
- 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 .= "
+// 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', $MSG);
-} 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]
?>