X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=f45d269bced5f62349c3150e6a34dcbd66f633ca;hb=e3934352dffa6eb9da59a137ae1a9414e5b4d80b;hp=bb5750c03eb82d6291414e354715a7ba548934fb;hpb=57227d33e870ec5cd271209c4a978a52b45c2dd6;p=mailer.git diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index bb5750c03e..f45d269bce 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -15,11 +15,10 @@ * $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 * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -40,13 +39,13 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Add description as navigation point -addMenuDescription('guest', __FILE__); +addYouAreHereLink('guest', __FILE__); if ((!isExtensionActive('user')) && (!isAdmin())) { - loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('user')); + displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}'); return; } // END - if @@ -54,49 +53,62 @@ if ((!isExtensionActive('user')) && (!isAdmin())) { $errorCode = '0'; $userid = false; $hash = ''; -$URL = ''; +$url = ''; $add = ''; // Already logged in? if ((isMemberIdSet()) && (isSessionVariableSet('u_hash'))) { // Maybe, then continue with it $userid = getMemberId(); -} elseif ((isPostRequestParameterSet('id')) && (isPostRequestParameterSet('password')) && (isFormSent())) { +} elseif ((isPostRequestElementSet('id')) && (isPostRequestElementSet('password')) && (isFormSent())) { // Set userid and crypt password when login data was submitted - if ((isExtensionActive('nickname')) && (isNicknameUsed(postRequestParameter('id')))) { + if (isNicknameUsed(postRequestElement('id'))) { // Nickname entered - $userid = SQL_ESCAPE(postRequestParameter('id')); + $userid = SQL_ESCAPE(postRequestElement('id')); } else { // Direct userid entered - $userid = bigintval(postRequestParameter('id')); + $userid = bigintval(postRequestElement('id')); } -} elseif (isPostRequestParameterSet('new_pass')) { +} elseif (isPostRequestElementSet('new_pass')) { // New password requested - $userid = '0'; - if ((isPostRequestParameterSet('id')) && (postRequestParameter('id') > 0)) $userid = bigintval(postRequestParameter('id')); + $userid = NULL; + if (isPostRequestElementSet('email')) { + // Email is set + $userid = SQL_ESCAPE(postRequestElement('email')); + } elseif (isPostRequestElementSet('id')) { + // Do we have nickname or userid? + if (isNicknameUsed(postRequestElement('id'))) { + // Nickname entered + $userid = SQL_ESCAPE(postRequestElement('id')); + } else { + // Direct userid entered + $userid = bigintval(postRequestElement('id')); + } + } // END - if } else { // Not logged in - $userid = '0'; $hash = ''; + $userid = NULL; + $hash = ''; } if (isMember()) { // Login immidiately... - $URL = 'modules.php?module=login'; -} elseif ((isFormSent()) && ('' . $userid . '' != '' . postRequestParameter('id') . '')) { + $url = 'modules.php?module=login'; +} elseif ((isFormSent()) && ('' . $userid . '' != '' . postRequestElement('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')); -} elseif ((isPostRequestParameterSet('new_pass')) && (isset($userid))) { + $url = doUserLogin(postRequestElement('id'), postRequestElement('password')); +} elseif ((isPostRequestElementSet('new_pass')) && (isset($userid))) { // Try the userid/email lookup (see inc/libs/user_functions.php) - $errorCode = doNewUserPassword(postRequestParameter('email'), $userid); + $errorCode = doNewUserPassword(postRequestElement('email'), $userid); } // Login problems? -if (isGetRequestParameterSet('login')) { +if (isGetRequestElementSet('login')) { // Use code from URL - $errorCode = getRequestParameter('login'); + $errorCode = getRequestElement('login'); } // END - if // No problems, no output by detault @@ -104,27 +116,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 @@ -135,14 +138,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