X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fchk_login.php;h=97725a4d8783c2765f0cc507cbbbfbe1a9d873e6;hb=cd7d344ea7007cfa20413acd3e03e50f0ab86d86;hp=216166dc9942fb2cdeeda42779cdfceb9f049f55;hpb=c819b98b236c15ad0b46fc296d9a0e2c1617fee9;p=mailer.git diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index 216166dc99..97725a4d87 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -14,11 +14,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 - 2013 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 * @@ -38,86 +37,26 @@ // Some security stuff... if (!defined('__SECURITY')) { - die(); + exit(); } // END - if // Initial message part -$message = "{--VALIDATING_LOGIN--}"; +$GLOBALS['message'] = '{--VALIDATING_LOGIN--}'; // Is the member id and u_hash set? -if (isMemberIdSet() && (isSessionVariableSet('u_hash'))) { - // Is 'theme' installed and activated? - if (isExtensionActive('theme')) { - // Get theme from profile - if (!fetchUserData(getMemberId())) { - // Userid is not valid - debug_report_bug('User id '.getMemberId() . ' is invalid.'); - } // END - if - - // Load data - $data = getUserDataArray(); - - // Change to new theme - setTheme($data['curr_theme']); - - // Remmeber login failures if available - if (getExtensionVersion('sql_patches') >= '0.6.1') { - // Reset login failures - SQL_QUERY_ESC("UPDATE - `{?_MYSQL_PREFIX?}_user_data` -SET - `login_failures`=0, - `last_failure`='0000-00-00 00:00:00' -WHERE - `userid`=%s -LIMIT 1", - array(getMemberId()), __FILE__, __LINE__); - - // Store it in session - setSession('mxchange_member_failures', $data['login_failures']); - setSession('mxchange_member_last_fail', $data['last_failure']); - } // END - if - } // END - if - - // Bonus is not given by default ;-) - $bonus = false; - if ((isExtensionInstalledAndNewer('sql_patches', '0.2.8')) && (isExtensionInstalledAndNewer('bonus', '0.2.1')) && (getConfig('bonus_active') == 'Y') && (getConfig('bonus_login_yn') == 'Y')) { - // Update last login if far enougth away - SQL_QUERY_ESC("UPDATE - `{?_MYSQL_PREFIX?}_user_data` -SET - `last_login`=UNIX_TIMESTAMP() -WHERE - `userid`=%s AND - `last_login` < (UNIX_TIMESTAMP() - %s) -LIMIT 1", - array( - getMemberId(), - getConfig('login_timeout') - ), __FILE__, __LINE__ - ); - if (SQL_AFFECTEDROWS() == 1) $bonus = true; - } // END - if - - if (($bonus === true) && (getRequestElement('mode') == 'bonus') && (isExtensionActive('bonus'))) { - // Output message with added points - $message .= "
- ".sprintf(getMessage('BONUS_LOGIN_BONUS_ADDED'), translateComma(getConfig('login_bonus')))." -
"; - } elseif (isExtensionActive('bonus')) { - // No login bonus added! - $message .= "
{--BONUS_LOGIN_BONUS_NOT_ADDED--}
"; - } +if (isMember()) { + // Run filter chain here + runFilterChain('member_login_check'); // Redirect to member area - $message .= loadTemplate('member_login_js', true); + $GLOBALS['message'] .= loadTemplate('member_login_js', TRUE); } else { // Login failed! - $message .= loadTemplate('login_failed_js', true); + $GLOBALS['message'] .= loadTemplate('login_failed_js', TRUE); } // Output final message -loadTemplate('admin_settings_saved', false, $message); +displayMessage($GLOBALS['message']); // [EOF] ?>