X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=94904e1be4459483357de4321a660e83b2585e9a;hb=566cbcf381d60410b4c5b3a2fc4cd7bfdf49b8fc;hp=28da47741c14c6558761fe525fc839b05ba15590;hpb=f03cb5d87e69bb2efc885b5c5f5f3026b24c06f6;p=mailer.git diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 28da47741c..94904e1be4 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -1,7 +1,7 @@ 0)) $userid = bigintval(postRequestElement('id')); } else { // Not logged in - $uid = 0; $hash = ""; + $userid = '0'; $hash = ''; } -// Set unset variables -if (!REQUEST_ISSET_POST(('new_pass'))) REQUEST_SET_POST('new_pass', ""); -if (!REQUEST_ISSET_GET(('login'))) REQUEST_SET_GET('login' , ""); - -if (IS_MEMBER()) { +if (isMember()) { // Login immidiately... - $URL = "modules.php?module=login"; -} elseif ((IS_FORM_SENT()) && ("".$uid."" != "".REQUEST_POST('id')."")) { + $URL = 'modules.php?module=login'; +} elseif ((isFormSent()) && ('' . $userid . '' != '' . postRequestElement('id') . '')) { // Invalid input (no nickname extension installed but nickname entered) - $ERROR = getCode('EXTENSION_PROBLEM'); -} elseif (IS_FORM_SENT()) { + $errorCode = getCode('EXTENSION_PROBLEM'); +} elseif (isFormSent()) { // Try the login (see inc/libs/user_functions.php) - $URL = USER_DO_LOGIN(REQUEST_POST('id'), REQUEST_POST('password')); -} elseif ((REQUEST_ISSET_POST(('new_pass'))) && (isset($uid))) { + $URL = doUserLogin(postRequestElement('id'), postRequestElement('password')); +} elseif ((isPostRequestElementSet('new_pass')) && (isset($userid))) { // Try the userid/email lookup (see inc/libs/user_functions.php) - $ERROR = USER_DO_NEW_PASSWORD(REQUEST_POST('email'), $uid); + $errorCode = doNewUserPassword(postRequestElement('email'), $userid); } // Login problems? -if (REQUEST_ISSET_GET(('login'))) { +if (isGetRequestElementSet('login')) { // Use code from URL - $ERROR = REQUEST_GET(('login')); + $errorCode = getRequestElement('login'); } // END - if +// No problems, no output by detault +$content['message'] = ''; + // Login problems? -if (!empty($ERROR)) { - // Ok, which one now? +if (!empty($errorCode)) { + // @TODO Move this HTML code into a template $message = "