From 3c0c6ad28a250c08b3fe8b166c589d0d49441ad3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 8 Nov 2009 17:22:13 +0000 Subject: [PATCH] Deprecated templates removed, some code moved to filters, bug fixed in mydata: - Deprecated templates removed - Old lost template admin_extensions_installed.tpl now deprecated - Missing array element 'info' rewritten to 'message' in what=mydata (user has updated his/her profile) - Some other minor fixes - Some HTML/CSS issues fixed - TODOs.txt updated --- .gitattributes | 3 - DOCS/TODOs.txt | 55 ++++---- inc/extensions/ext-debug.php | 3 + inc/extensions/ext-theme.php | 19 ++- inc/functions.php | 110 ++++++++++++++++ inc/language/de.php | 7 +- inc/libs/theme_functions.php | 26 ++-- inc/modules/admin/admin-inc.php | 2 +- inc/modules/admin/overview-inc.php | 4 +- inc/modules/admin/what-chk_regs.php | 19 ++- inc/modules/admin/what-del_task.php | 3 - inc/mysql-manager.php | 119 ------------------ .../de/emails/admin/admin_mydata_notify.tpl | 2 +- .../de/emails/admin/admin_reset_password.tpl | 2 +- .../de/emails/guest/guest_request_confirm.tpl | 2 +- .../de/emails/member/member_mydata_notify.tpl | 2 +- .../html/admin/admin_extensions_installed.tpl | 8 +- .../de/html/admin/admin_list_chk_reg_row.tpl | 4 +- templates/de/html/admin/admin_login_form.tpl | 22 ++-- templates/de/html/admin/admin_logout_form.tpl | 18 +-- templates/de/html/admin/admin_reg.tpl | 1 - templates/de/html/admin/admin_reg_row.tpl | 1 - templates/de/html/member/member_doubler.tpl | 105 +++++++--------- 23 files changed, 252 insertions(+), 285 deletions(-) delete mode 100644 inc/modules/admin/what-del_task.php delete mode 100644 templates/de/html/admin/admin_reg.tpl delete mode 100644 templates/de/html/admin/admin_reg_row.tpl diff --git a/.gitattributes b/.gitattributes index 35dc72c3f3..e87d1b8990 100644 --- a/.gitattributes +++ b/.gitattributes @@ -410,7 +410,6 @@ inc/modules/admin/what-config_yoomedia.php -text inc/modules/admin/what-del_email.php -text inc/modules/admin/what-del_holiday.php -text inc/modules/admin/what-del_sponsor.php -text -inc/modules/admin/what-del_task.php -text inc/modules/admin/what-del_transfer.php -text inc/modules/admin/what-del_user.php -text inc/modules/admin/what-edit_emails.php -text @@ -1200,9 +1199,7 @@ templates/de/html/admin/admin_refbanner.tpl -text templates/de/html/admin/admin_refbanner_edit.tpl -text templates/de/html/admin/admin_refbanner_edit_row.tpl -text templates/de/html/admin/admin_refbanner_row.tpl -text -templates/de/html/admin/admin_reg.tpl -text templates/de/html/admin/admin_reg_form.tpl -text -templates/de/html/admin/admin_reg_row.tpl -text templates/de/html/admin/admin_reset_pass_done.tpl -text templates/de/html/admin/admin_reset_password.tpl -text templates/de/html/admin/admin_reset_password_form.tpl -text diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 4b7778c9c8..97436c1aed 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -2,7 +2,7 @@ ### DO NOT EDIT THIS FILE. ### ./beg.php:172: // @TODO Opps, what is missing here??? ./birthday_confirm.php:93: // @TODO Try to rewrite the following unset() -./inc/cache/config-local.php:122:// @TODO Rewrite the following three constants, somehow... +./inc/cache/config-local.php:125:// @TODO Rewrite the following three constants, somehow... ./inc/classes/cachesystem.class.php:464: // @TODO Add support for more types which break in last else-block ./inc/config-functions.php:143: // @TODO Make this all better... :-/ ./inc/extensions/ext-html_mail.php:137: // @TODO Move these arrays into config @@ -10,32 +10,33 @@ ./inc/extensions/ext-newsletter.php:215: // @TODO Move these into configuration ./inc/extensions/ext-rallye.php:330: // @TODO Move this code into rallye_functions.php ./inc/extensions/ext-rallye.php:93: // @TODO Fix config_rallye_prices to list_rallye_prices -./inc/extensions/ext-sql_patches.php:741: // @TODO Rewrite this to a filter +./inc/extensions/ext-sql_patches.php:737: // @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'); ./inc/extensions-functions.php:376:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) ./inc/extensions-functions.php:489: // @TODO Extension is loaded, what next? -./inc/functions.php:1010:// @TODO $simple is deprecated -./inc/functions.php:1045: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates -./inc/functions.php:2345:// @TODO Try to move this to inc/libs/theme_functions.php +./inc/functions.php:1016:// @TODO $simple is deprecated +./inc/functions.php:1051: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates +./inc/functions.php:2351:// @TODO Try to move this to inc/libs/theme_functions.php ./inc/functions.php:241: // @TODO Remove this sanity-check if all is fine ./inc/functions.php:244: // @TODO Try to rewrite all $DATA to $content -./inc/functions.php:2516:// @TODO Please describe this function -./inc/functions.php:2534: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); -./inc/functions.php:2630: // @TODO Add a little more infos here -./inc/functions.php:2641: // @TODO This cannot be rewritten to app_die(), try to find a solution for this. -./inc/functions.php:2724: // @TODO Rewrite this old lost code to a template -./inc/functions.php:2813: // @TODO Are these convertions still required? -./inc/functions.php:2831:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:2522:// @TODO Please describe this function +./inc/functions.php:2540: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); +./inc/functions.php:2636: // @TODO Add a little more infos here +./inc/functions.php:2647: // @TODO This cannot be rewritten to app_die(), try to find a solution for this. +./inc/functions.php:2728: // @TODO Rewrite this old lost code to a template +./inc/functions.php:2817: // @TODO Are these convertions still required? +./inc/functions.php:2835:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:3709:// @TODO Lame description for this function +./inc/functions.php:3731: // @TODO Move this in a filter ./inc/functions.php:467: // @TODO Do only use $contentn, not $DATA or raw variables ./inc/functions.php:537: // @TODO Extension 'msg' does not exist ./inc/functions.php:606:// @TODO Rewrite this to an extension 'smtp' ./inc/install-functions.php:62: // @TODO DEACTIVATED: changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0); -./inc/language/de.php:1142:// @TODO Rewrite these two constants -./inc/language/de.php:1158:// @TODO Rewrite these five constants -./inc/language/de.php:737:// @TODO The template 'admin_extensions_installed' is using this. But the template is no longer used. -./inc/language/de.php:845:// @TODO Are these constants longer used? +./inc/language/de.php:1145:// @TODO Rewrite these two constants +./inc/language/de.php:1161:// @TODO Rewrite these five constants +./inc/language/de.php:848:// @TODO Are these constants longer used? ./inc/language-functions.php:45:// @TODO Rewrite all language constants to this function. ./inc/language/holiday_de.php:49:// @TODO Rewrite these two constants to one ./inc/language/rallye_de.php:113:// @TODO Rewrite following two lines to one @@ -53,7 +54,6 @@ ./inc/libs/surfbar_functions.php:950: // @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:313: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); ./inc/libs/user_functions.php:336: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); @@ -68,12 +68,11 @@ ./inc/modules/admin/admin-inc.php:530:// @TODO Try to rewrite this to adminAddMenuSelectionBox() ./inc/modules/admin/admin-inc.php:543: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query ./inc/modules/admin/overview-inc.php:160: // @TODO Rewrite this to a filter -./inc/modules/admin/overview-inc.php:274: // @TODO Rewrite this to something with include files +./inc/modules/admin/overview-inc.php:274: // @TODO Rewrite this to something with include files and/or filter ./inc/modules/admin/overview-inc.php:312: // @TODO This may also be rewritten to include files ./inc/modules/admin/overview-inc.php:314: default: // @TODO Unknown support mode -./inc/modules/admin/overview-inc.php:433: // @TODO Try to move this in includes +./inc/modules/admin/overview-inc.php:435: // @TODO Try to move this in includes ./inc/modules/admin/overview-inc.php:44:// @TODO This function does also check for uncompleted tasks -./inc/modules/admin.php:94: // @TODO Why is this set to 'done'? ./inc/modules/admin/what-add_guestnl_cat.php:48: // @TODO Check if category does already exist ./inc/modules/admin/what-add_surfbar_url.php:56: // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestElement() calls to $postData ./inc/modules/admin/what-admin_add.php:119: // @TODO This can be somehow rewritten to a function @@ -82,7 +81,6 @@ ./inc/modules/admin/what-adminedit.php:57: // @TODO Kill all constants in this file ./inc/modules/admin/what-admins_mails.php:59: // @TODO Can this be rewritten??? ./inc/modules/admin/what-bonus.php:47:// @TODO Unused at the moment -./inc/modules/admin/what-chk_regs.php:65: // @TODO Rewritings: surname->surname,family->family,ip->REMOTE_ADDR,ref->refid,hash->user_hash in template ./inc/modules/admin/what-config_admins.php:145: // @TODO Rewrite this to filter 'run_sqls' ./inc/modules/admin/what-config_mods.php:135: // @TODO Rewritings: mod->module in template ./inc/modules/admin/what-config_rallye_prices.php:208: // @TODO Rewritings: level->price_level, infos->info in template @@ -147,8 +145,7 @@ ./inc/modules/member/what-bonus.php:56: // @TODO Rewrite this to a filter ./inc/modules/member/what-categories.php:129: // @TODO Rewrite this to use $OUT .= ... ./inc/modules/member/what-order.php:443: // @TODO Rewrite this to a filter -./inc/modules/member/what-payout.php:143: // @TODO Rewritings: acc->target_account,bank->target_bank in templates -./inc/modules/member/what-payout.php:241: // @TODO Rewrite this to a filter +./inc/modules/member/what-payout.php:240: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:54:// @TODO Should we rewrite this to a filter? ./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = "".$content['login'].""; ./inc/modules/member/what-reflinks.php:59:// @TODO Move this into a filter @@ -161,14 +158,13 @@ ./inc/modules/member/what-unconfirmed.php:144: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() ./inc/modules/order.php:75: // @TODO Unused: 2,4 ./inc/monthly/monthly_bonus.php:68: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:1665: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:1886: // @TODO Rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:2206: // @TODO This can be somehow rewritten +./inc/mysql-manager.php:1566: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:1790: // @TODO Rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:2112: // @TODO This can be somehow rewritten +./inc/mysql-manager.php:2135:// @TODO Fix inconsistency between last_module and getWhat() ./inc/mysql-manager.php:220: // @TODO Nothing helped??? -./inc/mysql-manager.php:2229:// @TODO Fix inconsistency between last_module and getWhat() ./inc/mysql-manager.php:255: // @TODO Rewrite this to a filter ./inc/mysql-manager.php:576: // @TODO Try to rewrite this to one or more functions -./inc/mysql-manager.php:901:// @TODO Lame description for this function ./inc/mysql-manager.php:93:// @TODO Can we cache this? ./inc/reset/reset_birthday.php:92: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/wrapper-functions.php:127:// @TODO Implement $compress @@ -186,7 +182,7 @@ ./view.php:72: // @TODO No banner found, output some default banner ### ### DEPRECATION FOLLOWS: ### ### ./inc/modules/admin/admin-inc.php:531:// @DEPRECATED -./inc/modules/admin/what-del_task.php:2:// @DEPRECATED +./templates/de/html/admin/admin_extensions_installed.tpl:1: ### ### template-warnings.log follows: ### ### Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/menu/menu_what_end.tpl, line: 1 in Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/menu/menu_what_end.tpl, line: 2 in @@ -217,6 +213,7 @@ Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : form in templates/de/ Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/admin/admin_main_footer.tpl, line: 1 in Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/admin/admin_main_footer.tpl, line: 2 in Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_main_footer.tpl, line: 12 in +Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/admin/admin_login_form.tpl, line: 49 in Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/guest/guest_rallye_expired_footer.tpl, line: 6 in Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/guest/guest_rallye_expired_footer.tpl, line: 7 in Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/guest/guest_footer.tpl, line: 6 in diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 8cf681c8de..aca2f0b534 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -50,6 +50,9 @@ setExtensionVersionHistory(array('0.0')); // Keep this extension always active! setExtensionAlwaysActive('Y'); +// This extension is in development (non-productive) +enableExtensionProductive(false); + switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Table for debug log entries diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index d2d9a73cf8..0590290037 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -42,10 +42,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0.9'); +setThisExtensionVersion('0.1.0'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9')); +setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) @@ -64,6 +64,9 @@ switch (getExtensionMode()) { // Delete member menu entries addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='themes' OR `what`='themes'"); + + // Unregister filter + unregisterFilter('init', 'HANDLE_THEME_CHANGE', true, getExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension @@ -156,7 +159,15 @@ INDEX (`theme_active`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Fehlende Konfiguration hinzugefügt."); break; - } + + case '0.1.0': // SQL queries for v0.1.0 + // Register filter + registerFilter('init', 'HANDLE_THEME_CHANGE', false, true, getExtensionDryRun()); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Ändern des Designs nun im Filter (internes TODO)."); + break; + } // END - switch break; case 'modify': // When the extension got modified @@ -171,7 +182,7 @@ INDEX (`theme_active`) default: // Unknown extension mode DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode())); break; -} // END - swich +} // END - switch // ?> diff --git a/inc/functions.php b/inc/functions.php index c621cbc3f2..de1578bff7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3705,6 +3705,116 @@ function escapeJavaScriptQuotes ($str) { return $str; } +// Send out mails depending on the 'mod/modes' combination +// @TODO Lame description for this function +function sendModeMails ($mod, $modes) { + // Load hash + if (fetchUserData(getMemberId())) { + // Extract salt from cookie + $salt = substr(getSession('u_hash'), 0, -40); + + // Now let's compare passwords + $hash = generatePassString(getUserData('password')); + + // Does the hash match or should we change it? + if (($hash == getSession('u_hash')) || (postRequestElement('pass1') == postRequestElement('pass2'))) { + // Load the data + $content = getUserDataArray(); + + // Translate gender + $content['gender'] = translateGender($content['gender']); + + // Clear/init the content variable + $content['message'] = ''; + + // Which mail? + // @TODO Move this in a filter + switch ($mod) { + case 'mydata': + foreach ($modes as $mode) { + switch ($mode) { + case 'normal': break; // Do not add any special lines + case 'email': // Email was changed! + $content['message'] = getMessage('MEMBER_CHANGED_EMAIL').": ".postRequestElement('old_email')."\n"; + break; + + case 'pass': // Password was changed + $content['message'] = getMessage('MEMBER_CHANGED_PASS')."\n"; + break; + + default: + logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown mode %s detected.", $mode)); + $content['message'] = getMessage('MEMBER_UNKNOWN_MODE') . ': ' . $mode . "\n\n"; + break; + } // END - switch + } // END - foreach + + if (isExtensionActive('country')) { + // Replace code with description + $content['country'] = generateCountryInfo(postRequestElement('country_code')); + } // END - if + + // Merge content with data from POST + $content = merge_array($content, postRequestArray()); + + // Load template + $message = loadEmailTemplate('member_mydata_notify', $content, getMemberId()); + + if (getConfig('admin_notify') == 'Y') { + // The admin needs to be notified about a profile change + $message_admin = 'admin_mydata_notify'; + $sub_adm = getMessage('ADMIN_CHANGED_DATA'); + } else { + // No mail to admin + $message_admin = ''; + $sub_adm = ''; + } + + // Set subject lines + $sub_mem = getMessage('MEMBER_CHANGED_DATA'); + + // Output success message + $content = "{--MYDATA_MAIL_SENT--}"; + break; + + default: // Unsupported module! + logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod)); + $content = "{--UNKNOWN_MODULE--}"; + break; + } // END - switch + } else { + // Passwords mismatch + $content = "{--MEMBER_PASSWORD_ERROR--}"; + } + } else { + // Could not load profile + $content = "{--MEMBER_CANNOT_LOAD_PROFILE--}"; + } + + // Send email to user if required + if ((!empty($sub_mem)) && (!empty($message))) { + // Send member mail + sendEmail($content['email'], $sub_mem, $message); + } // END - if + + // Send only if no other error has occured + if (empty($content)) { + if ((!empty($sub_adm)) && (!empty($message_admin))) { + // Send admin mail + sendAdminNotification($sub_adm, $message_admin, $content, getMemberId()); + } elseif (getConfig('admin_notify') == 'Y') { + // Cannot send mails to admin! + $content = getMessage('CANNOT_SEND_ADMIN_MAILS'); + } else { + // No mail to admin + $content = "{--MYDATA_MAIL_SENT--}"; + } + } // END - if + + // Load template + loadTemplate('admin_settings_saved', false, $content); +} + ////////////////////////////////////////////////// // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS // ////////////////////////////////////////////////// diff --git a/inc/language/de.php b/inc/language/de.php index 904f530c1b..8873a637a1 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -557,12 +557,9 @@ addMessages(array( 'ADMIN_SELECT_USER' => "Mitglied auswählen", 'ENTER_POINTS_ADD' => "{?POINTS?} zum Aufbuchen", 'ENTER_ADD_REASON' => "Grund der Aufbuchung", - 'ADMIN_ADDED_POINTS_1' => "Einer unserer Administratoren hat Ihnen soeben", - 'ADMIN_ADDED_POINTS_2' => " {?POINTS?} gutgeschrieben.", - 'ADMIN_ADDED_REASON' => "Grund dazu war folgender", 'ADMIN_ADD_SUBJ' => "{?POINTS?}-Gutschrift durch unsere Admins.", 'ADMIN_POINTS_ADDED' => "{?POINTS?} wurden gutgeschrieben. Das Mitglied hat eine Mail erhalten.", - 'MAILS_PER_DAY' => "Mails / Tag", + 'MAILS_PER_DAY' => "Mitglieder-Mails / Tag", 'GUEST_CONFIRMED_DONE' => "Danke für die Bestätigung Ihrer Email-Adresse! Es ist eine Mail mit den Login-Daten zu Ihnen unterwegs.", 'GUEST_CONFIRMED_TWICE' => "Sie haben bereits Ihre Email-Adresse bestätigt oder Ihr Account ist derzeit gesperrt.", 'GUEST_CONFIRMED_FAILED' => "Bestätigung Ihrer Email-Adresse fehlgeschlagen oder es liegt ein anderer Fehler vor.", @@ -742,8 +739,6 @@ addMessages(array( 'ADMIN_EXT_FILE_VERSION' => "Version (alt)", 'ADMIN_EXT_TOTAL_FSIZE' => "Downloadgesamtgrösse", 'ADMIN_EXT_TOTAL_FOUND' => "Gesamt gefundene Erweiterungen", -// @TODO The template 'admin_extensions_installed' is using this. But the template is no longer used. - 'ADMIN_EXT_ALREADY_INSTALLED' => "Alle %s gefundenen Erweiterungen sind bereits installiert.", 'ADMIN_EXT_VERSION' => "Version", 'ADMIN_EXT_AUTOPURGE_404' => "autopurge nicht installiert.", 'ADMIN_EXT_BONUS_OUTDATED' => "Ihre Bonus-Erweiterung ist veraltet! Version %s oder höher wird benötigt.", diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 3b281e2cc2..70a2199102 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -215,21 +215,23 @@ function getCurrentThemeName () { return $name; } -// @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') != getCurrentTheme())) { - // Set new theme for guests - $newTheme = postRequestElement('new_theme'); +// Filter for generic handling of theme change +function FILTER_HANDLE_THEME_CHANGE () { + // Check if new theme is selcted + if ((isPostRequestElementSet('new_theme')) && (postRequestElement('new_theme') != getCurrentTheme())) { + // Set new theme for guests + $newTheme = postRequestElement('new_theme'); - // Change to new theme - setTheme($newTheme); + // Change to new theme + setTheme($newTheme); - // Remove current from array - removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme())); + // Remove current from array + removeIncludeFromPool('theme', sprintf("theme/%s/theme.php", getCurrentTheme())); - // Add new theme - addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme)); -} // END - if + // Add new theme + addIncludeToPool('theme', sprintf("theme/%s/theme.php", $newTheme)); + } // END - if +} // [EOF] ?> diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index b61077330a..1041fabe3f 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -532,7 +532,7 @@ function addMemberSelectionBox ($def=0, $add_all=false, $return=false, $none=fal function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') { $what = "`what` != ''"; if ($mode == 'action') $what = "(`what`='' OR `what` IS NULL) AND action !='login'"; - $result = SQL_QUERY_ESC("SELECT %s, title FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort`", + $result = SQL_QUERY_ESC("SELECT %s, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC", array($mode), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load menu as selection diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index afbc4c6f25..a58ac8611f 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -271,7 +271,7 @@ LIMIT 1", $OUT .= loadTemplate('admin_overview_row', true, $content); // Which task do we actually have here? - // @TODO Rewrite this to something with include files + // @TODO Rewrite this to something with include files and/or filter switch ($type) { case 'EXTENSION': // Install new extensions $ext_name = substr($subj, 1, strpos($subj, ':') - 1); @@ -289,7 +289,7 @@ LIMIT 1", // Task is closed so nothing is todo $OUT .= "
{--ADMIN_EXT_ALREADY_REGISTERED--}
\n"; - // Close task but not already closes or deleted or update tasks + // Close task but not already closed, solved, deleted or update tasks if ((!in_array($status, array('CLOSED','DELETED','SOLVED'))) && ($type != 'EXTENSION_UPDATE')) { // Solve the task runFilterChain('solve_task', $tid); diff --git a/inc/modules/admin/what-chk_regs.php b/inc/modules/admin/what-chk_regs.php index 159c450c07..cb1b68f612 100644 --- a/inc/modules/admin/what-chk_regs.php +++ b/inc/modules/admin/what-chk_regs.php @@ -62,17 +62,16 @@ if (SQL_NUMROWS($result) > 0) { if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']); // Prepare array for the row template - // @TODO Rewritings: ip->REMOTE_ADDR,hash->user_hash in template $content = array( - 'sw' => $SW, - 'gender' => translateGender($content['gender']), - 'surname' => $content['surname'], - 'family' => $content['family'], - 'email' => "".$content['email']."", - 'ip' => $content['REMOTE_ADDR'], - 'refid' => $content['refid'], - 'hash' => $content['user_hash'], - 'link' => generateUserProfileLink($content['userid']), + 'sw' => $SW, + 'gender' => translateGender($content['gender']), + 'surname' => $content['surname'], + 'family' => $content['family'], + 'email' => "".$content['email']."", + 'remote_addr' => $content['REMOTE_ADDR'], + 'refid' => $content['refid'], + 'user_hash' => $content['user_hash'], + 'link' => generateUserProfileLink($content['userid']), ); // Load row template and switch color diff --git a/inc/modules/admin/what-del_task.php b/inc/modules/admin/what-del_task.php deleted file mode 100644 index f551ef47b7..0000000000 --- a/inc/modules/admin/what-del_task.php +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 1f3ea2d2d2..b2614077ab 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -897,125 +897,6 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry=false) { return $ret; } -// Send out mails depending on the 'mod/modes' combination -// @TODO Lame description for this function -function sendModeMails ($mod, $modes) { - // Load hash - if (fetchUserData(getMemberId())) { - // Extract salt from cookie - $salt = substr(getSession('u_hash'), 0, -40); - - // Now let's compare passwords - $hash = generatePassString(getUserData('password')); - - // Does the hash match or should we change it? - if (($hash == getSession('u_hash')) || (postRequestElement('pass1') == postRequestElement('pass2'))) { - // Load user's data 0 1 2 3 4 5 6 7 - $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s AND password='%s' LIMIT 1", - array(getMemberId(), getUserData('password')), __FUNCTION__, __LINE__); - if (SQL_NUMROWS($result) == 1) { - // Load the data - $content = SQL_FETCHARRAY($result, 0, false); - - // Free result - SQL_FREERESULT($result); - - // Translate gender - $content['gender'] = translateGender($content['gender']); - - // Clear/init the content variable - $content['message'] = ''; - - switch ($mod) { - case 'mydata': - foreach ($modes as $mode) { - switch ($mode) { - case 'normal': break; // Do not add any special lines - case 'email': // Email was changed! - $content['message'] = getMessage('MEMBER_CHANGED_EMAIL').": ".postRequestElement('old_email')."\n"; - break; - - case 'pass': // Password was changed - $content['message'] = getMessage('MEMBER_CHANGED_PASS')."\n"; - break; - - default: - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown mode %s detected.", $mode)); - $content['message'] = getMessage('MEMBER_UNKNOWN_MODE') . ': ' . $mode . "\n\n"; - break; - } // END - switch - } // END - foreach - - if (isExtensionActive('country')) { - // Replace code with description - $content['country'] = generateCountryInfo(postRequestElement('country_code')); - } // END - if - - // Merge content with data from POST - $content = merge_array($content, postRequestArray()); - - // Load template - $message = loadEmailTemplate('member_mydata_notify', $content, getMemberId()); - - if (getConfig('admin_notify') == 'Y') { - // The admin needs to be notified about a profile change - $message_admin = 'admin_mydata_notify'; - $sub_adm = getMessage('ADMIN_CHANGED_DATA'); - } else { - // No mail to admin - $message_admin = ''; - $sub_adm = ''; - } - - // Set subject lines - $sub_mem = getMessage('MEMBER_CHANGED_DATA'); - - // Output success message - $content = "{--MYDATA_MAIL_SENT--}"; - break; - - default: // Unsupported module! - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod)); - $content = "{--UNKNOWN_MODULE--}"; - break; - } // END - switch - } else { - // Could not load profile data - $content = "{--MEMBER_CANNOT_LOAD_PROFILE--}"; - } - } else { - // Passwords mismatch - $content = "{--MEMBER_PASSWORD_ERROR--}"; - } - } else { - // Could not load profile - $content = "{--MEMBER_CANNOT_LOAD_PROFILE--}"; - } - - // Send email to user if required - if ((!empty($sub_mem)) && (!empty($message))) { - // Send member mail - sendEmail($content['email'], $sub_mem, $message); - } // END - if - - // Send only if no other error has occured - if (empty($content)) { - if ((!empty($sub_adm)) && (!empty($message_admin))) { - // Send admin mail - sendAdminNotification($sub_adm, $message_admin, $content, getMemberId()); - } elseif (getConfig('admin_notify') == 'Y') { - // Cannot send mails to admin! - $content = getMessage('CANNOT_SEND_ADMIN_MAILS'); - } else { - // No mail to admin - $content = "{--MYDATA_MAIL_SENT--}"; - } - } // END - if - - // Load template - loadTemplate('admin_settings_saved', false, $content); -} - // Get action value from mode (admin/guest/member) and what-value function getModeAction ($mode, $what) { // Init status diff --git a/templates/de/emails/admin/admin_mydata_notify.tpl b/templates/de/emails/admin/admin_mydata_notify.tpl index ba3f4e28f1..efb9e42a09 100644 --- a/templates/de/emails/admin/admin_mydata_notify.tpl +++ b/templates/de/emails/admin/admin_mydata_notify.tpl @@ -14,7 +14,7 @@ Hallo Administrator, {--CITY--}: $content[city] {--EMAIL_ADDRESS--}: $content[email] ------------------------------------------ -$content[info] +$content[message] ------------------------------------------ IP-Nummer: $REMOTE_ADDR ------------------------------------------ diff --git a/templates/de/emails/admin/admin_reset_password.tpl b/templates/de/emails/admin/admin_reset_password.tpl index dfd4cd6850..b051cff512 100644 --- a/templates/de/emails/admin/admin_reset_password.tpl +++ b/templates/de/emails/admin/admin_reset_password.tpl @@ -3,7 +3,7 @@ Hallo Administrator, hier ist Ihr angefordeter Reset-Link, den Sie zum Zurücksetzen Ihres Administratorkennworts benötigen. ------------------------------ -{?URL?}/modules.php?module=admin&reset_pass=1&hash=$content[hash] +{?URL?}/modules.php?module=admin&reset_pass=1&hash=$content[hash] ------------------------------ Wenn Sie auf diesen Link klicken, ist Ihr Passwort noch nicht zurückgesetzt. Bitte geben Sie zur Bestätigung Ihr Loginname ein. Dann erst können Sie Ihr Passwort ändern. diff --git a/templates/de/emails/guest/guest_request_confirm.tpl b/templates/de/emails/guest/guest_request_confirm.tpl index 4dc3b6816c..fb602cc791 100644 --- a/templates/de/emails/guest/guest_request_confirm.tpl +++ b/templates/de/emails/guest/guest_request_confirm.tpl @@ -1,6 +1,6 @@ Hallo $content[gender] $content[surname] $content[family], -Sie hatten sich zu unserem {?mt_word?} {?MAIN_TITLE?} angemeldet und heute Ihren Bestätigungslink erneut angefordert, jedoch bis jetzt noch nicht Ihre eMail-Adresse bestätigt. Diesen Schritt können Sie jetzt nachholen, damit Sie sich einloggen können. +Sie hatten sich zu unserem {?mt_word?} {?MAIN_TITLE?} angemeldet und heute Ihren Bestätigungslink erneut angefordert, jedoch bis jetzt noch nicht Ihre eMail-Adresse bestätigt. Diesen Schritt können Sie jetzt nachholen. Danach können Sie sich im Mitgliedsbereich einloggen. Hier ist Ihr Bestätigungslink: {?URL?}/confirm.php?hash=$content[hash] diff --git a/templates/de/emails/member/member_mydata_notify.tpl b/templates/de/emails/member/member_mydata_notify.tpl index df4b39df45..d39cb57c68 100644 --- a/templates/de/emails/member/member_mydata_notify.tpl +++ b/templates/de/emails/member/member_mydata_notify.tpl @@ -22,7 +22,7 @@ Browser: $HTTP_USER_AGENT {--PLEASE_NOTIFY_ABUSE_MYDATA--} ------------------------------------------ -$content[info] +$content[message] ------------------------------------------ Mit freundlichen Grüßen, diff --git a/templates/de/html/admin/admin_extensions_installed.tpl b/templates/de/html/admin/admin_extensions_installed.tpl index da1e9cd656..11f5d85d80 100644 --- a/templates/de/html/admin/admin_extensions_installed.tpl +++ b/templates/de/html/admin/admin_extensions_installed.tpl @@ -1,7 +1 @@ - - - - -
- {--ADMIN_EXT_ALREADY_INSTALLED_1--}$content{--ADMIN_EXT_ALREADY_INSTALLED_2--} -
+ diff --git a/templates/de/html/admin/admin_list_chk_reg_row.tpl b/templates/de/html/admin/admin_list_chk_reg_row.tpl index 6f87e1e86b..10cf1426d0 100644 --- a/templates/de/html/admin/admin_list_chk_reg_row.tpl +++ b/templates/de/html/admin/admin_list_chk_reg_row.tpl @@ -4,9 +4,9 @@ $content[surname] $content[family] $content[email] - $content[ip] + $content[remote_addr] $content[refid] - {--CONFIRMATION_LINK--} + {--CONFIRMATION_LINK--} diff --git a/templates/de/html/admin/admin_login_form.tpl b/templates/de/html/admin/admin_login_form.tpl index df921f319f..1751b4b6e7 100644 --- a/templates/de/html/admin/admin_login_form.tpl +++ b/templates/de/html/admin/admin_login_form.tpl @@ -36,16 +36,18 @@ {--SELECT_TIMEOUT--}: - + + + //--> diff --git a/templates/de/html/admin/admin_logout_form.tpl b/templates/de/html/admin/admin_logout_form.tpl index 0ddae08aca..908446c9ea 100644 --- a/templates/de/html/admin/admin_logout_form.tpl +++ b/templates/de/html/admin/admin_logout_form.tpl @@ -7,20 +7,14 @@ -   - - - - {--ADMIN_LOGOUT_NOTE--} - - -   - - - {--ADMIN_LOGOUT_QUESTION--} + + {--ADMIN_LOGOUT_NOTE--} + -   + + {--ADMIN_LOGOUT_QUESTION--} + diff --git a/templates/de/html/admin/admin_reg.tpl b/templates/de/html/admin/admin_reg.tpl deleted file mode 100644 index 11f5d85d80..0000000000 --- a/templates/de/html/admin/admin_reg.tpl +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/de/html/admin/admin_reg_row.tpl b/templates/de/html/admin/admin_reg_row.tpl deleted file mode 100644 index 11f5d85d80..0000000000 --- a/templates/de/html/admin/admin_reg_row.tpl +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/de/html/member/member_doubler.tpl b/templates/de/html/member/member_doubler.tpl index 9f695e6674..82ba5d33ca 100644 --- a/templates/de/html/member/member_doubler.tpl +++ b/templates/de/html/member/member_doubler.tpl @@ -1,69 +1,56 @@ -
{--DOUBLER_MEMBER_YOUR_LINK--}:
-{?URL?}/doubler.php?refid=$content[userid]
-
-Tipp: Nutzen Sie diesen zum Werben unseres {?mt_word2?}, um die $content[refid]% Referal-Vergütung zu erhalten!
- -
{--DOUBLER_MEMBER_ALREADY_PAYOUT--}:

-
-$content[payout_history]
+
+ {--DOUBLER_MEMBER_YOUR_LINK--}:
+ {?URL?}/doubler.php?refid=$content[userid]
+
+ Tipp: Nutzen Sie diesen zum Werben unseres {?mt_word2?}, um die $content[refid]% Referal-Vergütung zu erhalten! +
-
{--DOUBLER_MEMBER_NEXT_PAYOUT--}:

-
-$content[next_table]
+
+
{--DOUBLER_MEMBER_ALREADY_PAYOUT--}:

+
+ $content[payout_history] +
-
{--DOUBLER_MEMBER_REF_PAYOUT--}:

-
-$content[payout_ref]
+
+
{--DOUBLER_MEMBER_NEXT_PAYOUT--}:

+
+ $content[next_table] +
- - - - - - - - - - - - - -
{--DOUBLER_GENERAL_INFOS--}:
+
{--DOUBLER_MEMBER_REF_PAYOUT--}:

+
+ $content[payout_ref] + + +
+
+ {--DOUBLER_GENERAL_INFOS--}: +
+
    -
  • {--DOUBLER_MINIMUM_IS--} $content[min] - {?POINTS?} {--DOUBLER_MAXIMUM_IS--} $content[max] - {?POINTS?}
  • -
  • {--DOUBLER_ALREADY_PAYED_1--} $content[total] - {?POINTS?} {--DOUBLER_ALREADY_PAYED_2--}
  • -
  • {--DOUBLER_POINTS_LEFT_1--} $content[left] - {?POINTS?} {--DOUBLER_POINTS_LEFT_2--}
  • -
  • {--DOUBLER_USAGE_COUNTER_1--} {?doubler_counter?} - {--DOUBLER_USAGE_COUNTER_2--}
  • +
  • {--DOUBLER_MINIMUM_IS--} $content[min] {?POINTS?} {--DOUBLER_MAXIMUM_IS--} $content[max] {?POINTS?}
  • +
  • {--DOUBLER_ALREADY_PAYED_1--} $content[total] {?POINTS?} {--DOUBLER_ALREADY_PAYED_2--}
  • +
  • {--DOUBLER_POINTS_LEFT_1--} $content[left] {?POINTS?} {--DOUBLER_POINTS_LEFT_2--}
  • +
  • {--DOUBLER_USAGE_COUNTER_1--} {?doubler_counter?} {--DOUBLER_USAGE_COUNTER_2--}
  • $content[payout_time]
  • {--DOUBLER_FULL_PAYOUT--}
  • -
  • {--DOUBLER_POINTS_1--} $content[charge]% - {--DOUBLER_POINTS_2--}
  • -
  • {--DOUBLER_EXAMPLE_1--} 500 {?POINTS?} - »» {--DOUBLER_EXAMPLE_2--} 1000 {?POINTS?}{--DOUBLER_EXAMPLE_3--}
  • -
  • {--DOUBLER_REFERAL_1--} $content[ref]% - {--DOUBLER_REFERAL_2--} {--DOUBLER_REFERAL_3--} - {--DOUBLER_REFERAL_4--} -
  • {--DOUBLER_REFERAL_5--} 100 {?POINTS?} - {--DOUBLER_REFERAL_6--} 100 {?POINTS?} - {--DOUBLER_REFERAL_8--} 300 {?POINTS?} - {--DOUBLER_REFERAL_8--}
  • +
  • {--DOUBLER_POINTS_1--} $content[charge]% {--DOUBLER_POINTS_2--}
  • +
  • {--DOUBLER_EXAMPLE_1--} 500 {?POINTS?} »» {--DOUBLER_EXAMPLE_2--} 1000 {?POINTS?}{--DOUBLER_EXAMPLE_3--}
  • +
  • {--DOUBLER_REFERAL_1--} $content[ref]% {--DOUBLER_REFERAL_2--} {--DOUBLER_REFERAL_3--} {--DOUBLER_REFERAL_4--}
  • +
  • {--DOUBLER_REFERAL_5--} 100 {?POINTS?} {--DOUBLER_REFERAL_6--} 100 {?POINTS?} {--DOUBLER_REFERAL_8--} 300 {?POINTS?} {--DOUBLER_REFERAL_8--}
  • {--DOUBLER_REFERAL_LINK--}
  • -
  • {--DOUBLER_TIMEOUT_1--} $content[timeout_mark] - {--DOUBLER_TIMEOUT_2--}
  • +
  • {--DOUBLER_TIMEOUT_1--} $content[timeout_mark] {--DOUBLER_TIMEOUT_2--}
  • {--DOUBLER_HAVE_FUN--}
  • -
-
{--DOUBLER_REGISTER_ADVERT--}:
- {--DOUBLER_YOUR_ADVERTISING_HERE--} {--DOUBLER_CONTACT_US--}
+ +
+
+ {--DOUBLER_REGISTER_ADVERT--}: +
+
+ {--DOUBLER_YOUR_ADVERTISING_HERE--} + {--DOUBLER_CONTACT_US--} +
+ -- 2.39.2