From: Roland Häder Date: Thu, 16 Sep 2010 22:26:05 +0000 (+0000) Subject: Minor rewrites/fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f34c00b4a31f6747e78c6cf88801888d1e84a123;p=mailer.git Minor rewrites/fixes --- diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index cd3c7922cc..6c5dc2fd3e 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -835,7 +835,14 @@ function determineSponsorCountry ($sponsor_id) { // Destroy sponsor session function destroySponsorSession () { // Remove all user data from session - return ((setSession('sponsor_id', '')) && (setSession('sponsor_pass', ''))); + return ( + (setSession('sponsor_id', '')) && + (setSession('sponsor_pass', '')) && + ( + ((isExtensionActive('theme')) && (setTheme(''))) || + (!isExtensionActive('theme')) + ) + ); } // Getter for sponsor_min_points diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 2a342d0146..01339ea1d0 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -264,9 +264,12 @@ function getActualTheme () { return $ret; } -// Setter for theme in session +/** + * Setter for theme in session (This setter does return the success of + * setSession() which is required e.g. for destroySponsorSession(). + */ function setTheme ($newTheme) { - setSession('mxchange_theme', $newTheme); + return setSession('mxchange_theme', $newTheme); } // Get id from theme diff --git a/inc/modules/sponsor/logout.php b/inc/modules/sponsor/logout.php index cc3745ce1e..55f1415775 100644 --- a/inc/modules/sponsor/logout.php +++ b/inc/modules/sponsor/logout.php @@ -50,9 +50,6 @@ if (!defined('__SECURITY')) { $url = 'modules.php?module=index&code='; if (destroySponsorSession()) { - // Remove theme cookie as well - if (isExtensionActive('theme')) setTheme(''); - // Logout completed $url .= getCode('LOGOUT_DONE'); } else { diff --git a/inc/modules/sponsor/welcome.php b/inc/modules/sponsor/welcome.php index b0f6d7f609..35765de3ec 100644 --- a/inc/modules/sponsor/welcome.php +++ b/inc/modules/sponsor/welcome.php @@ -53,12 +53,10 @@ $result = SQL_QUERY_ESC("SELECT FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE - `id`=%s AND - `password`='%s' + `id`=%s LIMIT 1", array( - bigintval(getSession('sponsor_id')), - getSession('sponsorpass') + bigintval(getSession('sponsor_id')) ), __FILE__, __LINE__); // Fetch data diff --git a/templates/de/html/sponsor/sponsor_welcome.tpl b/templates/de/html/sponsor/sponsor_welcome.tpl index dc214fed8f..365a5c00b1 100644 --- a/templates/de/html/sponsor/sponsor_welcome.tpl +++ b/templates/de/html/sponsor/sponsor_welcome.tpl @@ -3,7 +3,7 @@
- Schön, dass wir Sie wieder in unserem Sponsorenbereich begrüssen dürfen! + Schön, dass wir Sie in unserem Sponsorenbereich begrüssen dürfen!