X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=deb31075c91ff622f5e3152e9f0ded0ce674a6b3;hb=330dbb3e2b34450cd1665497506455e195a0a166;hp=deca65efedc093c3e2ed0d29f96aaa426d7adca6;hpb=e01fcf1ca8ddeb72af76465df3ef72301a1cdae7;p=mailer.git diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index deca65efed..deb31075c9 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'): - $MSG .= getMessage('LOGIN_WRONG_PASS'); - break; - - case getCode('WRONG_ID'): - $MSG .= getMessage('LOGIN_WRONG_ID'); - break; +// No problems, no output by detault +$content['message'] = ''; - case getCode('ID_LOCKED'): - $MSG .= getMessage('LOGIN_ID_LOCKED'); - break; - - case getCode('ID_UNCONFIRMED'): - $MSG .= getMessage('LOGIN_ID_UNCONFIRMED'); - break; - - case getCode('NO_COOKIES'): - $MSG .= getMessage('LOGIN_NO_COOKIES'); - break; - - case getCode('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] ?>