X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=ca302631056a3bd4f20318ca18e2e28bf22656e0;hb=0ddf8f6c578aa2c1ff1db9fb8eb0b93a1e247b73;hp=caa950e645b78557451d185eaf89168301672848;hpb=c85ddc06cc16f2cd38ddd7d4c142a3f578bbab69;p=mailer.git diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index caa950e645..ca30263105 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -15,8 +15,6 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009, 2010 by Mailer Developer Team * @@ -41,7 +39,7 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Add description as navigation point addMenuDescription('guest', __FILE__); @@ -55,7 +53,7 @@ if ((!isExtensionActive('user')) && (!isAdmin())) { $errorCode = '0'; $userid = false; $hash = ''; -$URL = ''; +$url = ''; $add = ''; // Already logged in? @@ -74,7 +72,16 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) { } elseif (isPostRequestParameterSet('new_pass')) { // New password requested $userid = '0'; - if ((isPostRequestParameterSet('id')) && (postRequestParameter('id') > 0)) $userid = bigintval(postRequestParameter('id')); + if (isPostRequestParameterSet('id')) { + // Do we have nickname or userid? + if ((isExtensionActive('nickname')) && (isNicknameUsed(postRequestParameter('id')))) { + // Nickname entered + $userid = SQL_ESCAPE(postRequestParameter('id')); + } else { + // Direct userid entered + $userid = bigintval(postRequestParameter('id')); + } + } // END - if } else { // Not logged in $userid = '0'; $hash = ''; @@ -82,13 +89,13 @@ if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) { if (isMember()) { // Login immidiately... - $URL = 'modules.php?module=login'; + $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(postRequestParameter('id'), postRequestParameter('password')); + $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(postRequestParameter('email'), $userid); @@ -105,25 +112,18 @@ $content['message'] = ''; // Login problems? 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 .= " + // @TODO Move this HTML code into a template + $content['message'] = ' + + ' . getMessageFromErrorCode($errorCode) . ' -\n"; - $content['message'] = $message; +'; } // END - if // Display login form with resend-password form @@ -134,14 +134,14 @@ if (isExtensionActive('nickname')) { } // Was an URL constructed? -if (!empty($URL)) { +if (!empty($url)) { // URL was constructed if (ifFatalErrorsDetected()) { // Handle fatal errors runFilterChain('handle_fatal_errors'); } else { // Load URL - redirectToUrl($URL); + redirectToUrl($url); } } // END - if