X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=49228e9cf397cb6e8a404bc2f423a6744a2b42eb;hb=49a9663311b732d12ba0c53af2f9eb39a7850fbc;hp=25e28faeefe505b97307b5a736ca3eafb9a91903;hpb=4c83f0cc7459cad9ec9c1c68963f5365155ee935;p=mailer.git diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 25e28faeef..49228e9cf3 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; - - 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; +// No problems, no output by detault +$content['message'] = ''; - default: - DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR)); - $MSG .= getMessage('LOGIN_WRONG_ID'); - break; - } - $MSG .= " - -   -\n"; - define('LOGIN_FAILURE_MSG', $MSG); -} else { - // No problems, no output - define('LOGIN_FAILURE_MSG', ""); -} +// Login problems? +if (!empty($errorCode)) { + // Do we have a userid set? + if (isSessionVariableSet('userid')) { + // Then prefetch data for this account + fetchUserData(getSession('userid')); + } // END - if + + // @TODO Move this HTML code into a template + $content['message'] = loadTemplate('guest_login_error_message', true, $errorCode); +} // 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] ?>