From: Roland Häder Date: Wed, 25 Nov 2009 16:26:08 +0000 (+0000) Subject: New functions introduced, several rewrites: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=039203d5428c9c6a3bed61fb3a9a16958c6fd44c;p=mailer.git New functions introduced, several rewrites: - New function verifyExpertSettings() added which checks if the admin is aware of altering so-called expert settings, which may raise malfuntion in your mailer - Several rewrites on XHTML - More double quotes converted to single - Other smaller issues fixed (e.g. non-working deletion of bonus mails) - TODOs.txt updated --- diff --git a/.gitattributes b/.gitattributes index b14fa007c5..92b973fc9e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1015,6 +1015,7 @@ templates/de/html/admin/admin_edit_user.tpl -text templates/de/html/admin/admin_email_archiv.tpl -text templates/de/html/admin/admin_email_archiv_row.tpl -text templates/de/html/admin/admin_email_nav_row.tpl -text +templates/de/html/admin/admin_expert_settings_form.tpl -text templates/de/html/admin/admin_ext_notes.tpl -text templates/de/html/admin/admin_ext_reg_form.tpl -text templates/de/html/admin/admin_ext_sql_row.tpl -text @@ -1482,7 +1483,6 @@ templates/de/html/member/member_menu_title.tpl -text templates/de/html/member/member_menu_whats.tpl -text templates/de/html/member/member_mydata_button.tpl -text templates/de/html/member/member_mydata_edit.tpl -text -templates/de/html/member/member_mydata_locked.tpl -text templates/de/html/member/member_mydata_overview.tpl -text templates/de/html/member/member_newsletter.tpl -text templates/de/html/member/member_nickname_form.tpl -text diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index e477d96ca6..828cff526d 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -20,32 +20,33 @@ ./inc/filters.php:538: case 'config': // @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again ./inc/functions.php:1002:// @TODO $simple is deprecated ./inc/functions.php:1037: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates -./inc/functions.php:2435:// @TODO Please describe this function -./inc/functions.php:2453: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); +./inc/functions.php:2437:// @TODO Please describe this function +./inc/functions.php:2455: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); ./inc/functions.php:253: // @TODO Remove this sanity-check if all is fine -./inc/functions.php:2567: // @TODO Add a little more infos here +./inc/functions.php:2569: // @TODO Add a little more infos here ./inc/functions.php:256: // @TODO Try to rewrite all $DATA to $content -./inc/functions.php:2668: // @TODO Rewrite this old lost code to a template -./inc/functions.php:2757: // @TODO Are these convertions still required? -./inc/functions.php:2775:// @TODO Rewrite this function to use readFromFile() and writeToFile() -./inc/functions.php:3653:// @TODO Lame description for this function -./inc/functions.php:3675: // @TODO Move this in a filter -./inc/functions.php:3793: // @TODO This is still very static, rewrite it somehow +./inc/functions.php:2651: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? +./inc/functions.php:2674: // @TODO Rewrite this old lost code to a template +./inc/functions.php:2763: // @TODO Are these convertions still required? +./inc/functions.php:2781:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:3659:// @TODO Lame description for this function +./inc/functions.php:3681: // @TODO Move this in a filter +./inc/functions.php:3799: // @TODO This is still very static, rewrite it somehow ./inc/functions.php:468: // @TODO Do only use $content, not $DATA or raw variables ./inc/functions.php:538: // @TODO Extension 'msg' does not exist ./inc/functions.php:607:// @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:1150:// @TODO Rewrite these two constants -./inc/language/de.php:1166:// @TODO Rewrite these five constants -./inc/language/de.php:848:// @TODO Are these constants longer used? -./inc/language-functions.php:228: // @TODO These are all valid languages, again hard-coded +./inc/language/de.php:1154:// @TODO Rewrite these two constants +./inc/language/de.php:1170:// @TODO Rewrite these five constants +./inc/language/de.php:850:// @TODO Are these constants longer used? +./inc/language-functions.php:233: // @TODO These are all valid languages, again hard-coded ./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 ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings * ./inc/language/refback_de.php:45:// @TODO Rewrite these constants to one ./inc/language/sponsor_de.php:118:// @TODO Rewrite these four constants to one and use sprintf() -./inc/libs/admins_functions.php:418: // @TODO This can be, somehow, rewritten +./inc/libs/admins_functions.php:426: // @TODO This can be, somehow, rewritten ./inc/libs/beg_functions.php:57: // @TODO Try to rewrite the following unset() ./inc/libs/bonus_functions.php:215: // @TODO Try to find a way for rewriting this constant ./inc/libs/bonus_functions.php:303: // @TODO This query isn't right, it will only update if the user was for a longer time away! @@ -53,15 +54,15 @@ ./inc/libs/rallye_functions.php:718: $EXPIRE = 3; // @TODO The hard-coded value... ./inc/libs/rallye_functions.php:782: // @TODO Rewrite this to our API function ./inc/libs/refback_functions.php:60: // @TODO Try to rewrite the following unset() -./inc/libs/surfbar_functions.php:1491: // @TODO This can be somehow rewritten -./inc/libs/surfbar_functions.php:944: // @TODO Invalid salt should be refused +./inc/libs/surfbar_functions.php:1496: // @TODO This can be somehow rewritten +./inc/libs/surfbar_functions.php:949: // @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/user_functions.php:137: // @TODO These two constants are no longer used, maybe we reactivate this code? ./inc/libs/user_functions.php:224:// @TODO Double-check configuration entry here ./inc/libs/user_functions.php:319: // @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)); -./inc/libs/user_functions.php:415: // @TODO We should try to rewrite this to fetchUserData() somehow +./inc/libs/user_functions.php:343: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); +./inc/libs/user_functions.php:416: // @TODO We should try to rewrite this to fetchUserData() somehow ./inc/libs/yoomedia_functions.php:64: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script ./inc/load_config.php:76: // @TODO Rewrite them to avoid this else block ./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php * @@ -70,12 +71,12 @@ ./inc/modules/admin/admin-inc.php:423: // @TODO Rewrite this to $content = SQL_FETCHARRAY() ./inc/modules/admin/admin-inc.php:429: // @TODO ACL is 'allow'... hmmm ./inc/modules/admin/admin-inc.php:531:// @TODO Try to rewrite this to adminAddMenuSelectionBox() -./inc/modules/admin/admin-inc.php:544: // @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 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:435: // @TODO Try to move this in includes +./inc/modules/admin/admin-inc.php:545: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query +./inc/modules/admin/overview-inc.php:163: // @TODO Rewrite this to a filter +./inc/modules/admin/overview-inc.php:277: // @TODO Rewrite this to something with include files and/or filter +./inc/modules/admin/overview-inc.php:315: // @TODO This may also be rewritten to include files +./inc/modules/admin/overview-inc.php:317: default: // @TODO Unknown support mode +./inc/modules/admin/overview-inc.php:438: // @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/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 @@ -86,7 +87,8 @@ ./inc/modules/admin/what-admins_mails.php:60: // @TODO Can this be rewritten??? ./inc/modules/admin/what-bonus.php:47:// @TODO Unused at the moment ./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_mods.php:140: // @TODO Rewritings: mod->module in template +./inc/modules/admin/what-config_mods.php:56: // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function ./inc/modules/admin/what-config_rallye_prices.php:208: // @TODO Rewritings: level->price_level, infos->info in template ./inc/modules/admin/what-config_rallye_prices.php:225: // @TODO Rewrite these two constants ./inc/modules/admin/what-config_register.php:67: // @TODO Move this HTML code into a template @@ -99,7 +101,7 @@ ./inc/modules/admin/what-holiday_list.php:47:// @TODO Unused at the moment ./inc/modules/admin/what-list_autopurge.php:54:// @TODO Rewrite those lines to filter ./inc/modules/admin/what-list_autopurge.php:84: // @TODO Rewritings: surname->surname,family->family in templates -./inc/modules/admin/what-list_cats.php:55: // @TODO No longer needed? define('__CATS_BASE' , "" . $login . ""; +./inc/modules/guest/what-rallyes.php:90: // @TODO Reactivate this: $content['admin'] = '' . $login . ''; ./inc/modules/guest/what-register.php:192: // @TODO Rewrite these all to a single filter ./inc/modules/guest/what-register.php:270: // @TODO Rewrite this to a filter ./inc/modules/guest/what-register.php:286: // @TODO Rewrite this to addPointsDirectly() @@ -147,10 +149,11 @@ ./inc/modules/member/what-bonus.php:56: // @TODO Rewrite this to a filter ./inc/modules/member/what-categories.php:128: // @TODO Rewrite this to use $OUT .= ... ./inc/modules/member/what-doubler.php:55:// @TODO The '*100' is in the way to get moved into the template -./inc/modules/member/what-order.php:443: // @TODO Rewrite this to a filter -./inc/modules/member/what-payout.php:240: // @TODO Rewrite this to a filter +./inc/modules/member/what-order.php:449: // @TODO Rewrite this to a filter +./inc/modules/member/what-order.php:64:// @TODO Rewrite this to a filter +./inc/modules/member/what-payout.php:220: // @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:90: // @TODO Reactivate this: $content['admin'] = "" . $content['login'] . ""; +./inc/modules/member/what-rallyes.php:90: // @TODO Reactivate this: $content['admin'] = '' . $content['login'] . ''; ./inc/modules/member/what-reflinks.php:53:// @TODO Move this into a filter ./inc/modules/member/what-stats.php:118: // @TODO Rewrite in template: clix->clicks ./inc/modules/member/what-transfer.php:135: // @TODO Rewrite this to a filter @@ -161,19 +164,19 @@ ./inc/modules/member/what-unconfirmed.php:142: // @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:1546: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:1770: // @TODO Rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:2098: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:2128:// @TODO Fix inconsistency between last_module and getWhat() -./inc/mysql-manager.php:224: // @TODO Nothing helped??? -./inc/mysql-manager.php:259: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:552: // @TODO Try to rewrite this to one or more functions +./inc/mysql-manager.php:1554: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:1646: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:2105: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:2146:// @TODO Fix inconsistency between last_module and getWhat() +./inc/mysql-manager.php:228: // @TODO Nothing helped??? +./inc/mysql-manager.php:263: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:556: // @TODO Try to rewrite this to one or more functions ./inc/mysql-manager.php:93:// @TODO Can we cache this? ./inc/reset/reset_beg.php:50:// @TODO This should be converted in a daily beg rallye ./inc/reset/reset_birthday.php:91: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/wrapper-functions.php:127:// @TODO Implement $compress ./inc/wrapper-functions.php:134:// @TODO Implement $decompress -./inc/wrapper-functions.php:401:// @TODO Do some more sanity check here +./inc/wrapper-functions.php:406:// @TODO Do some more sanity check here ./mailid.php:134: // @TODO Rewrite this to a filter ./mailid.php:214: // @TODO Rewrite this to a dynamic include or so ./mailid.php:94: // @TODO Rewrite this to a filter @@ -205,7 +208,6 @@ ./templates/de/html/surfbar/surfbar_frame_top.tpl:23:// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy) ### ### DEPRECATION FOLLOWS: ### ### ./inc/modules/admin/admin-inc.php:532:// @DEPRECATED -./templates/de/html/member/member_mydata_locked.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 diff --git a/birthday_confirm.php b/birthday_confirm.php index 7e4750f209..2f1aedc038 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -106,7 +106,7 @@ if (SQL_NUMROWS($result) == 1) { $content['message'] = loadTemplate('birthday_msg', true, $data); } else { // Unconfirmed / locked accounts cannot get points - $content['message'] = sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status'])); + $content['message'] = getMaskedMessage('BIRTHDAY_CANNOT_STATUS', translateUserStatus($data['status'])); } } else { // Cannot load data! diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index 4ee0cb0d22..a8223aa640 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -231,7 +231,7 @@ class CacheSystem { // Is the cache file there? if ($this->isCacheReadable()) { // Load cache file - require($this->fqfn); + include($this->fqfn); // Is there an array? if (isset($this->data[$this->name])) { @@ -257,7 +257,7 @@ class CacheSystem { } else { // Cache file not found or not readable debug_report_bug($this->name); - addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".sprintf(getMessage('CACHE_CANNOT_LOAD'), $this->fqfn)); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".getMaskedMessage('CACHE_CANNOT_LOAD', $this->fqfn)); // Try to remove it $this->removeCacheFile(); @@ -312,7 +312,7 @@ class CacheSystem { $this->rebuilt[$this->name] = true; } else { // Not removed! - addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".sprintf(getMessage('CACHE_CANNOT_UNLINK'), $this->fqfn)); + addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".getMaskedMessage('CACHE_CANNOT_UNLINK', $this->fqfn)); } } // END - if } diff --git a/inc/classes/rdf.class.php b/inc/classes/rdf.class.php index 95190ff85b..17de9f14c8 100644 --- a/inc/classes/rdf.class.php +++ b/inc/classes/rdf.class.php @@ -664,7 +664,7 @@ class fase4_rdf { } $this->_output .= "_citem['link']."\" "; if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; } - $this->_output .= ">".$this->_cut_string($this->_citem['link']).""; + $this->_output .= ">".$this->_cut_string($this->_citem['link']) . ''; $this->_output .= "\n"; $this->_output .= "
\n"; $this->_output .= ""; diff --git a/inc/config-global.php b/inc/config-global.php index b7e8169743..e86fd7328d 100644 --- a/inc/config-global.php +++ b/inc/config-global.php @@ -61,7 +61,7 @@ $PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3)); // Some very important function includes foreach (array('config','wrapper','inc','stats') as $inc) { - require($PATH . 'inc/' . $inc . '-functions.php'); + include($PATH . 'inc/' . $inc . '-functions.php'); } // END - foreach // Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!) diff --git a/inc/databases.php b/inc/databases.php index 50455b04a3..3f211dc098 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -42,40 +42,40 @@ if (!defined('__SECURITY')) { } // END - if // System-wide return codes -addCode('WRONG_PASS' , 0x001); -addCode('WRONG_ID' , 0x002); -addCode('STATUS_LOCKED' , 0x003); -addCode('STATUS_UNCONFIRMED', 0x004); -addCode('UNKNOWN_STATUS' , 0x005); -addCode('CNTR_FAILED' , 0x008); -addCode('LOGOUT_DONE' , 0x008); -addCode('LOGOUT_FAILED' , 0x009); -addCode('URL_TLOCK' , 0x00a); -addCode('URL_FOUND' , 0x00b); -addCode('OVERLENGTH' , 0x00c); -addCode('SUBJ_URL' , 0x00d); -addCode('BLIST_URL' , 0x00e); -addCode('NO_RECS_LEFT' , 0x00f); -addCode('INVALID_TAGS' , 0x010); -addCode('MORE_POINTS' , 0x011); -addCode('COOKIES_DISABLED' , 0x012); -addCode('DATA_INVALID' , 0x013); -addCode('POSSIBLE_INVALID' , 0x014); -addCode('ACCOUNT_LOCKED' , 0x015); -addCode('USER_404' , 0x016); -addCode('STATS_404' , 0x017); -addCode('ALREADY_CONFIRMED' , 0x018); -addCode('ERROR_MAILID' , 0x019); -addCode('EXTENSION_PROBLEM' , 0x01a); -addCode('MORE_RECEIVERS1' , 0x01b); -addCode('MORE_RECEIVERS2' , 0x01c); -addCode('MORE_RECEIVERS3' , 0x01d); -addCode('INVALID_URL' , 0x01e); -addCode('MENU_NOT_VALID' , 0x01f); -addCode('LOGIN_FAILED' , 0x020); -addCode('BEG_SAME_AS_OWN' , 0x021); -addCode('UNHANDLED_STATUS' , 0x022); -addCode('MODULE_MEM_ONLY' , 0x023); +addCode('WRONG_PASS' , 0x001); +addCode('WRONG_ID' , 0x002); +addCode('ACCOUNT_LOCKED' , 0x003); +addCode('ACCOUNT_UNCONFIRMED', 0x004); +addCode('UNKNOWN_STATUS' , 0x005); +addCode('CNTR_FAILED' , 0x008); +addCode('LOGOUT_DONE' , 0x008); +addCode('LOGOUT_FAILED' , 0x009); +addCode('URL_TLOCK' , 0x00a); +addCode('URL_FOUND' , 0x00b); +addCode('OVERLENGTH' , 0x00c); +addCode('SUBJ_URL' , 0x00d); +addCode('BLIST_URL' , 0x00e); +addCode('NO_RECS_LEFT' , 0x00f); +addCode('INVALID_TAGS' , 0x010); +addCode('MORE_POINTS' , 0x011); +addCode('COOKIES_DISABLED' , 0x012); +addCode('DATA_INVALID' , 0x013); +addCode('POSSIBLE_INVALID' , 0x014); +addCode('USER_404' , 0x016); +addCode('STATS_404' , 0x017); +addCode('ALREADY_CONFIRMED' , 0x018); +addCode('ERROR_MAILID' , 0x019); +addCode('EXTENSION_PROBLEM' , 0x01a); +addCode('MORE_RECEIVERS1' , 0x01b); +addCode('MORE_RECEIVERS2' , 0x01c); +addCode('MORE_RECEIVERS3' , 0x01d); +addCode('INVALID_URL' , 0x01e); +addCode('MENU_NOT_VALID' , 0x01f); +addCode('LOGIN_FAILED' , 0x020); +addCode('BEG_SAME_AS_OWN' , 0x021); +addCode('UNHANDLED_STATUS' , 0x022); +addCode('MODULE_MEM_ONLY' , 0x023); +addCode('UNKNOWN_ERROR' , 0x024); // Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!) setConfigEntry('SERVER_URL', 'http://www.mxchange.org'); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index ab53b7041b..735e6dd899 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -285,7 +285,7 @@ function SQL_QUERY_ESC ($qstring, $data, $F, $L, $run=true, $strip=true, $secure // Debugging // //* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!"); - //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n"); + //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", ' ', $eval))."\n"); //* DEBUG: */ fclose($fp); if ($run === true) { diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index e1ccca57d1..e26f462871 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -475,19 +475,19 @@ function isExtensionActive ($ext_name) { if ((isInstallationPhase()) || (empty($ext_name))) return false; // Not active is the default - $active = 'N'; + $data['ext_active'] = 'N'; // Check cache if (isset($GLOBALS['cache_array']['extension']['ext_active'][$ext_name])) { // Load from cache //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "CACHE! ext_name={$ext_name}"); - $active = $GLOBALS['cache_array']['extension']['ext_active'][$ext_name]; + $data['ext_active'] = $GLOBALS['cache_array']['extension']['ext_active'][$ext_name]; // Count cache hits incrementStatsEntry('cache_hits'); } elseif (isset($GLOBALS['ext_loaded'][$ext_name])) { // @TODO Extension is loaded, what next? - app_die(__FUNCTION__, __LINE__, "LOADED:$ext_name"); + app_die(__FUNCTION__, __LINE__, 'LOADED:' . $ext_name); } elseif (($ext_name == 'cache') || (!isExtensionInstalled('cache'))) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}"); // Load from database @@ -497,15 +497,15 @@ function isExtensionActive ($ext_name) { // Entry found? if (SQL_NUMROWS($result) == 1) { // Load entry - list($active) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); } // END - if // Free result SQL_FREERESULT($result); // Write cache array - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name."[DB]: {$active}"); - $GLOBALS['cache_array']['extension']['ext_active'][$ext_name] = $active; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name."[DB]: ".$data['ext_active'].""); + $GLOBALS['cache_array']['extension']['ext_active'][$ext_name] = $data['ext_active']; } else { // Extension not active! //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name.": Not active!"); @@ -513,16 +513,16 @@ function isExtensionActive ($ext_name) { } // Debug message - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name={$ext_name},active={$active}"); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name.",active=".$data['ext_active'].""); // Is this extension activated? (For admins we always have active extensions...) - return ($active == 'Y'); + return ($data['ext_active'] == 'Y'); } // Get version from extensions function getExtensionVersion ($ext_name, $force = false) { // By default no extension is found - $ext_ver = 'false'; + $data['ext_version'] = 'false'; // Empty extension name should be fixed! if (empty($ext_name)) { @@ -532,13 +532,13 @@ function getExtensionVersion ($ext_name, $force = false) { // Extensions are all inactive during installation if (isInstallationPhase()) return ''; - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ext_name={$ext_name}"); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ext_name=".$ext_name.""); // Is the cache written? if (isset($GLOBALS['cache_array']['extension']['ext_version'][$ext_name])) { // Load data from cache //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": CACHE!"); - $ext_ver = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name]; + $data['ext_version'] = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name]; // Count cache hits incrementStatsEntry('cache_hits'); @@ -551,7 +551,7 @@ function getExtensionVersion ($ext_name, $force = false) { // Is the extension there? if (SQL_NUMROWS($result) == 1) { // Load entry - list($ext_ver) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); } elseif (isDebugModeEnabled()) { // Not found! logDebugMessage(__FUNCTION__, __LINE__, sprintf(": Cannot find extension %s in database!", $ext_name)); @@ -561,18 +561,18 @@ function getExtensionVersion ($ext_name, $force = false) { SQL_FREERESULT($result); // Set cache - $GLOBALS['cache_array']['extension']['ext_version'][$ext_name] = $ext_ver; + $GLOBALS['cache_array']['extension']['ext_version'][$ext_name] = $data['ext_version']; } // Extension version should not be invalid - if (($ext_ver == 'false') && ($force === false)) { + if (($data['ext_version'] == 'false') && ($force === false)) { // Please report this trouble debug_report_bug(sprintf("Extension %s has empty version!", $ext_name)); } // END - if // Return result - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ret={$ext_ver}"); - return $ext_ver; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ret={$data['ext_version']}"); + return $data['ext_version']; } // Updates a given extension with current extension version to latest version @@ -730,12 +730,12 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false // Get extension name from id function getExtensionName ($ext_id) { // Init extension name - $ret = ''; + $data['ext_name'] = ''; // Is cache there? if (isset($GLOBALS['cache_array']['extension']['ext_name'][$ext_id])) { // Load from cache - $ret = $GLOBALS['cache_array']['extension']['ext_name'][$ext_id]; + $data['ext_name'] = $GLOBALS['cache_array']['extension']['ext_name'][$ext_id]; // Count cache hits incrementStatsEntry('cache_hits'); @@ -747,7 +747,7 @@ function getExtensionName ($ext_id) { // Is the entry there? if (SQL_NUMROWS($result) == 1) { // Get the extension's name from database - list($ret) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); } // END - if // Free result @@ -755,47 +755,47 @@ function getExtensionName ($ext_id) { } // Did we find some extension? - if (empty($ret)) { + if (empty($data['ext_name'])) { // We should fix these all! debug_report_bug(__FUNCTION__ . ': ext_name is empty. ext_id=' . $ext_id); } // END - if // Return the extension name - return $ret; + return $data['ext_name']; } // Get extension id from name function getExtensionId ($ext_name) { // Init id number - $ret = '0'; + $data['ext_id'] = '0'; // Do we have cache? if (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) { // Load from cache - $ret = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name]; + $data['ext_id'] = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name]; // Count cache hits incrementStatsEntry('cache_hits'); } else { // Load from database - $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id` AS ext_id FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", array($ext_name), __FUNCTION__, __LINE__); // Is the entry there? if (SQL_NUMROWS($result) == 1) { // Get the extension's id from database - list($ret) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); } // END - if // Free result SQL_FREERESULT($result); // Cache it - $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $ret; + $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $data['ext_id']; } // Return value - return $ret; + return $data['ext_id']; } // Determines wether the given extension name is valid @@ -906,7 +906,7 @@ function createNewExtensionTask ($adminId, $subject, $ext) { // Not installed and do we have created a task for the admin? if ((determineTaskIdBySubject($subject) == '0') && (!isExtensionInstalled($ext))) { // Set default message if ext-foo is missing - $message = sprintf(getMessage('ADMIN_EXT_TEXT_FILE_MISSING'), $ext); + $message = getMaskedMessage('ADMIN_EXT_TEXT_FILE_MISSING', $ext); // Template file $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl", @@ -969,13 +969,13 @@ function ifModuleHasMenu ($mod, $forceDb = false) { // Entry found? if (SQL_NUMROWS($result) == 1) { // Load "has_menu" column - list($has_menu) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); // Fake cache... ;-) - $GLOBALS['cache_array']['extension']['ext_menu'][$mod] = $has_menu; + $GLOBALS['cache_array']['extension']['ext_menu'][$mod] = $data['has_menu']; // Does it have a menu? - $ret = ($has_menu == 'Y'); + $ret = ($data['has_menu'] == 'Y'); } // END - if // Free memory @@ -993,45 +993,45 @@ function ifModuleHasMenu ($mod, $forceDb = false) { // Determines the task id for given extension function determineExtensionTaskId ($ext_name) { // Default is not found - $task_id = '0'; + $data['task_id'] = '0'; // Search for extension task's id - $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `task_type`='EXTENSION' AND `subject`='[%s:]' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id` AS task_id FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `task_type`='EXTENSION' AND `subject`='[%s:]' LIMIT 1", array($ext_name), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { // Task found so load task's id and register extension... - list($task_id) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); } // END - if // Free result SQL_FREERESULT($result); // Return it - return $task_id; + return $data['task_id']; } // Determines the task id for given subject function determineTaskIdBySubject ($subject) { // Default is not found - $task_id = '0'; + $data['task_id'] = '0'; // Search for task id - $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id` AS task_id FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1", array($subject), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { // Task found so load task's id and register extension... - list($task_id) = SQL_FETCHROW($result); + $data = SQL_FETCHARRAY($result); } // END - if // Free result SQL_FREERESULT($result); // Return it - return $task_id; + return $data['task_id']; } // Add updates notes for given version diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 733922c5ff..7b8b8b98f9 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -42,10 +42,10 @@ if (!defined('__SECURITY')) { } // END - if // Version of this extension -setThisExtensionVersion('0.7.2'); +setThisExtensionVersion('0.7.3'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2')); +setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3')); // Keep this extension always active! setExtensionAlwaysActive('Y'); @@ -63,7 +63,7 @@ switch (getExtensionMode()) { addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='admins'"); addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`"); addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP default_acl"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`"); // Remove filters unregisterFilter('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, getExtensionDryRun()); @@ -308,6 +308,14 @@ PRIMARY KEY (id) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Schreibweise korregiert."); break; + + case '0.7.3': // SQL queries for v0.7.2 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD `expert_settings` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` ADD `expert_warning` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Experten-Einstellungen sind nun hinzugekommen."); + break; } // END - switch break; diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 91cbff0767..a53cb55f99 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -230,7 +230,7 @@ switch (getExtensionMode()) { case '0.2.4': // SQL queries for v0.2.4 // SQL commands to run - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_cache')"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_cache' LIMIT 1"); // Remove config entries addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `cache_themes`"); diff --git a/inc/filters.php b/inc/filters.php index 8cc35e4293..b3c41423c4 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -509,7 +509,7 @@ function FILTER_COMPILE_EXTENSION ($code) { // User data found $functionName = "getFetchedUserData('userid', " . $matches[4][$key] . ", " . $callback . "')"; } // END - if - } elseif ((!empty($callback)) && (isMember())) { + } elseif ((!empty($callback)) && (isUserDataValid())) { // "Call-back" alias column for current logged in user's data $functionName = "getUserData('" . $callback . "')"; } diff --git a/inc/functions.php b/inc/functions.php index cc3c83d5f3..41789fdc06 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -750,7 +750,7 @@ function translateYesNo ($yn) { // Translates the "pool type" into human-readable function translatePoolType ($type) { // Default?type is unknown - $translated = sprintf(getMessage('POOL_TYPE_UNKNOWN'), $type); + $translated = getMaskedMessage('POOL_TYPE_UNKNOWN', $type); // Generate constant $constName = sprintf("POOL_TYPE_%s", $type); @@ -841,7 +841,7 @@ function translateUserStatus ($status) { default: logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status)); - $ret = sprintf(getMessage('UNKNOWN_STATUS'), $status); + $ret = getMaskedMessage('UNKNOWN_STATUS', $status); break; } // END - switch @@ -1476,7 +1476,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = if (ereg('Y', $display) || (empty($display))) { // Generate year selection - $OUT .= " \n"; for ($idx = '0'; $idx <= 10; $idx++) { $OUT .= "