X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=b3e272c6c57a42851b016cc1ce1bcca3f5351138;hp=901f7b8c69dfadb4dd53372f62ab0634abd85b58;hb=0715fa7aa8e5e70bcf1d957fb09ae655c3896c4e;hpb=9afd6ec5878544a7982c50ed9c0dd7de37606d5b diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 901f7b8c69..b3e272c6c5 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -1,7 +1,7 @@ 0)) $userid = bigintval(postRequestParameter('id')); } else { // Not logged in $userid = '0'; $hash = ''; @@ -81,22 +82,22 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) { if (isMember()) { // Login immidiately... - $URL = 'modules.php?module=login'; -} elseif ((isFormSent()) && ('' . $userid . '' != '' . postRequestElement('id') . '')) { + $url = 'modules.php?module=login'; +} elseif ((isFormSent()) && ('' . $userid . '' != '' . postRequestParameter('id') . '')) { // Invalid input (no nickname extension installed but nickname entered) $errorCode = getCode('EXTENSION_PROBLEM'); } elseif (isFormSent()) { // Try the login (see inc/libs/user_functions.php) - $URL = doUserLogin(postRequestElement('id'), postRequestElement('password')); -} elseif ((isPostRequestElementSet('new_pass')) && (isset($userid))) { + $url = doUserLogin(postRequestParameter('id'), postRequestParameter('password')); +} elseif ((isPostRequestParameterSet('new_pass')) && (isset($userid))) { // Try the userid/email lookup (see inc/libs/user_functions.php) - $errorCode = doNewUserPassword(postRequestElement('email'), $userid); + $errorCode = doNewUserPassword(postRequestParameter('email'), $userid); } // Login problems? -if (isGetRequestElementSet('login')) { +if (isGetRequestParameterSet('login')) { // Use code from URL - $errorCode = getRequestElement('login'); + $errorCode = getRequestParameter('login'); } // END - if // No problems, no output by detault @@ -106,17 +107,21 @@ $content['message'] = ''; if (!empty($errorCode)) { // @TODO Move this HTML code into a template $message = " -   - + "; + // Do we have a userid set? + if (isSessionVariableSet('current_userid')) { + // Then prefetch data for this account + fetchUserData(getSession('current_userid')); + } // END - if + // Convert the code to message $message .= getMessageFromErrorCode($errorCode); // Continue with HTML $message .= " -   \n"; $content['message'] = $message; } // END - if @@ -129,14 +134,14 @@ if (isExtensionActive('nickname')) { } // Was an URL constructed? -if (!empty($URL)) { +if (!empty($url)) { // URL was constructed - if (getTotalFatalErrors() > 0) { + if (ifFatalErrorsDetected()) { // Handle fatal errors runFilterChain('handle_fatal_errors'); } else { // Load URL - redirectToUrl($URL); + redirectToUrl($url); } } // END - if