From: Roland Häder Date: Wed, 28 Oct 2009 20:52:34 +0000 (+0000) Subject: Fix for displayed message strings in chk_login module X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=205769111aba361c7aa76a6b9791bffed1372241;p=mailer.git Fix for displayed message strings in chk_login module --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 0e69ce018b..78a6d39130 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -9,7 +9,7 @@ ./inc/extensions/ext-html_mail.php:140: // @TODO Move these arrays into config ./inc/extensions/ext-newsletter.php:215: // @TODO Move these into configuration ./inc/extensions/ext-rallye.php:329: // @TODO Move this code into rallye_functions.php -./inc/extensions/ext-sql_patches.php:725: // @TODO Rewrite this to a filter! +./inc/extensions/ext-sql_patches.php:725: // @TODO Rewrite this to a filter ./inc/extensions/ext-sql_patches.php:94: /* @TODO SQL_ALTER_TABLE() should work now properly ./inc/extensions/ext-yoomedia.php:122: // @TODO Can this be moved into a database table? ./inc/extensions/ext-yoomedia.php:55:// @TODO Only deprecated when 'network' is ready! setExtensionDeprecated('Y'); @@ -54,6 +54,7 @@ ./inc/libs/surfbar_functions.php:954: // @TODO Invalid salt should be refused ./inc/libs/task_functions.php:244: // @TODO These can be rewritten to filter ./inc/libs/task_functions.php:52:// @TODO Move all extension-dependent queries into filters +./inc/libs/theme_functions.php:218:// @TODO Move this code block into a filter and register it with 'init' ./inc/libs/user_functions.php:137: // @TODO These two constants are no longer used, maybe we reactivate this code? ./inc/libs/user_functions.php:317: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); ./inc/libs/user_functions.php:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); @@ -143,9 +144,9 @@ ./inc/modules/guest/what-mediadata.php:182:// @TODO Rewrite all these if-blocks to filters ./inc/modules/guest/what-mediadata.php:69: // @TODO Find a better formular than this one ./inc/modules/guest/what-rallyes.php:90: // @TODO Reactivate this: $content['admin'] = "".$login.""; -./inc/modules/guest/what-register.php:196: // @TODO Rewrite these all to a single filter -./inc/modules/guest/what-register.php:274: // @TODO Rewrite this to a filter -./inc/modules/guest/what-register.php:290: // @TODO Rewrite this to addPointsDirectly() +./inc/modules/guest/what-register.php:198: // @TODO Rewrite these all to a single filter +./inc/modules/guest/what-register.php:276: // @TODO Rewrite this to a filter +./inc/modules/guest/what-register.php:292: // @TODO Rewrite this to addPointsDirectly() ./inc/modules/guest/what-sponsor_infos.php:69: // @TODO Rewritings: conv->conv_rate,name->conv_name in template ./inc/modules/guest/what-sponsor_infos.php:89: // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency ./inc/modules/guest/what-sponsor_reg.php:286: // @TODO Swap this HTML code to templates diff --git a/inc/functions.php b/inc/functions.php index dbfe8b3674..de59b2e8e4 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -123,7 +123,7 @@ function outputHtml ($htmlCode, $newLine = true) { $cnt = 0; // Compile and run finished rendered HTML code - while (((strpos($GLOBALS['output'], '{!') > 0) || (strpos($GLOBALS['output'], '{?') > 0)) && ($cnt < 3)) { + while (((strpos($GLOBALS['output'], '{--') > 0) || (strpos($GLOBALS['output'], '{!') > 0) || (strpos($GLOBALS['output'], '{?') > 0)) && ($cnt < 3)) { // Prepare the content and eval() it... $content = array(); $newContent = ''; diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 1cac6e877e..64dbda3d65 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -215,11 +215,9 @@ function getCurrentThemeName () { return $name; } -// Initialize variables -$GLOBALS['curr_theme'] = getCurrentTheme(); - +// @TODO Move this code block into a filter and register it with 'init' // Check if new theme is selcted -if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != $GLOBALS['curr_theme'])) { +if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != getCurrentTheme())) { // Set new theme for guests $newTheme = postRequestElement('new_theme'); @@ -227,7 +225,7 @@ if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') ! setTheme($newTheme); // Remove current from array - removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", $GLOBALS['curr_theme'])); + removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme())); // Add new theme addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme)); diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index da8e61225e..c768b1eae0 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -91,7 +91,6 @@ if ($SEL > 0) { setTheme($postData['default_theme']); // Set it in config and current theme as well - $GLOBALS['curr_theme'] = $postData['default_theme']; setConfigEntry('default_theme', $postData['default_theme']); // Save theme diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index 526da23c4d..bf3ac60713 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -49,6 +49,7 @@ if (isUserIdSet() && (isSessionVariableSet('u_hash'))) { if (isExtensionActive('theme')) { // Login failures are supported since 0.4.7 // Do we have 0.4.7 of sql_patches or later? + // @TODO Rewrite this into a filter $add = ''; if (getExtensionVersion('sql_patches') >= '0.6.1') { // Load them here @@ -71,9 +72,13 @@ if (isUserIdSet() && (isSessionVariableSet('u_hash'))) { // 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 + 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(getUserId()), __FILE__, __LINE__); @@ -87,14 +92,18 @@ LIMIT 1", $bonus = false; if ((getExtensionVersion('sql_patches') >= '0.2.8') && (getExtensionVersion('bonus') >= '0.2.1') && (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) + 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( - getUserId(), - getConfig('login_timeout') - ), __FILE__, __LINE__ + array( + getUserId(), + getConfig('login_timeout') + ), __FILE__, __LINE__ ); if (SQL_AFFECTEDROWS() == 1) $bonus = true; } // END - if diff --git a/inc/modules/member/what-logout.php b/inc/modules/member/what-logout.php index ff32b7155d..5f3c4ce563 100644 --- a/inc/modules/member/what-logout.php +++ b/inc/modules/member/what-logout.php @@ -48,7 +48,7 @@ $URL = 'modules.php?module=index&code='; if (destroyUserSession()) { // Remove theme cookie as well - setTheme(); + setTheme(''); // Logout completed $URL .= getCode('LOGOUT_DONE');