X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-login.php;h=b8bc4b148bec3b39d90ddf3945674250ef30ff7a;hb=5e4fd904c6045b66540a4e8fd77bf4f2f04537eb;hp=0c942a81ee5558fcea3461e88ba57e6caa934fb2;hpb=21a24662ddc70624c27c607e3904aab23e893898;p=mailer.git diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 0c942a81ee..b8bc4b148b 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -11,14 +11,14 @@ * Kurzbeschreibung : Loginbereich (leitet an das richtige Lgin-Modul * * weiter) * * -------------------------------------------------------------------- * - * $Revision:: 856 $ * - * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ * + * $Revision:: $ * + * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * - * $Author:: stelzi $ * + * $Author:: $ * * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * - * Copyright (c) 2003 - 2008 by Roland Haeder * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -39,142 +39,106 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; - require($INC); -} elseif ((!EXT_IS_ACTIVE("user")) && (!IS_ADMIN())) { - addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user"); - return; + die(); } // Add description as navigation point -ADD_DESCR("guest", __FILE__); +addMenuDescription('guest', __FILE__); -global $DATA, $ERROR; +if ((!isExtensionActive('user')) && (!isAdmin())) { + loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('user')); + return; +} // END - if // Initialize variables -$ERROR = 0; -$probe_nickname = false; -$uid = false; -$hash = ""; -$URL = ""; -$ADD = ""; +$errorCode = 0; +$userid = false; +$hash = ''; +$URL = ''; +$add = ''; // Already logged in? -if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash'))) { +if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) { // Maybe, then continue with it - $uid = $GLOBALS['userid']; -} elseif ((REQUEST_ISSET_POST(('id'))) && (REQUEST_ISSET_POST(('password'))) && (IS_FORM_SENT())) { + $userid = getUserId(); +} elseif ((isPostRequestElementSet('id')) && (isPostRequestElementSet('password')) && (isFormSent())) { // Set userid and crypt password when login data was submitted - if ((EXT_IS_ACTIVE("nickname")) && (NICKNAME_PROBE_ON_USERID(REQUEST_POST('id')))) { + if ((isExtensionActive('nickname')) && (isNicknameOrUserid(postRequestElement('id')))) { // Nickname entered - $uid = SQL_ESCAPE(REQUEST_POST('id')); + $userid = SQL_ESCAPE(postRequestElement('id')); } else { // Direct userid entered - $uid = bigintval(REQUEST_POST('id')); + $userid = bigintval(postRequestElement('id')); } -} elseif (REQUEST_ISSET_POST(('new_pass'))) { +} elseif (isPostRequestElementSet('new_pass')) { // New password requested - $uid = 0; - if (REQUEST_ISSET_POST(('id'))) $uid = REQUEST_POST('id'); + $userid = 0; + if (isPostRequestElementSet('id')) $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 = constant('CODE_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? - $MSG = "