From: Roland Häder Date: Wed, 29 Jun 2011 00:51:11 +0000 (+0000) Subject: Extension ext-coupon continued, naming convention, many improvements: X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=964a3b539e335f6d70e7779630fd3d25fd38398d Extension ext-coupon continued, naming convention, many improvements: - Extension ext-coupon: Nearly finished, only listing of cashed coupons and a little in admin area! - Foder 'inc/autopurge/ renamed to 'inc/purge/ to avoid naming conflicts - Some language constants renamed to make clear they belong to config area - A lot more improvements on many places (I cannot remember all) - TODOs.txt updated --- diff --git a/.gitattributes b/.gitattributes index 254726a057..5ada37c7a4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -208,6 +208,7 @@ inc/filter/admins_filter.php svneol=native#text/plain inc/filter/bonus_filter.php svneol=native#text/plain inc/filter/booking_filter.php svneol=native#text/plain inc/filter/cache_filter.php svneol=native#text/plain +inc/filter/coupon_filter.php svneol=native#text/plain inc/filter/mediadata_filter.php svneol=native#text/plain inc/filter/online_filter.php svneol=native#text/plain inc/filter/other_filter.php svneol=native#text/plain @@ -713,6 +714,13 @@ inc/pool/.htaccess svneol=native#text/plain inc/pool/pool- svneol=native#text/plain inc/pool/pool-bonus.php svneol=native#text/plain inc/pool/pool-user.php svneol=native#text/plain +inc/purge/.htaccess svneol=native#text/plain +inc/purge/purge- svneol=native#text/plain +inc/purge/purge-general.php svneol=native#text/plain +inc/purge/purge-inact.php svneol=native#text/plain +inc/purge/purge-mails.php svneol=native#text/plain +inc/purge/purge-tasks.php svneol=native#text/plain +inc/purge/purge-unconfirmed.php svneol=native#text/plain inc/request-functions.php svneol=native#text/plain inc/reset/.htaccess svneol=native#text/plain inc/reset/reset_ svneol=native#text/plain @@ -769,6 +777,8 @@ templates/de/emails/admin/admin_autopurge_points.tpl svneol=native#text/plain templates/de/emails/admin/admin_autopurge_tsks.tpl svneol=native#text/plain templates/de/emails/admin/admin_autopurge_turbo.tpl svneol=native#text/plain templates/de/emails/admin/admin_autopurge_unconfirmed.tpl svneol=native#text/plain +templates/de/emails/admin/admin_coupon.tpl svneol=native#text/plain +templates/de/emails/admin/admin_coupon_cashed.tpl svneol=native#text/plain templates/de/emails/admin/admin_del_surfbar_urls.tpl svneol=native#text/plain templates/de/emails/admin/admin_edit_surfbar_urls.tpl svneol=native#text/plain templates/de/emails/admin/admin_extension_deactivated.tpl svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index f0b3a5452d..82f9135702 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -3,7 +3,6 @@ ./autoreg.php:58:// @TODO Add processing of request here ./beg.php:171: // @TODO Opps, what is missing here??? ./birthday_confirm.php:93: // @TODO Try to rewrite the following unset() -./inc/autopurge/purge-inact.php:55: // @TODO Rewrite these if() blocks to a filter ./inc/cache/config-local.php:124:// @TODO Rewrite the following three constants, somehow... ./inc/classes/cachesystem.class.php:501: // @TODO Add support for more types which break in last else-block ./inc/config-functions.php:136: // @TODO Make this all better... :-/ @@ -42,18 +41,18 @@ ./inc/extensions/ext-yoomedia.php:121: // @TODO Can this be moved into a database table? ./inc/extensions/ext-yoomedia.php:54:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y'); ./inc/extensions-functions.php:155: // @TODO Do we still need this? setExtensionUpdateNotes(''); -./inc/extensions-functions.php:1933:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable' -./inc/extensions-functions.php:437:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) -./inc/extensions-functions.php:567: // @TODO Extension is loaded, what next? -./inc/filter/bonus_filter.php:55: // @TODO This query isn't right, it will only update if the user was for a longer time away! -./inc/filter/cache_filter.php:78: // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal. -./inc/functions.php:1226: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? -./inc/functions.php:1314: // @TODO Are these convertions still required? -./inc/functions.php:1332:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/extensions-functions.php:1927:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable' +./inc/extensions-functions.php:424:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) +./inc/extensions-functions.php:554: // @TODO Extension is loaded, what next? +./inc/filter/bonus_filter.php:56: // @TODO This query isn't right, it will only update if the user was for a longer time away! +./inc/filter/cache_filter.php:92: // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal. +./inc/functions.php:1230: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? +./inc/functions.php:1318: // @TODO Are these convertions still required? +./inc/functions.php:1336:// @TODO Rewrite this function to use readFromFile() and writeToFile() ./inc/functions.php:163:// @TODO Rewrite this to an extension 'smtp' -./inc/functions.php:1914: // @TODO Find a way to cache this -./inc/functions.php:2015: // @TODO This is still very static, rewrite it somehow -./inc/functions.php:2195: // @TODO Rename column data_type to e.g. mail_status +./inc/functions.php:1918: // @TODO Find a way to cache this +./inc/functions.php:2019: // @TODO This is still very static, rewrite it somehow +./inc/functions.php:2199: // @TODO Rename column data_type to e.g. mail_status ./inc/functions.php:92: // @TODO Extension 'msg' does not exist ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); @@ -167,7 +166,6 @@ ./inc/modules/member/what-beg.php:54:// @TODO Can't this be moved into EL? ./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout())); ./inc/modules/member/what-bonus.php:55: // @TODO Rewrite this to a filter -./inc/modules/member/what-cash_coupon.php:56: // @TODO ./inc/modules/member/what-categories.php:131: // @TODO Rewrite this to use $OUT .= ... ./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter * ./inc/modules/member/what-order.php:427: // @TODO Rewrite this to a filter @@ -192,6 +190,7 @@ ./inc/mysql-manager.php:2001:// @TODO Fix inconsistency between last_module and getWhat() ./inc/mysql-manager.php:368: // @TODO Try to rewrite this to one or more functions ./inc/mysql-manager.php:44:// @TODO Can we cache this? +./inc/purge/purge-inact.php:55: // @TODO Rewrite these if() blocks to a filter ./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array' ./inc/template-functions.php:1055: // @TODO Deprecate this thing ./inc/template-functions.php:1066: // @TODO Deprecate this thing @@ -233,6 +232,11 @@ ./templates/de/html/member/member_unconfirmed_table_nopoints.tpl:11: ./templates/de/html/surfbar/surfbar_frame_textlinks.tpl:5: ### ### DEPRECATION FOLLOWS: ### ### +./inc/autopurge/purge-general.php:2:// @DEPRECATED +./inc/autopurge/purge-inact.php:2:// @DEPRECATED +./inc/autopurge/purge-mails.php:2:// @DEPRECATED +./inc/autopurge/purge-tsks.php:2:// @DEPRECATED +./inc/autopurge/purge-unconfirmed.php:2:// @DEPRECATED ./inc/daily/daily_engine.php:2:// @DEPRECATED ./inc/loader/load_cache-admin.php:2:// @DEPRECATED ./inc/loader/load_cache-config.php:2:// @DEPRECATED diff --git a/beg.php b/beg.php index e46a44d872..89775b185c 100644 --- a/beg.php +++ b/beg.php @@ -149,7 +149,7 @@ if (isGetRequestParameterSet('userid')) { $content['message'] = loadTemplate('beg_login', true, $content); } elseif (getBegPayMode() != 'NONE') { // Other pay-mode active! // Load message template depending on pay-mode - $content['message'] = loadTemplate('beg_pay_mode_'.strtolower(getBegPayMode()), true, $content); + $content['message'] = loadTemplate('beg_pay_mode_' . strtolower(getBegPayMode()), true, $content); $pay = true; } else { // Clicked received while reload lock is active @@ -173,7 +173,7 @@ if (isGetRequestParameterSet('userid')) { ); // Include config-depending template - loadTemplate('beg_pay_code_'.strtolower(getBegPayMode()), false, $content); + loadTemplate('beg_pay_code_' . strtolower(getBegPayMode()), false, $content); } elseif (($pay === false) && (!isset($content['message']))) { // Cannot pay! :-( $content['message'] = loadTemplate('beg_failed', true); diff --git a/inc/autopurge/purge- b/inc/autopurge/purge- index f18db95d9d..f551ef47b7 100644 --- a/inc/autopurge/purge- +++ b/inc/autopurge/purge- @@ -1,50 +1,3 @@ diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index 30c18977e4..f551ef47b7 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -1,155 +1,3 @@ 0) { - // Init SQLs - initSqls(); - - // Init variables - $admin_points = '0'; - - // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted. - $result = SQL_QUERY('SELECT - s.id, s.userid, s.pool_id, t.price -FROM - `{?_MYSQL_PREFIX?}_user_stats` AS s -LEFT JOIN - `{?_MYSQL_PREFIX?}_payments` AS t -ON - s.`payment_id`=t.`id` -WHERE - (UNIX_TIMESTAMP() - s.`timestamp_ordered`) >= {?auto_purge?} -ORDER BY - s.userid ASC', __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result)) { - // Start deleting procedure - $userid = '0'; $points = '0'; - while ($content = SQL_FETCHARRAY($result)) { - // Check if confirmation links are purged or not - $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s LIMIT 1", - array(bigintval($content['id'])), __FILE__, __LINE__); - if (SQL_NUMROWS($result_links) == 1) { - // Free memory - SQL_FREERESULT($result_links); - - // At least one link was found, enougth to pay back the points - if (($userid != $content['userid']) && (isValidUserId($userid)) && ($points > 0)) { - // Directly add points back to senders account - addPointsAutoPurge($userid, $points); - $points = '0'; - } // END - if - - // Add points - $userid = $content['userid']; $points += $content['price']; $admin_points += $content['price']; - - // Remove confirmation links from queue - addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s", - array(bigintval($content['id'])), __FILE__, __LINE__, false)); - - // Update status of order - addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='DELETED' WHERE `id`=%s LIMIT 1", - array(bigintval($content['pool_id'])), __FILE__, __LINE__, false)); - } // END - if - } // END - while - - // Add last points to last user account - if ($points > 0) addPointsAutoPurge($userid, $points); - } // END - if - - // Free memory - SQL_FREERESULT($result); - - // Is the 'bonus' extension installed and activated? - if (isExtensionActive('bonus', true)) { - // Check for bonus campaigns - $result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result)) { - // Start deleting procedure - $points = '0'; - while ($content = SQL_FETCHARRAY($result)) { - // Check if confirmation links are purged or not - $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s", - array(bigintval($content['id'])), __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result_links)) { - // At least one link was found, enougth to pay back the points - $points += $content['points'] * SQL_NUMROWS($result_links); - - // Free memory - SQL_FREERESULT($result_links); - - // Remove confirmation links from queue - addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s", - array(bigintval($content['id'])), __FILE__, __LINE__, false)); - - // Update status of order - addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='DELETED' WHERE `id`=%s LIMIT 1", - array(bigintval($content['id'])), __FILE__, __LINE__, false)); - } // END - if - } // END - while - - // Add points to jackpot - if (isExtensionActive('jackpot')) addPointsToJackpot($points); - - // Add points for the admin - $admin_points += $points; - } // END - if - - // Free memory - SQL_FREERESULT($result); - } // END - if - - // Add points from deleted accounts to jackpot, but here just add to notify mail - if ($admin_points > 0) { - // Send mail to admin - sendAdminNotification('{--ADMIN_AUTOPURGE_SUBJECT--}', 'admin_autopurge_points', $admin_points); - } // END - if - - // Run all SQLs here - runFilterChain('run_sqls'); -} // END - if - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index 917ff93dd1..f551ef47b7 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -1,168 +1,3 @@ = {?ap_inactive_since?} AND - (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?} AND - (UNIX_TIMESTAMP() - `ap_notified`) >= {?ap_inactive_since?} - " . $EXCLUDE_LIST . " -ORDER BY - `userid` ASC", __FILE__, __LINE__); - - if (!SQL_HASZERONUMS($result_inactive)) { - // Prepare variables and constants... - $useridsContent = ''; - $content['since'] = (getApInactiveSince() / 60 / 60); - $content['time'] = (getApInactiveTime() / 60 / 60); - - // Mark found accounts as inactive and send an email - while ($row = SQL_FETCHARRAY($result_inactive)) { - // Merge both arrays - $content = merge_array($content, $row); - - // Remember userids for the admin - $useridsContent .= $content['userid'] . ', '; - - // Get date/time from timestamp - $content['last_online'] = generateDateTime($content['last_online'], 0); - - // Load mail template - $message = loadEmailTemplate('member_autopurge_inactive', $content, bigintval($content['userid'])); - sendEmail($content['email'], '{--MEMBER_AUTOPURGE_INACTIVE_SUBJECT--}', $message); - - // Update this account - addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ap_notified`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", - array(bigintval($content['userid'])), __FILE__, __LINE__, false)); - } // END - while - - // Remove last comma - $useridsContent = str_replace(', ', "\n", substr($useridsContent, 0, -2)); - - // Send mail notification to admin - sendAdminNotification('{--ADMIN_AUTOPURGE_INACTIVE_SUBJECT--}', 'admin_autopurge_inactive', $useridsContent); - } // END - if - - // Free memory - SQL_FREERESULT($result_inactive); - - // Now let's have a look for inactive accounts we want to delete we newly use the same exclude list - // here for e.g. excluding holiday users - $result_inactive = SQL_QUERY("SELECT - `userid`, `email`, `last_online` -FROM - `{?_MYSQL_PREFIX?}_user_data` -WHERE - `status`='CONFIRMED' AND - (UNIX_TIMESTAMP() - `joined`) >= {?ap_inactive_since?} AND - (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?} AND - (UNIX_TIMESTAMP() - `ap_notified`) >= {?ap_inactive_time?} -" . $EXCLUDE_LIST . " -ORDER BY - `userid` ASC", __FILE__, __LINE__); - - if (!SQL_HASZERONUMS($result_inactive)) { - // Prepare userid array for admin... - $userids = array(); - - // Delete inactive accounts - while ($content = SQL_FETCHARRAY($result_inactive)) { - // Remember userids for the admin - $useridsContent[] = $content['userid']; - - // Get date/time from timestamp - $content['last_online'] = generateDateTime($content['last_online'], 0); - - // Finnaly delete this inactive account - deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_delete', $content['last_online'], '')); - } // END - while - - // Display all userids - $useridsContent = implode("\n", $userids); - - // Send mail notification to admin - if (getConfig('ap_in_notify') == 'Y') { - sendAdminNotification('{--ADMIN_AUTOPURGE_DELETE_SUBJECT--}', 'admin_autopurge_delete', $useridsContent); - } // END - if - } // END - if - - // Free memory - SQL_FREERESULT($result_inactive); - - // Run all SQLs - runFilterChain('run_sqls'); -} // END - if - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 61f911bdfa..f551ef47b7 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -1,139 +1,3 @@ = {?ap_dm_timeout?} -ORDER BY - `sender` ASC", __FILE__, __LINE__); - -// Reset counter... -$deletedStats = '0'; - -// Do we have "purged" mails? -if (!SQL_HASZERONUMS($result_mails)) { - // Okay, check for their sender's - while ($content = SQL_FETCHARRAY($result_mails)) { - // Check now... - if (!fetchUserData($content['sender'])) { - // Okay we found some mails! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s", - array(bigintval($content['sender'])), __FILE__, __LINE__); - - // Get all affected (deleted) rows - $deletedStats += SQL_AFFECTEDROWS(); - - // Reset query (to prevent possible errors) ...; - $result_mails = SQL_QUERY("SELECT - `sender` -FROM - `{?_MYSQL_PREFIX?}_pool` -WHERE - `data_type`='DELETED' AND - (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?} -ORDER BY - `sender` ASC", __FILE__, __LINE__); - } // END - if - } // END - while -} // END - if - -// Free memory -SQL_FREERESULT($result_mails); - -// Now let's check for stats entries as well; -$result_mails = SQL_QUERY("SELECT - `userid` AS `sender` -FROM - `{?_MYSQL_PREFIX?}_user_stats` -WHERE - (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?} -ORDER BY - `userid` ASC", __FILE__, __LINE__); - -// Do we have "purged" mails? -if (!SQL_HASZERONUMS($result_mails)) { - // Okay, check for their sender's - while ($content = SQL_FETCHARRAY($result_mails)) { - // Check now... - if (!fetchUserData($content['sender'])) { - // Okay we found some mails! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid`=%s", - array(bigintval($content['sender'])), __FILE__, __LINE__); - - // Get all affected (deleted) rows - $deletedStats += SQL_AFFECTEDROWS(); - - // Reset query (to prevent possible errors) ... - $result_mails = SQL_QUERY("SELECT - `userid` AS `sender` -FROM - `{?_MYSQL_PREFIX?}_user_stats` -WHERE - (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?} -ORDER BY - `userid` ASC", __FILE__, __LINE__); - } // END - if - } // END - while -} // END - if - -// Free memory -SQL_FREERESULT($result_mails); - -// Do we have deleted mails and the admin want's to receive a notification -if (($deletedStats > 0) && (getConfig('ap_dm_notify') == 'Y')) { - // Send out email to admin - sendAdminNotification('{--ADMIN_AUTOPURGE_DELETE_MAILS_SUBJECT--}', 'admin_autopurge_del_mails', $deletedStats); -} // END - if - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php index cc5ccd156f..f551ef47b7 100644 --- a/inc/autopurge/purge-tsks.php +++ b/inc/autopurge/purge-tsks.php @@ -1,70 +1,3 @@ = 0.1.9) -if ((isExtensionInstalledAndNewer('task', '0.1.9')) && (getConfig('autopurge_tasks') == 'Y')) { - // Purge deleted tasks (no notification to admin) - SQL_QUERY("DELETE LOW_PRIORITY -FROM - `{?_MYSQL_PREFIX?}_task_system` -WHERE - `status`='DELETED' AND - (UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__); - - // Get deleted rows - $deletedTasks = SQL_AFFECTEDROWS(); - - // Do we need to send a notification? - if (($deletedTasks > 0) && (getConfig('ap_tasks_notify') == 'Y')) { - // Send out email to admin - sendAdminNotification('{--ADMIN_AUTOPURGE_TASKS_SUBJECT--}', 'admin_autopurge_tsks', $deletedTasks); - } // END - if -} // END - if - -// +// @DEPRECATED ?> diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index c4eed02a77..f551ef47b7 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -1,95 +1,3 @@ = {?ap_unconfirmed_time?} -ORDER BY - `userid` ASC", __FILE__, __LINE__); - if (!SQL_HASZERONUMS($result_uncon)) { - // Prepare variable... - $userids = ''; - $content['time'] = (getApUnconfirmedTime() / 60 / 60); - - // Delete inactive accounts - while ($row = SQL_FETCHARRAY($result_uncon)) { - // Merge both arrays - $content = merge_array($content, $row); - - // Remember userids for the admin - $userids .= $content['userid'] . ', '; - - // Get date/time from timestamp - $content['joined'] = generateDateTime($content['joined'], 0); - - // Finnaly delete this inactive account - deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_unconfirmed', $content, '')); - } // END - while - - // Remove last comma - $userids = str_replace(', ', "\n", substr($userids, 0, -2)); - - // Send mail notification to admin - if (getConfig('ap_un_notify') == 'Y') { - sendAdminNotification('{--ADMIN_AUTOPURGE_UNCONFIRMED_SUBJECT--}', 'admin_autopurge_unconfirmed', $userids); - } // END - if - } // END - if - - // Free memory - SQL_FREERESULT($result_uncon); -} // END - if - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/daily/daily_autopurge.php b/inc/daily/daily_autopurge.php index 85d69c6979..46878b7611 100644 --- a/inc/daily/daily_autopurge.php +++ b/inc/daily/daily_autopurge.php @@ -51,7 +51,7 @@ if (!defined('__SECURITY')) { // Init & set the include pool initIncludePool('autopurge'); -setIncludePool('autopurge', getArrayFromDirectory('inc/autopurge/', 'purge-')); +setIncludePool('autopurge', getArrayFromDirectory('inc/purge/', 'purge-')); // Run the filter runFilterChain('load_includes', 'autopurge'); diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 9aca9cf414..a6a2e372cc 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -155,8 +155,7 @@ function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0', $dry_run = false // @TODO Do we still need this? setExtensionUpdateNotes(''); // Include the extension file - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension loaded.'); - loadExtensionInclude(); + loadCurrentExtensionInclude(); // Is this extension deprecated? if (isExtensionDeprecated()) { @@ -164,6 +163,7 @@ function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0', $dry_run = false doDeactivateExtension($ext_name); // Abort here + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension load aborted, ext_name=' . $ext_name); return false; } // END - if @@ -174,13 +174,14 @@ function loadExtension ($ext_name, $ext_mode, $ext_ver = '0.0', $dry_run = false } // END - if // All fine! + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension successfully loaded, ext_name=' . $ext_name); return true; } // Registeres an extension and possible update depencies -function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true) { +function registerExtension ($ext_name, $taskId, $dry_run = false) { // Set current extension name - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $taskId . ',dry_run=' . intval($dry_run) . ',logout=' . intval($logout) . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',task_id=' . $taskId . ',dry_run=' . intval($dry_run) . ' - ENTERED!'); setCurrentExtensionName($ext_name); // Enable dry-run @@ -198,7 +199,7 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true // When this extension is already in registration/update phase, all is fine if ((isExtensionRegistrationRunning($ext_name)) || (isExtensionUpdateRunning($ext_name))) { // Then abort here with 'true' becaus it is fine - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ' - ALREADY!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in registration/update phase, all fine.'); return true; } // END - if @@ -414,20 +415,6 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true array(bigintval($taskId)), __FUNCTION__, __LINE__); } - // Is this the sql_patches? - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName() . '/' . getExtensionMode()); - if ((getCurrentExtensionName() == 'sql_patches') && ((getExtensionMode() == 'register') || (getExtensionMode() == 'remove')) && (!isExtensionDryRun()) && ($test)) { - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName() . ': LOAD!'); - if ($logout === true) { - // Then redirect to logout - redirectToUrl('modules.php?module=admin&logout=1&' . getExtensionMode() . '=sql_patches'); - } else { - // Add temporary filter - registerFilter('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true); - $GLOBALS['ext_load_mode'] = getExtensionMode(); - } - } // END - if - // Return status code //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ',test=' . intval($test) . ' - EXIT!'); return $ret; @@ -600,6 +587,7 @@ function isExtensionActive ($ext_name) { // Get version from extensions function getExtensionVersion ($ext_name, $force = false) { // By default no extension is found + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - ENTERED!'); $data['ext_version'] = 'false'; // Empty extension name should be fixed! @@ -609,13 +597,15 @@ function getExtensionVersion ($ext_name, $force = false) { } // END - if // Extensions are all inactive during installation - if (isInstallationPhase()) return ''; - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name); + if (isInstallationPhase()) { + return ''; + } // END - if // Is the cache written? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - Checking cache ...'); if (isset($GLOBALS['cache_array']['extension']['ext_version'][$ext_name])) { // Load data from cache - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $ext_name . ': CACHE!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ': CACHE!'); $data['ext_version'] = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name]; // Count cache hits @@ -624,7 +614,7 @@ function getExtensionVersion ($ext_name, $force = false) { // Load from database $result = SQL_QUERY_ESC("SELECT `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", array($ext_name), __FUNCTION__, __LINE__); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $ext_name . ': DB - '.SQL_NUMROWS($result).''); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ': DB - '.SQL_NUMROWS($result).''); // Is the extension there? if (SQL_NUMROWS($result) == 1) { @@ -1206,27 +1196,29 @@ function isExtensionDeprecated () { // Setter for EXT_UPDATE_DEPENDS flag function addExtensionDependency ($updateDepends) { - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . '/' . $updateDepends . ' - ENTERED!'); // Is the update depency empty? (NEED TO BE FIXED!) + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . '/' . $updateDepends . ',extensionMode=' . getExtensionMode() . ' - ENTERED!'); if (empty($updateDepends)) { // Please report this bug! debug_report_bug(__FUNCTION__, __LINE__, 'updateDepends is empty: currentExtension=' . getCurrentExtensionName()); } // END - if // Is it not yet added? - /* Only for debugging! if ((isset($updateDepends, $GLOBALS['ext_running_updates'][getCurrentExtensionName()])) && (in_array($updateDepends, getExtensionUpdatesRunning()))) { - // Double-adding isn't fine, too - debug_report_bug(__FUNCTION__, __LINE__, '() called twice: updateDepends=' . $updateDepends . ',currentExtension=' . getCurrentExtensionName()); + /* + * Double-adding isn't fine, too. This may mean that + * addExtensionDependency() was called outside the switch() command in + * the extension's file which requires fixing. + */ + debug_report_bug(__FUNCTION__, __LINE__, 'updateDepends=' . $updateDepends . ',extensionMode=' . getExtensionMode() . ',currentExtension=' . getCurrentExtensionName() . ' - CALLED TWICE!'); } // END - if - */ // Add it to the list of extension update depencies map $GLOBALS['ext_update_depends'][getCurrentExtensionName()][] = (string) $updateDepends; // Remember it in the list of running updates $GLOBALS['ext_running_updates'][getCurrentExtensionName()][] = $updateDepends; - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . '/' . $updateDepends . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . '/' . $updateDepends . ',extensionMode=' . getExtensionMode() . ' - EXIT!'); } // Getter for running updates @@ -1293,9 +1285,9 @@ function isExtensionUpdateRunning ($ext_name) { foreach ($GLOBALS['ext_running_updates'] as $ext1=>$depends) { // Is it found? if (($ext1 == $ext_name) || ($isRunning === true)) { - // found - logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',isRunning=' . intval($isRunning)); + // Found $isRunning = true; + logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',isRunning=' . intval($isRunning)); break; } // END - if } // END - foreach @@ -1578,7 +1570,7 @@ function getExtensionMode () { // Setter for dry-run function enableExtensionDryRun ($dry_run = true) { - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getCurrentExtensionName()='.getCurrentExtensionName().',dry='.intval($dry_run)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getCurrentExtensionName()='.getCurrentExtensionName().',dry_run='.intval($dry_run)); $GLOBALS['ext_dry_run'] = (bool) $dry_run; } @@ -1678,8 +1670,8 @@ function ifExtensionHasLanguageFile ($ext_name) { return ($GLOBALS['cache_array']['extension']['ext_lang'][$ext_name] == 'Y'); } -// Load an extension's include file -function loadExtensionInclude () { +// Load current extension's include file +function loadCurrentExtensionInclude () { // Is it readable? if (!isExtensionIncludeReadable()) { // Not readable @@ -1696,7 +1688,9 @@ function loadExtensionInclude () { // Checks wether an extension is readable function isExtensionIncludeReadable ($ext_name = '') { // If empty, use current - if (empty($ext_name)) $ext_name = getCurrentExtensionName(); + if (empty($ext_name)) { + $ext_name = getCurrentExtensionName(); + } // END - if // Array found? if (!isset($GLOBALS['ext_inc_readable'][$ext_name])) { @@ -1904,7 +1898,7 @@ function addConfigAddSql ($columnName, $columnSql) { if (!isSqlTableColumnFound('{?_MYSQL_PREFIX?}_config', $columnName)) { // Not found, so add it addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `' . $columnName . '` ' . $columnSql); - } else { + } elseif (isDebugModeEnabled()) { // Add debug line logDebugMessage(__FUNCTION__, __LINE__, 'Configuration entry ' . $columnName . ' already created. columnSql=' . $columnSql); } @@ -1916,7 +1910,7 @@ function addConfigDropSql ($columnName) { if (isSqlTableColumnFound('{?_MYSQL_PREFIX?}_config', $columnName)) { // Found, so add it addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `' . $columnName . '`'); - } else { + } elseif (isDebugModeEnabled()) { // Add debug line, debug_report_bug() would cause some extenion updates fail logDebugMessage(__FUNCTION__, __LINE__, 'Configuration entry ' . $columnName . ' not found.'); } @@ -1976,6 +1970,7 @@ function markExtensionAsLoaded ($ext_name) { } // END - if // Mark it + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("ext_name=%s,ext_loaded=true", $ext_name)); $GLOBALS['ext_loaded']['ext_name'][$ext_name] = true; } diff --git a/inc/extensions/ext- b/inc/extensions/ext- index 050973d689..c4f29aaac5 100644 --- a/inc/extensions/ext- +++ b/inc/extensions/ext- @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run // Register module diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 53761d0557..c496295dc2 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -47,7 +47,7 @@ setThisExtensionVersion('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')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addGuestMenuSql('main', 'active', 'Heute Online', 'N', 'Y', 10); break; diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 784aa3c55c..63e00857dc 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('admins', NULL, 'Admin-Management','Administratoren anlegen, löschen oder Passwort/E-Mail Adresse ändern.',1); addAdminMenuSql('admins','admins_add','Admin hinzufügen','Neuen Admin-Account anlegen',0); diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php index 738226819b..25a48bfa2a 100644 --- a/inc/extensions/ext-admintheme1.php +++ b/inc/extensions/ext-admintheme1.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0'); setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Remove all other themes addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_extensions` WHERE ext_name LIKE 'admintheme%'"); addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `action`='stats' WHERE `what`='usr_online'"); diff --git a/inc/extensions/ext-admintheme_default.php b/inc/extensions/ext-admintheme_default.php index 911bd14f90..b3220a14bd 100644 --- a/inc/extensions/ext-admintheme_default.php +++ b/inc/extensions/ext-admintheme_default.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0'); setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Remove all other menu themes addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_extensions` WHERE ext_name LIKE 'admintheme%'"); addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `action`='misc' WHERE `what`='usr_online' LIMIT 1"); diff --git a/inc/extensions/ext-announcement.php b/inc/extensions/ext-announcement.php index b2e3a5eef7..e53bdce357 100644 --- a/inc/extensions/ext-announcement.php +++ b/inc/extensions/ext-announcement.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index 67db090c27..470ff3f036 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Add dependency to 'bonus' addExtensionDependency('bonus'); diff --git a/inc/extensions/ext-autoreg.php b/inc/extensions/ext-autoreg.php index b1e1944ba5..8fae4541be 100644 --- a/inc/extensions/ext-autoreg.php +++ b/inc/extensions/ext-autoreg.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index 34ebec5729..776ba805a9 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('bank_accounts'); addCreateTableSql('bank_accounts', "( diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index e05528c26b..c2e71c2fe6 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.2.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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('setup', 'config_beg', 'Bettel-Link', 'IP-Sperre, {OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Vergütung usw. können Sie hier einstellen.', 10); addGuestMenuSql('main', 'beg', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG} erbetteln!', 'N', 'Y', 4); diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 5e469e418d..796acfd902 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.3.9'); setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD birthday_sent VARCHAR(10) NOT NULL DEFAULT 0"); break; diff --git a/inc/extensions/ext-bitcoins.php b/inc/extensions/ext-bitcoins.php index 8d70c03de4..ed2142c40e 100644 --- a/inc/extensions/ext-bitcoins.php +++ b/inc/extensions/ext-bitcoins.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run // Register module diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index b62cd5c1fe..1eed289cda 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.9.4'); setExtensionVersionHistory(array('0.0', '0.1.6', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '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', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Add dependency to 'user' addExtensionDependency('user'); diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 4988be1bd6..5ec0c9e5c1 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Configuration entries addConfigAddSql('booking_per_page', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10'); addConfigAddSql('booking_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 3)); diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 25b0cb1434..13233c2aee 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -52,7 +52,7 @@ setExtensionAlwaysActive('Y'); // Which load mode? switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-clickbanner.php b/inc/extensions/ext-clickbanner.php index 424f9f2e5e..a43ac95a2e 100644 --- a/inc/extensions/ext-clickbanner.php +++ b/inc/extensions/ext-clickbanner.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 729594731d..a5a836bd36 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4')); setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('countries'); addCreateTableSql('countries', "( diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php index 6d3671a88e..7d8755c03b 100644 --- a/inc/extensions/ext-coupon.php +++ b/inc/extensions/ext-coupon.php @@ -52,13 +52,16 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installtion is running (modules.php?module=admin&action=login is called) + case 'register': // Do stuff when installtion is running + // This extension requires an up-to-date user + addExtensionDependency('user'); + // Coupon data addDropTableSql('coupon_data'); addCreateTableSql('coupon_data', "( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -`timestamp_expired` TIMESTAMP NULL DEFAULT NULL, +`coupon_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, +`coupon_expired` TIMESTAMP NULL DEFAULT NULL, `coupon_type` ENUM('CODE','API') NOT NULL DEFAULT 'CODE', `total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `total_used` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -83,6 +86,11 @@ UNIQUE KEY (`coupon_code`) // Configuration entries addConfigAddSql('coupon_default_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7)); addConfigAddSql('coupon_default_points', 'FLOAT(20,5) NOT NULL DEFAULT 100.00000'); + addConfigAddSql('coupon_points_account', "ENUM('ORDER','GENERAL') NOT NULL DEFAULT 'ORDER'"); + addConfigAddSql('coupon_payment_method', "ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'"); + addConfigAddSql('coupon_locked_points_mode', "ENUM('LOCKED','UNLOCKED') NOT NULL DEFAULT 'LOCKED'"); + addConfigAddSql('coupon_autopurge_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7)); + addConfigAddSql('coupon_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); // User data table addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `receiving_coupons` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); @@ -97,6 +105,9 @@ UNIQUE KEY (`coupon_code`) addMemberMenuSql('coupon', NULL, 'Gutscheine', 'N', 'Y', 3); addMemberMenuSql('coupon', 'cash_coupon', 'Gutschein einlösen', 'N', 'Y', 1); addMemberMenuSql('coupon', 'list_coupon', 'Eingelöste auflisten', 'N', 'Y', 2); + + // Add filter (for changing user_points column dynamically + registerFilter('determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', false, true, isExtensionDryRun()); break; case 'remove': // Do stuff when removing extension @@ -105,6 +116,9 @@ UNIQUE KEY (`coupon_code`) addDropTableSql('user_coupons'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='coupon' LIMIT 4"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='coupon' LIMIT 3"); + + // Remove all filters + unregisterFilter(__FUNCTION__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', true, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 7803430229..25f2357607 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -53,7 +53,7 @@ setExtensionAlwaysActive('Y'); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Table for debug log entries addDropTableSql('debug_log'); addCreateTableSql('debug_log', "( diff --git a/inc/extensions/ext-demo.php b/inc/extensions/ext-demo.php index 23d89452a9..ad9ffedd58 100644 --- a/inc/extensions/ext-demo.php +++ b/inc/extensions/ext-demo.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); break; diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 3d8d198149..bb4e32c14d 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.7'); 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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Doubler table addDropTableSql('doubler'); addCreateTableSql('doubler', "( diff --git a/inc/extensions/ext-events.php b/inc/extensions/ext-events.php index 47f72e0873..eadb461ee5 100644 --- a/inc/extensions/ext-events.php +++ b/inc/extensions/ext-events.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-forced.php b/inc/extensions/ext-forced.php index 8313a04b94..a1a7d95258 100644 --- a/inc/extensions/ext-forced.php +++ b/inc/extensions/ext-forced.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // This depends on 'sponsor' now addExtensionDependency('sponsor'); diff --git a/inc/extensions/ext-funcoins.php b/inc/extensions/ext-funcoins.php index bc9ff670b7..350e6d0d4e 100644 --- a/inc/extensions/ext-funcoins.php +++ b/inc/extensions/ext-funcoins.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-grade.php b/inc/extensions/ext-grade.php index 66cdb21fdc..fb76994de7 100644 --- a/inc/extensions/ext-grade.php +++ b/inc/extensions/ext-grade.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 5bf6efb985..6cf19ae602 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.2.1'); 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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Create database addDropTableSql('user_holidays'); addCreateTableSql('user_holidays', "( diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index a2237ee054..276adfb183 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.6'); setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.51', '0.0.52', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `html` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` ADD `html_msg` ENUM('Y','N') NOT NULL DEFAULT 'N'"); diff --git a/inc/extensions/ext-imprint.php b/inc/extensions/ext-imprint.php index 2111be26e9..c4aad9927b 100644 --- a/inc/extensions/ext-imprint.php +++ b/inc/extensions/ext-imprint.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='impressum' LIMIT 1"); diff --git a/inc/extensions/ext-iso3166.php b/inc/extensions/ext-iso3166.php index c2a8462250..bb916f3e46 100644 --- a/inc/extensions/ext-iso3166.php +++ b/inc/extensions/ext-iso3166.php @@ -48,7 +48,7 @@ setThisExtensionVersion('0.0.1'); setExtensionVersionHistory(array('0.0', '0.0.1')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); break; diff --git a/inc/extensions/ext-jackpot.php b/inc/extensions/ext-jackpot.php index fb69993f66..e7b09694dc 100644 --- a/inc/extensions/ext-jackpot.php +++ b/inc/extensions/ext-jackpot.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-lead.php b/inc/extensions/ext-lead.php index fd47510ff9..cebfbf7620 100644 --- a/inc/extensions/ext-lead.php +++ b/inc/extensions/ext-lead.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-logs.php b/inc/extensions/ext-logs.php index 70b2c3eff3..7d2ee275ee 100644 --- a/inc/extensions/ext-logs.php +++ b/inc/extensions/ext-logs.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0'); setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('stats', 'logs', 'Aufruflogbücher', 'Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)', 8); addConfigAddSql('logs_base', "VARCHAR(255) NOT NULL DEFAULT 'logs'"); diff --git a/inc/extensions/ext-mailid.php b/inc/extensions/ext-mailid.php index 958c16aa94..4b903d3e28 100644 --- a/inc/extensions/ext-mailid.php +++ b/inc/extensions/ext-mailid.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.3.3'); 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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); break; diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php index 9a9de5df25..37a8ab02ce 100644 --- a/inc/extensions/ext-maintenance.php +++ b/inc/extensions/ext-maintenance.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addConfigAddSql('maintenance', "ENUM('Y','N') NOT NULL DEFAULT 'N';"); addAdminMenuSql('setup','maintenance','Wartungsmodus','Schalten Sie den Wartungsmodus ein, nur wenn sehr schwerwiegende Fehler vorliegen, die Sie oder mxchange.org nicht schenll genug beheben können.',10); diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index a2d1a8e1b0..46005ab984 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); diff --git a/inc/extensions/ext-menu.php b/inc/extensions/ext-menu.php index e923018d3e..6fbb57e7f3 100644 --- a/inc/extensions/ext-menu.php +++ b/inc/extensions/ext-menu.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0.3'); setExtensionVersionHistory(array('0.0','0.0.1','0.0.2','0.0.3')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run // @TODO Convert menu-Id to one coding-standard. admin(edit|_add) => admin_menu_(edit|add), mem(edit|_add) => mem_menu_(edit|add) addAdminMenuSql('menu',NULL,'Menü-System','Alle drei Menü-System bearbeiten (Admin-, Mitglied- und Gast-Menü)',1); diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 2e5fe9d12c..340f40e471 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -47,7 +47,7 @@ setThisExtensionVersion('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')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('mods', NULL, 'Modul-Management','Verwalten Sie die Basis-Module index, login, admin usw.', 4); addAdminMenuSql('mods','config_mods','Module ändern','Ändern Sie hier die Zugtiffsrechte auf die Module. Was dennoch nicht geht: Mitglied- oder Gastzugriffsrtechte auf Admin-Module bzw. Gastzugriffsrechte auf Mitglieder-Module. Diese sind extra abgesichert.', 1); diff --git a/inc/extensions/ext-mydata.php b/inc/extensions/ext-mydata.php index f6e63ebc30..4db2430332 100644 --- a/inc/extensions/ext-mydata.php +++ b/inc/extensions/ext-mydata.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.8'); 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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addMemberMenuSql('main','mydata','Profildaten ändern','Y','N',2); break; diff --git a/inc/extensions/ext-network.php b/inc/extensions/ext-network.php index 3e09c8c06e..12308c975c 100644 --- a/inc/extensions/ext-network.php +++ b/inc/extensions/ext-network.php @@ -72,7 +72,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Main table which hold addDropTableSql('network_data'); addCreateTableSql('network_data', "( diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index b678d96984..3cc7ef5ef3 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); break; diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index c6953f912e..71cc694724 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.2.0'); 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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD nickname VARCHAR(255) NOT NULL DEFAULT ''"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD nick_userid ENUM ('nick','userid') NOT NULL DEFAULT 'userid'"); diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index aa43010721..4b379c9a1a 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0.6'); setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('online'); addCreateTableSql('online', "( diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index 96acbfb287..f10580607b 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('optimize_gain'); addCreateTableSql('optimize_gain', "( diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 87b84ce3b4..d96ec15d2b 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.5.2'); setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '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')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addMemberMenuSql('order', 'order', 'Mailbuchung', 'N', 'Y', 1); break; diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index aa768524e1..32c5877aad 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('setup','config_other','Sonstige Einstellungen','Sonstige Einstellungen an Ihrem {?mt_word?}.',13); break; diff --git a/inc/extensions/ext-partner.php b/inc/extensions/ext-partner.php index 4f7f0850a6..1821340f61 100644 --- a/inc/extensions/ext-partner.php +++ b/inc/extensions/ext-partner.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index d101a4d936..dae6531eb2 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.3.8'); setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('user_payouts'); addCreateTableSql('user_payouts', "( diff --git a/inc/extensions/ext-politician-stop.php b/inc/extensions/ext-politician-stop.php index 1c75c2c0d7..bfe7791e53 100644 --- a/inc/extensions/ext-politician-stop.php +++ b/inc/extensions/ext-politician-stop.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0'); setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addConfigAddSql('politician_stop_backlink', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addAdminMenuSql('config','config_politician_stop','Politiker-Stopp-Aktion','Einstellungen zur Satire-Aktion "Politiker-Stopp - Jetzt wird zurück zensiert."', 7); diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 960fc96800..4da3f6c559 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -52,7 +52,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('user_primera'); addCreateTableSql('user_primera', "( diff --git a/inc/extensions/ext-profile.php b/inc/extensions/ext-profile.php index 7b240bdad4..b9da7b9d73 100644 --- a/inc/extensions/ext-profile.php +++ b/inc/extensions/ext-profile.php @@ -48,7 +48,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); break; diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index 101f7fc76b..eaede467bd 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.3.5'); 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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('rallye_data'); addCreateTableSql('rallye_data', "( diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index d65eedb801..02b21c0450 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0.1'); setExtensionVersionHistory(array('0.0','0.0.1')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('user_refs'); addCreateTableSql('user_refs', "( diff --git a/inc/extensions/ext-refsell.php b/inc/extensions/ext-refsell.php index c35f40aa35..cd14812899 100644 --- a/inc/extensions/ext-refsell.php +++ b/inc/extensions/ext-refsell.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index 42809d622a..5c82ea2196 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.5.5'); setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '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')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addGuestMenuSql('members', 'register', 'Anmeldung', 'Y', 'N', 2); break; diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php index e91ed60db6..085bcbbc8c 100644 --- a/inc/extensions/ext-removeip.php +++ b/inc/extensions/ext-removeip.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0.1'); setExtensionVersionHistory(array('0.0', '0.0.1')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addConfigAddSql('removeip_anon_ip', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addConfigAddSql('removeip_anon_host', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index 4f03e57e36..86086bd12a 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.7'); setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('repair', NULL, 'Reperaturen','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.',7); addAdminMenuSql('repair','repair_cats','Kategorieauswahlen','Repariert die Kategorien Ihrer Mitglieder.',1); diff --git a/inc/extensions/ext-report.php b/inc/extensions/ext-report.php index 59a98924c0..d290dc7186 100644 --- a/inc/extensions/ext-report.php +++ b/inc/extensions/ext-report.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 3f0078e5a1..74dd8af8df 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 // Only since 'seo' is ready! setExtensionDeprecated('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // Check if mod_rewrite is loadeded if (!isApacheModuleLoaded('mod_rewrite')) { setExtensionReportsFailure(true); diff --git a/inc/extensions/ext-safe.php b/inc/extensions/ext-safe.php index 9d52052c7a..f4083659eb 100644 --- a/inc/extensions/ext-safe.php +++ b/inc/extensions/ext-safe.php @@ -51,7 +51,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-seo.php b/inc/extensions/ext-seo.php index 6bd3a1cd7b..0bf06eb3b4 100644 --- a/inc/extensions/ext-seo.php +++ b/inc/extensions/ext-seo.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 688c70d9bf..a618f2e49c 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // // SQL commands to run // diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 19d6839bf9..2a59247d13 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -41,16 +41,16 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.7.7'); +setThisExtensionVersion('0.7.8'); // 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', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '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.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', '0.7.4', '0.7.5', '0.7.6', '0.7.7')); +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', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '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.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', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8')); // Keep this extension always active! setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // This depends on 'cache' now addExtensionDependency('cache'); break; @@ -172,7 +172,7 @@ switch (getExtensionMode()) { setExtensionUpdateNotes("Unbestätigte Maillinks können unter Email-Management -> Unbest. Mails auflisten aufgelistet werden."); break; - case '0.1.0': // SQL queries for v0.2.1 + case '0.1.0': // SQL queries for v0.1.0 addConfigAddSql('reg_points_mode', "ENUM('ref','direct') NOT NULL DEFAULT 'ref'"); // Update notes (these will be set as task text!) @@ -788,6 +788,13 @@ INDEX (`ip`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Menüpunkt Verdienen hinzugefügt und Unbestätigte Mails als ersten Punkt dort hin verschoben."); break; + + case '0.7.8': // SQL queries for v0.7.8 + addConfigChangeSql('reg_points_mode', 'reg_points_mode', "ENUM('REF','DIRECT') NOT NULL DEFAULT 'REFERAL'"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Konfigurationseinträge mit Spaltentyp ENUM werden nun immer komplett gross geschrieben."); + break; } // END - switch break; diff --git a/inc/extensions/ext-support.php b/inc/extensions/ext-support.php index 42757003be..0d440ecc15 100644 --- a/inc/extensions/ext-support.php +++ b/inc/extensions/ext-support.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.3'); 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', '0.1.1', '0.1.2', '0.1.3')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addExtensionSql(''); break; diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 792a0d7910..fa546b791b 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run (surfbar URLs) addDropTableSql('surfbar_urls'); addCreateTableSql('surfbar_urls', "( diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index 97ba04d72a..710f01bffe 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('task', NULL, 'Aufgaben-Management','Erweitertes Aufgaben-Management zur leichten verwaltung der vom System erzeugten Aufgaben.',1); addAdminMenuSql('task','list_task','Aufgaben auflisten','Alle Ihnen zugewiesenen Aufgaben auflisten (keine Updates).',1); diff --git a/inc/extensions/ext-terms.php b/inc/extensions/ext-terms.php index 928f6235d3..8bb1612745 100644 --- a/inc/extensions/ext-terms.php +++ b/inc/extensions/ext-terms.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 0562ae67f4..8e8b33afef 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.2'); 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', '0.1.1', '0.1.2')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-timezone.php b/inc/extensions/ext-timezone.php index fa25ccf847..23ff51440a 100644 --- a/inc/extensions/ext-timezone.php +++ b/inc/extensions/ext-timezone.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running addConfigAddSql('timezone', "VARCHAR(255) NOT NULL DEFAULT 'Europe/Berlin'"); addAdminMenuSql('setup', 'config_timezone', 'Zeitzone', 'Einstellungen an der Zeitzone können hier konfiguriert werden.', 10); diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php index 2373861495..81fe0d9cbd 100644 --- a/inc/extensions/ext-top10.php +++ b/inc/extensions/ext-top10.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.1.2'); 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', '0.1.1', '0.1.2')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addGuestMenuSql('main','top10','TOP-10','Y','Y', 7); addAdminMenuSql('setup','config_top10','TOP-10 Listen','Stellen Sie hier ein, wie lang die TOP-Listen sein sollen, also wie viele Plätze angezeigt werden sollen.', 8); diff --git a/inc/extensions/ext-uberwach.php b/inc/extensions/ext-uberwach.php index a605356c9a..fe1e877da4 100644 --- a/inc/extensions/ext-uberwach.php +++ b/inc/extensions/ext-uberwach.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0.2'); setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run break; diff --git a/inc/extensions/ext-update.php b/inc/extensions/ext-update.php index 360e79b609..0bd50a9395 100644 --- a/inc/extensions/ext-update.php +++ b/inc/extensions/ext-update.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('misc','updates','Updates prüfen','Prüft, ob eine neue Version oder ein Patch auf dem Server exisitiert. Sie müssen dann die Patches/Updates selber herunterladen und einspielen. Dabei werden keine Daten von Ihrer Installation an uns gesendet!',8); break; diff --git a/inc/extensions/ext-usage.php b/inc/extensions/ext-usage.php index 78fddd176d..f8f10a6198 100644 --- a/inc/extensions/ext-usage.php +++ b/inc/extensions/ext-usage.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0'); setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addAdminMenuSql('stats', 'usage', 'Aufrufstatistik', 'Erkennt automatisch Ihre Aufrufstatisiken und bindet diese in das Admin-Interface ein. (Derzeit nur Webalizer!)', 9); addConfigAddSql('usage_base', "VARCHAR(255) NOT NULL DEFAULT 'usage'"); diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 124d3be697..d3de91a63d 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -41,16 +41,16 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.3.7'); +setThisExtensionVersion('0.3.8'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7')); +setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8')); // Keep this extension always active! setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running addDropTableSql('user_cats'); addCreateTableSql('user_cats', "( `id` BIGINT(22) NOT NULL AUTO_INCREMENT, @@ -211,7 +211,7 @@ INDEX (`stats_type`) break; case '0.1.2': // SQL queries for v0.1.2 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Dem Mitglied wird nun angezeigt, wie viele Mails er bestätigt hat. Alle vor dieser Version best. Mails werden leider nicht mehr berücksichtigt! Bitte teilen Sie dies Ihren Mitgliedern mit."); @@ -223,7 +223,7 @@ INDEX (`stats_type`) break; case '0.1.4': // SQL queries for v0.1.4 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Anzahl empfangener Mails wird angezeigt. Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {?mt_word?} haben sollen!"); @@ -336,7 +336,7 @@ INDEX (`stats_type`) case '0.3.4': // SQL queries for v0.3.4 addConfigAddSql('select_user_zero_refid', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addConfigAddSql('user_min_confirmed', 'SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10'); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Mitglieder werden per Zufall als Referal-Id ausgewählt, die eine Mindestanzahl an bestätigten Mails haben, wenn die Ref-Id 0 ist."); @@ -367,44 +367,44 @@ PRIMARY KEY (`id`) break; case '0.3.6': // SQL queries for v0.3.6 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` DROP INDEX `userid`"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` ( `userid` , `cat_id` )"); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` DROP INDEX `userid`'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` ( `userid` , `cat_id` )'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); break; case '0.3.7': // SQL queries for v0.3.7 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `id` `id` BIGINT( 22 ) UNSIGNED NOT NULL AUTO_INCREMENT"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `cat_id` `cat_id` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_del` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `stats_id` `stats_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `userid` `userid` BIGINT( 22 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `ref_depth` `ref_depth` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `level` `level` SMALLINT( 6 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `refid` `refid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `cat_id` `cat_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `payment_id` `payment_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `pool_id` `pool_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `id` `id` BIGINT( 22 ) UNSIGNED NOT NULL AUTO_INCREMENT'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `cat_id` `cat_id` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_del` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `stats_id` `stats_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `userid` `userid` BIGINT( 22 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `ref_depth` `ref_depth` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `level` `level` SMALLINT( 6 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `refid` `refid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `cat_id` `cat_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `payment_id` `payment_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `pool_id` `pool_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL'); // Cleanup SQLs - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid` IS NULL OR `cat_id` IS NULL"); - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_del` WHERE `userid` IS NULL"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `stats_id`=NULL WHERE `stats_id`=0"); - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid` IS NULL"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `ref_depth`=NULL WHERE `ref_depth`=0"); - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid` IS NULL"); - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid` IS NULL OR `refid` IS NULL OR `level` IS NULL"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `cat_id`=NULL WHERE `cat_id`=0"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `payment_id`=NULL WHERE `payment_id`=0"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0"); - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid` IS NULL"); + addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid` IS NULL OR `cat_id` IS NULL'); + addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_del` WHERE `userid` IS NULL'); + addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `stats_id`=NULL WHERE `stats_id`=0'); + addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid` IS NULL'); + addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `ref_depth`=NULL WHERE `ref_depth`=0'); + addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid` IS NULL'); + addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid` IS NULL OR `refid` IS NULL OR `level` IS NULL'); + addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `cat_id`=NULL WHERE `cat_id`=0'); + addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `payment_id`=NULL WHERE `payment_id`=0'); + addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0'); + addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid` IS NULL'); // This update depends on ext-bonus addExtensionDependency('bonus'); @@ -414,11 +414,19 @@ PRIMARY KEY (`id`) break; case '0.3.7': // SQL queries for v0.3.7 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `last_failure` `last_failure` TIMESTAMP NULL DEFAULT NULL"); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `last_failure` `last_failure` TIMESTAMP NULL DEFAULT NULL'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Ausgangswert ist nicht mehr 0000-00-00 00:00:00, sondern einfach NULL."); break; + + case '0.3.8': // SQL queries for v0.3.8 + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `order_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `locked_order_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Weiteres {?POINTS?}-Guthabenkonto "Werbeguthaben" hinzugefügt."); + break; } // END - switch break; diff --git a/inc/extensions/ext-validator.php b/inc/extensions/ext-validator.php index ab41c37048..9ceaf1dcad 100644 --- a/inc/extensions/ext-validator.php +++ b/inc/extensions/ext-validator.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0'); setExtensionVersionHistory(array('0.0')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addConfigAddSql('enable_validator', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); addAdminMenuSql('setup','config_validator','Validierer','Schalten Sie die Validierer-Links ein, um die Gültigkeit Ihres HTML- oder CSS-Codes zu überprüfen.', 10); diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index 743409b569..5e6fbf1dd9 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -47,7 +47,7 @@ setThisExtensionVersion('0.0.3'); setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('user_wernis'); addCreateTableSql('user_wernis', "( diff --git a/inc/extensions/ext-yacy.php b/inc/extensions/ext-yacy.php index 2092dfd709..555c63ebdb 100644 --- a/inc/extensions/ext-yacy.php +++ b/inc/extensions/ext-yacy.php @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0')); enableExtensionProductive(false); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run // Register module diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 89743fd55c..cb16e5b3ca 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -54,7 +54,7 @@ setExtensionAlwaysActive('Y'); // @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addConfigAddSql('yoomedia_id', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); addConfigAddSql('yoomedia_sid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 4acb78d90f..4d766f980e 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -225,7 +225,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for // "Unregisters" a filter from the given chain function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false, $dry_run = false) { - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run) . ' - ENTERED!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - ENTERED!'); // Extend the filter function name only if not loaded from database if (!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) { @@ -246,7 +246,7 @@ function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false, $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R'; } // END - if - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run) . ' - EXIT!'); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - EXIT!'); } // "Runs" the given filters, filterData is optional and can be any type of data diff --git a/inc/filter/active_filter.php b/inc/filter/active_filter.php index 2132e64b7a..7a7c1b248b 100644 --- a/inc/filter/active_filter.php +++ b/inc/filter/active_filter.php @@ -41,8 +41,9 @@ if (!defined('__SECURITY')) { } // END - if // Filter for adding link to "active list" -function FILTER_ADD_LINK_ACTIVE_LIST () { +function FILTER_ADD_LINK_ACTIVE_LIST ($data) { // Is ext-active/online there? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if ((isExtensionActive('active')) && (isExtensionActive('online'))) { // Init fake-content because there is no `what`='active' in database $content = array( @@ -55,6 +56,10 @@ function FILTER_ADD_LINK_ACTIVE_LIST () { // Add link to "we were active today" page $GLOBALS['rows'] .= loadTemplate('guest_menu_bottom', true, $content); } // END - if + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/admins_filter.php b/inc/filter/admins_filter.php index 81beec2b19..677f1d295b 100644 --- a/inc/filter/admins_filter.php +++ b/inc/filter/admins_filter.php @@ -43,18 +43,21 @@ if (!defined('__SECURITY')) { // Filter for adding extra data to the query function FILTER_ADD_EXTRA_SQL_DATA ($add = '') { // Is the admins extension updated? (should be!) + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if (isExtensionInstalledAndNewer('admins', '0.3.0')) $add .= ', `default_acl` AS def_acl'; if (isExtensionInstalledAndNewer('admins', '0.6.7')) $add .= ', `la_mode`'; if (isExtensionInstalledAndNewer('admins', '0.7.2')) $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure'; if (isExtensionInstalledAndNewer('admins', '0.7.3')) $add .= ', `expert_settings`, `expert_warning`'; // Return it + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $add; } // Reset the login failures function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) { // Store it in session + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); setSession('mailer_admin_failures' , getAdminLoginFailures($data['id'])); setSession('mailer_admin_last_failure', getAdminLastFailure($data['id'])); @@ -70,12 +73,14 @@ function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) { rebuildCache('admin'); // Return the data for further processing + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } // Count the login failure function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) { // Prepare update data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); $postData['login'][getCurrentAdminId()] = $data['login']; $postData['login_failures'][getCurrentAdminId()] = '`login_failures`+1'; $postData['last_failure'][getCurrentAdminId()] = 'NOW()'; @@ -87,12 +92,14 @@ function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) { rebuildCache('admin'); // Return the data for further processing + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } // Rehashes the given plain admin password and stores it the database function FILTER_REHASH_ADMINS_PASSWORD ($data) { // Generate new hash + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); $newHash = generateHash($data['plain_pass']); // Prepare update data @@ -110,6 +117,7 @@ function FILTER_REHASH_ADMINS_PASSWORD ($data) { rebuildCache('admin'); // Return the data for further processing + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } diff --git a/inc/filter/bonus_filter.php b/inc/filter/bonus_filter.php index 5faccd7cb2..34ee440808 100644 --- a/inc/filter/bonus_filter.php +++ b/inc/filter/bonus_filter.php @@ -41,8 +41,9 @@ if (!defined('__SECURITY')) { } // END - if // Filter for adding login bonus to the user's account -function FILTER_ADD_LOGIN_BONUS () { +function FILTER_ADD_LOGIN_BONUS ($data) { // Is the user data valid? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if (!isMember()) { // Do only run for logged in members debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.'); @@ -77,6 +78,10 @@ LIMIT 1', // No login bonus added! $GLOBALS['message'] .= '
{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}
'; } + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/booking_filter.php b/inc/filter/booking_filter.php index 4fb2b207ab..1b88ed5f16 100644 --- a/inc/filter/booking_filter.php +++ b/inc/filter/booking_filter.php @@ -43,9 +43,11 @@ if (!defined('__SECURITY')) { // Filter for adding booking record function FILTER_ADD_BOOKING_RECORD ($data) { // Add a record + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); addBookingRecord($data['subject'], $data['userid'], $data['points'], $data['mode']); // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } diff --git a/inc/filter/cache_filter.php b/inc/filter/cache_filter.php index ec708e1ce0..dd9d22b7d8 100644 --- a/inc/filter/cache_filter.php +++ b/inc/filter/cache_filter.php @@ -43,34 +43,48 @@ if (!defined('__SECURITY')) { // Destroy the cache on extension changes function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) { // Return the data anyway if there is no cache extension - if (!isCacheInstanceValid()) return $data; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + if (!isCacheInstanceValid()) { + return false; + } // END - if // Remove cache foreach (array('config','extension','filter','modules') as $cache) { - if ($GLOBALS['cache_instance']->loadCacheFile($cache)) $GLOBALS['cache_instance']->removeCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile($cache)) { + $GLOBALS['cache_instance']->removeCacheFile(); + } // END - if } // END - foreach // Return it + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } // Destroy the cache on changing admin function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE ($data) { // Skip this step if the cache instance is not there - if (!isCacheInstanceValid()) return false; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + if (!isCacheInstanceValid()) { + return false; + } // END - if // Remove cache - if ($GLOBALS['cache_instance']->loadCacheFile('admin')) $GLOBALS['cache_instance']->removeCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile('admin')) { + $GLOBALS['cache_instance']->removeCacheFile(); + } // END - if // Return the data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } // Destroy all cache files -function FILTER_CACHE_DESTROY_ALL () { +function FILTER_CACHE_DESTROY_ALL ($data) { // Skip this step if the cache instance is not there //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); - if (!isCacheInstanceValid()) return false; + if (!isCacheInstanceValid()) { + return false; + } // END - if // Remove cache files foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) { @@ -81,16 +95,26 @@ function FILTER_CACHE_DESTROY_ALL () { $GLOBALS['cache_instance']->removeCacheFile(); } // END - if } // END - foreach + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // Filter for purging 'filter' cache -function FILTER_CACHE_DESTROY_FILTER () { +function FILTER_CACHE_DESTROY_FILTER ($data) { // Skip this step if the cache instance is not there - if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) return false; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + if ((!isCacheInstanceValid()) || (getConfig('update_filter_usage') != 'Y')) { + return false; + } // END - if // Remove cache files - if ($GLOBALS['cache_instance']->loadCacheFile('filter')) $GLOBALS['cache_instance']->removeCacheFile(); + if ($GLOBALS['cache_instance']->loadCacheFile('filter')) { + $GLOBALS['cache_instance']->removeCacheFile(); + } // END - if + + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/coupon_filter.php b/inc/filter/coupon_filter.php new file mode 100644 index 0000000000..cafe31b95e --- /dev/null +++ b/inc/filter/coupon_filter.php @@ -0,0 +1,64 @@ + diff --git a/inc/filter/mediadata_filter.php b/inc/filter/mediadata_filter.php index 102ee3f7f1..54bc2c710e 100644 --- a/inc/filter/mediadata_filter.php +++ b/inc/filter/mediadata_filter.php @@ -43,9 +43,11 @@ if (!defined('__SECURITY')) { // Filter for updating media data function FILTER_UPDATE_MEDIADATA_ENTRY ($data) { // Execute the filter function - $data['added'] = ($data['added'] && updateMediadataEntry(array('total_points'), $data['mode'], $data['points'])); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + $data['added'] = ($data['added'] === true && updateMediadataEntry(array('total_points'), $data['mode'], $data['points'])); // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $data; } diff --git a/inc/filter/online_filter.php b/inc/filter/online_filter.php index ca48771cd9..d31c793c63 100644 --- a/inc/filter/online_filter.php +++ b/inc/filter/online_filter.php @@ -41,8 +41,9 @@ if (!defined('__SECURITY')) { } // END - if // Filter for updates/extends on the online list -function FILTER_UPDATE_ONLINE_LIST () { +function FILTER_UPDATE_ONLINE_LIST ($data) { // Do not update online list when extension is deactivated + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if (!isExtensionActive('online', true)) { // Extension not active return; @@ -126,6 +127,10 @@ LIMIT 1", // Purge old entries SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE (UNIX_TIMESTAMP() - `timestamp`) >= {?online_timeout?}', __FUNCTION__, __LINE__); + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/other_filter.php b/inc/filter/other_filter.php index 17fa7113c9..029483e975 100644 --- a/inc/filter/other_filter.php +++ b/inc/filter/other_filter.php @@ -41,12 +41,17 @@ if (!defined('__SECURITY')) { } // END - if // Filter for debugging SQLs -function FILTER_DISPLAY_DEBUG_SQL () { +function FILTER_DISPLAY_DEBUG_SQL ($data) { // Shall we display SQL queries? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if ((isAdmin()) && (isDisplayDebugSqlEnabled()) && (!isGetRequestParameterSet('frame')) && ($GLOBALS['header_sent'] == 2)) { // Then display it here displayDebugSqls(); } // END - if + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/politician_stop_filter.php b/inc/filter/politician_stop_filter.php index 8a66346a2d..56ed51f167 100644 --- a/inc/filter/politician_stop_filter.php +++ b/inc/filter/politician_stop_filter.php @@ -41,12 +41,17 @@ if (!defined('__SECURITY')) { } // END - if // Filter for displaying politician_stop snippet -function FILTER_DISPLAY_POLITICIAN_STOP_SNIPPET () { +function FILTER_DISPLAY_POLITICIAN_STOP_SNIPPET ($data) { // Shall we include the politician_stop snippet? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('politician_stop')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) { // Then display it here loadPoliticianStopSnippet(); } // END - if + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/rallye_filter.php b/inc/filter/rallye_filter.php index cda5e6bc2e..5e7d925e6c 100644 --- a/inc/filter/rallye_filter.php +++ b/inc/filter/rallye_filter.php @@ -41,9 +41,14 @@ if (!defined('__SECURITY')) { } // END - if // Filter for extra-autpurge -function FILTER_RALLYE_EXTRA_AUTOPURGE () { +function FILTER_RALLYE_EXTRA_AUTOPURGE ($data) { // Check expired rallyes (hard-coded 3 days limit for displaying expired rallyes!) + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); purgeExpiredReferalRallyes(); + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/register_filter.php b/inc/filter/register_filter.php index e73d8a45a9..61af1b755e 100644 --- a/inc/filter/register_filter.php +++ b/inc/filter/register_filter.php @@ -43,6 +43,7 @@ if (!defined('__SECURITY')) { // Run a filter for must-fillout fields function FILTER_REGISTER_MUST_FILLOUT ($content) { // Get all fields for output + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); $result = SQL_QUERY('SELECT `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC', __FUNCTION__, __LINE__); @@ -62,6 +63,7 @@ function FILTER_REGISTER_MUST_FILLOUT ($content) { SQL_FREERESULT($result); // Return it + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $content; } diff --git a/inc/filter/removeip_filter.php b/inc/filter/removeip_filter.php index 39afe01257..850038abb6 100644 --- a/inc/filter/removeip_filter.php +++ b/inc/filter/removeip_filter.php @@ -43,15 +43,17 @@ if (!defined('__SECURITY')) { // Filter for adding anonymity notice to the output stream function FILTER_ADD_ANONYMITY_NOTICE ($data) { // Init content + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); $content = $data; // Extension removeip activated? - if ((isExtensionActive('removeip')) && (getConfig('removeip_'.strtolower($data['access_level']).'_show') == 'Y')) { + if ((isExtensionActive('removeip')) && (getConfig('removeip_' . strtolower($data['access_level']) . '_show') == 'Y')) { // Add anoymity/privacy infos $content['content'] .= addAnonymityLevel() . "
\n"; } // END - if // Return it + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); return $content; } diff --git a/inc/filter/theme_filter.php b/inc/filter/theme_filter.php index 5cb385c994..d969424337 100644 --- a/inc/filter/theme_filter.php +++ b/inc/filter/theme_filter.php @@ -41,8 +41,9 @@ if (!defined('__SECURITY')) { } // END - if // Filter for generic handling of theme change -function FILTER_HANDLE_THEME_CHANGE () { +function FILTER_HANDLE_THEME_CHANGE ($data) { // Check if new theme is selcted + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if ((isPostRequestParameterSet('new_theme')) && (postRequestParameter('new_theme') != getCurrentTheme())) { // Set new theme for guests $newTheme = postRequestParameter('new_theme'); @@ -59,10 +60,14 @@ function FILTER_HANDLE_THEME_CHANGE () { // Redirect to same URL redirectToRequestUri(); } // END - if + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // Filter for settings theme from user profile, must be executed only if FILTER_FETCH_USER_DATA() ran before -function FILTER_SET_USERS_THEME () { +function FILTER_SET_USERS_THEME ($data) { // Is the user data valid? if (!isMember()) { // Do only run for logged in members @@ -71,6 +76,10 @@ function FILTER_SET_USERS_THEME () { // Change to new theme setTheme(getUserData('curr_theme')); + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/timezone_filter.php b/inc/filter/timezone_filter.php index 7ff31c151b..aa4268ea1a 100644 --- a/inc/filter/timezone_filter.php +++ b/inc/filter/timezone_filter.php @@ -41,12 +41,17 @@ if (!defined('__SECURITY')) { } // END - if // Filter for setting the timezone -function FILTER_INIT_TIMEZONE () { +function FILTER_INIT_TIMEZONE ($data) { // Just set it if the required function is there + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if (function_exists('date_default_timezone_set')) { // CFG: TIME-ZONE date_default_timezone_set(getConfig('timezone')); } // END - if + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/filter/uberwach_filter.php b/inc/filter/uberwach_filter.php index ec30e1a778..faa0fe1658 100644 --- a/inc/filter/uberwach_filter.php +++ b/inc/filter/uberwach_filter.php @@ -41,12 +41,17 @@ if (!defined('__SECURITY')) { } // END - if // Filter for displaying uberwach snippet -function FILTER_DISPLAY_UBERWACH_SNIPPET () { +function FILTER_DISPLAY_UBERWACH_SNIPPET ($data) { // Shall we include the uberwach snippet? + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); if ((!isGetRequestParameterSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) { // Then display it here loadUberwachSnippet(); } // END - if + + // Return data + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $data; } // [EOF] diff --git a/inc/functions.php b/inc/functions.php index 6f570cdd1f..be1223d7b4 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -926,7 +926,7 @@ function generateHash ($plainText, $salt = '', $hash = true) { // Sanity check on salt if (strlen($salt) != getSaltLength()) { // Not the same! - debug_report_bug(__FUNCTION__, __LINE__, 'salt length mismatch! ('.strlen($salt).'/'.getSaltLength().')'); + debug_report_bug(__FUNCTION__, __LINE__, 'salt length mismatch! (' . strlen($salt) . '/' . getSaltLength() . ')'); } // END - if } @@ -2316,6 +2316,33 @@ function getArrayKeysFromSubStrArray ($heystack, array $needles, $offset = 0) { return $keys; } +// Determines database column name from given subject and locked +function determinePointsColumnFromSubjectLocked ($subject, $locked) { + // Default is 'normal' points + $pointsColumn = 'points'; + + // Which points, locked or normal? + if ($locked === true) { + $pointsColumn = 'locked_points'; + } // END - if + + // Prepare array for filter + $filterData = array( + 'subject' => $subject, + 'locked' => $locked, + 'column' => $pointsColumn + ); + + // Run the filter + $filterData = runFilterChain('determine_points_column_name', $filterData); + + // Extract column name from array + $pointsColumn = $filterData['column']; + + // Return it + return $pointsColumn; +} + //----------------------------------------------------------------------------- // Automatically re-created functions, all taken from user comments on www.php.net //----------------------------------------------------------------------------- diff --git a/inc/language/beg_de.php b/inc/language/beg_de.php index f09d5c5740..4055aaa394 100644 --- a/inc/language/beg_de.php +++ b/inc/language/beg_de.php @@ -75,8 +75,6 @@ addMessages(array( 'ADMIN_BEG_POINTS_MAX' => "Maximale erbettelbare {?POINTS?} bei Klick auf Bettellink", 'ADMIN_BEG_USERID' => "Mitglied-Account zum Abbuchen der erbettelten {?POINTS?}", 'ADMIN_SELECT_BEG_MODE' => "Vergütungsmodus der erbettelten {?POINTS?}", - 'BEG_MODE_DIRECT' => "Nur direktem Mitglied gutschreiben.", - 'BEG_MODE_REF' => "Auch dem Werber des Mitgliedes gutschreiben.", 'BEG_SORRY_YOURE_LOGGED_IN_1' => "Oh, schade! Sie haben vermutlich auf Ihren eigenen Bettel-Link mit der Mitglieder-Id ", 'BEG_SORRY_YOURE_LOGGED_IN_2' => " geklickt. Sie haben somit auch keine ", 'BEG_SORRY_YOURE_LOGGED_IN_3' => " {?POINTS?} erhalten.", diff --git a/inc/language/birthday_de.php b/inc/language/birthday_de.php index 330d4b40a5..2276598dee 100644 --- a/inc/language/birthday_de.php +++ b/inc/language/birthday_de.php @@ -49,8 +49,6 @@ addMessages(array( 'MEMBER_BIRTHDAY_CANNOT_STATUS' => "Kann keine {?POINTS?} gutschreiben! Status Ihres Accounts: %s", 'MEMBER_BIRTHDAY_CANNOT_LOAD_DATA' => "Entweder haben Sie bereits Ihr Geburtsgeschenk erhalten oder Sie haben heute keinen Geburtstag.", 'ADMIN_SELECT_BIRTHDAY_MODE' => "Vergütungsmodus der {?POINTS?}", - 'ADMIN_BIRTHDAY_MODE_DIRECT' => "Nur direktem Mitglied gutschreiben.", - 'ADMIN_BIRTHDAY_MODE_REF' => "Auch dem Werber des Mitgliedes gutschreiben.", 'ADMIN_BIRTHDAY_ONLY_ACTIVE' => "Nur aktive Mitglieder erhalten die Geburtstagsgutschrift?
(Nur in Verbindung mit der Erweiterung autopurge!)
", )); diff --git a/inc/language/bonus_de.php b/inc/language/bonus_de.php index 9d8ceaf896..e796cd4146 100644 --- a/inc/language/bonus_de.php +++ b/inc/language/bonus_de.php @@ -81,7 +81,7 @@ addMessages(array( 'ADMIN_BONUS_WINNER_HIGLIGHTED' => "Mögliche Gewinner der Aktiv-Rallye sind dick marktiert.", 'ADMIN_BONUS_ALREADY_WITHDRAW' => "Manuelle Vergütungvorbereitung bereits betätigt.", 'ADMIN_BONUS_TIMEOUT' => "Es werden nur Mitglieder ausgewertet und hier aufgelistet, die spätestens am %s noch aktiv waren. Alle anderen Mitglieder erhalten die Vergütung nicht.", - 'ADMIN_BONUS_USERID' => "Mitgliedskonto zum Abbuchen der {?POINTS?}", + 'ADMIN_CONFIG_BONUS_USERID' => "Mitgliedskonto zum Abbuchen der {?POINTS?}", 'ADMIN_CONFIG_BONUS_TIMEOUT' => "Verweildauer von Aktiv-Bonus-Einträgen", 'ADMIN_LIST_BONUS_RALLYE_TITLE' => "Alle an der Aktiv-Rallye teilnehmenden Mitglieder:", 'ADMIN_BONUS_TURBO_LINES' => "Anzahl angezeigter Aktiv-Bonus-Empfänger in show_bonus.php", diff --git a/inc/language/coupon_de.php b/inc/language/coupon_de.php index 90637aca7e..b5e760f6f7 100644 --- a/inc/language/coupon_de.php +++ b/inc/language/coupon_de.php @@ -46,6 +46,12 @@ addMessages(array( 'ADMIN_CONFIG_COUPON_SETTINGS_TITLE' => "Allgemeine Einstellungen zu den Gutscheinen", 'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie können diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachträglich anpassen.", 'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsvergütung in {?POINTS?}. Sie können diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachträglich anpassen.", + 'ADMIN_CONFIG_COUPON_AUTOPURGE_TIME' => "Dauer bis abgelaufene Gutscheine aus der Datenbank entfernt werden", + 'ADMIN_CONFIG_COUPON_SELECT_PAYMENT_METHOD' => "Soll nur dem Mitglied direkt die Gutschrift aus dem Einlösen von Gutscheinen oder über das Referal-System gutgeschrieben werden?", + 'ADMIN_CONFIG_COUPON_SELECT_POINTS_ACCOUNT' => "Sollen die {?POINTS?} aus den eingelösten Gutscheinen dem allgemeinen oder dem Werbekonto gutgeschrieben werden?", + 'ADMIN_CONFIG_COUPON_SELECT_LOCKED_POINTS_MODE' => "Wenn das Mitglied noch zu bestätigende Mails offen hat, sollen die eingelösten Gutscheine einem gesperrten Konto oder dem oben eingestellten gutgeschrieben werden?", + 'ADMIN_CONFIG_COUPON_USERID' => "Mitgliederaccount, von dem die eingelösten {?POINTS?} abgebucht werden sollen:", + // Admin - Send coupon to members 'ADMIN_SEND_COUPON_TITLE' => "Gutschein versenden (aktuell nur Code-Gutscheine)", 'ADMIN_SEND_COUPON_EXPIRATION_TIME' => "Ablaufzeit (ab Versandzeitpunkt)", @@ -60,10 +66,14 @@ addMessages(array( 'MEMBER_CASH_COUPON_NOTE' => "Geben Sie hier den Gutschein-Code ein, den Sie aus unserer Mail erhalten haben. Sie erhalten dann eine Meldung, auf welches Konto die Gutschrift aufgebucht wurde.", 'MEMBER_CASH_COUPON' => "Gutschein einlösen", 'MEMBER_ENTER_COUPON_CODE' => "Gutschein-Code eingeben:", + 'MEMBER_COUPON_CODE_EMPTY' => "Sie haben keinen Gutschein-Code eingegeben. Bitte versuchen Sie es erneut.", + 'MEMBER_COUPON_CODE_ALREADY_USED' => "Der von Ihnen eingegebene Gutschein-Code ist entweder ungütig, Ihnen nicht zugewiesen, bereits abgelaufen, oder Sie haben ihn bereits eingelöst.", + 'MEMBER_COUPON_CODE_CASHED' => "Ihr Gutschein im Wert von {%%pipe,translateComma=%s%%} {?POINTS?} wurde soeben eingelöst und Ihrem Konto gutgeschrieben.", // Subject lines 'MEMBER_COUPON_SUBJECT' => "Gutschein bei {?MAIN_TITLE?}", - 'ADMIN_COUPON_SUBJECT' => "Es wurde ein Gutschein versendet", + 'ADMIN_COUPON_SUBJECT' => "Es wurde ein Gutschein versendet", + 'ADMIN_COUPON_CASHED_SUBJECT' => "Ein Mitglied hat seinen Gutschein eingelöst", )); // [EOF] diff --git a/inc/language/de.php b/inc/language/de.php index 5dc0b744eb..022f64f30c 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1151,6 +1151,18 @@ addMessages(array( 'ADMIN_EXPERT_SETTINGS_NOTE' => "Sie sind im Begriff Einstellungen zu ändern, die sehr sensibel sind und sich auf die Funktionalität Ihres {?mt_word2?} negativ auswirken können. Sie sollten daher hier nichts ändern, solange Sie nicht wissen, was Sie da tun.", 'ADMIN_EXPERT_SETTINGS_MAKE_PERMANENT' => "Ja, ich weiss was ich tue und möchte diesen Hinweis nicht mehr angezeigt bekommen.", 'ADMIN_EXPERT_SETTINGS_CONTINUE' => "Dennoch die Experten-Einstellungen aufrufen", + + // Payment modes + 'ADMIN_CONFIG_PAYMENT_MODE_DIRECT' => "Nur direktem Mitglied gutschreiben.", + 'ADMIN_CONFIG_PAYMENT_MODE_REF' => "Auch dem Werber des Mitgliedes gutschreiben.", + + // Locked-points modes + 'ADMIN_CONFIG_LOCKED_POINTS_MODE_LOCKED' => "Einem gesperrten Konto gutschreiben.", + 'ADMIN_CONFIG_LOCKED_POINTS_MODE_UNLOCKED' => "Dem voreingestellten Konto gutschreiben.", + + // Points account + 'ADMIN_CONFIG_POINTS_ACCOUNT_ORDER' => "Dem Werbekonto gutschreiben.", + 'ADMIN_CONFIG_POINTS_ACCOUNT_GENERAL' => "Dem allgemeinen Konto gutschreiben.", )); // Description of all months diff --git a/inc/libs/beg_functions.php b/inc/libs/beg_functions.php index 49b4beb6e6..b3622839f1 100644 --- a/inc/libs/beg_functions.php +++ b/inc/libs/beg_functions.php @@ -54,11 +54,11 @@ function addPointsBeg ($userid, $points) { // Add points to account // @TODO Try to rewrite the following unset() unset($GLOBALS['ref_level']); - $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, strtolower(getBegMode())); + $added = addPointsThroughReferalSystem('beg', $userid, $points, false, 0, getBegMode()); } // Subtract begged points from member account if the admin has selected one - if (getBegUserid() > 0) { + if (isValidUserId(getBegUserid())) { // Subtract from this account subtractPoints('beg_payout', getBegUserid(), $points); } // END - if diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index bd39484458..9033627032 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -218,7 +218,7 @@ function handleBonusPoints ($mode) { if (!isBonusRallyeActive()) return; // Switch to jackpot-mode when no UID is supplied but userid-mode is selected - if ((getBonusMode() == 'UID') && (getBonusUserId() == '0') && (isExtensionActive('jackpot'))) { + if ((getBonusMode() == 'UID') && (getBonusUserid() == '0') && (isExtensionActive('jackpot'))) { // Update database & config updateConfiguration('bonus_mode', 'JACKPOT'); } // END - if @@ -232,7 +232,7 @@ function handleBonusPoints ($mode) { } // Check his amount first - $total = getTotalPoints(getBonusUserId()); + $total = getTotalPoints(getBonusUserid()); // Subtract points from... switch (getBonusMode()) { @@ -241,10 +241,10 @@ function handleBonusPoints ($mode) { break; case 'JACKPOT': // ... jackpot - if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getBonusUserId()))) { + if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getBonusUserid()))) { if ($total >= $points) { // Subtract points from userid's account - subtractPointsFromJackpot('bonus_payout_jackpot', getBonusUserId(), $points); + subtractPointsFromJackpot('bonus_payout_jackpot', getBonusUserid(), $points); } // END - if } // END - if break; @@ -252,7 +252,7 @@ function handleBonusPoints ($mode) { case 'UID': // ... userid's account if ($total >= $points) { // Subtract points from userid's account - subtractPoints('bonus_payout_userid', getBonusUserId(), $points); + subtractPoints('bonus_payout_userid', getBonusUserid(), $points); } elseif (isExtensionActive('jackpot')) { // Try to subtract from jackpot $dummy = subtractPointsFromJackpot($points); diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index eb205ec734..f077b9ba45 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -45,7 +45,7 @@ function addValidHtmlTags() { $OUT = ''; if (!is_array($GLOBALS['html_tags'])) return ""; foreach ($GLOBALS['html_tags'] as $tag) { - $OUT .= ", ".strtoupper($tag); + $OUT .= ', ' . strtoupper($tag); } $OUT = substr($OUT, 2); return $OUT; diff --git a/inc/libs/mediadata_functions.php b/inc/libs/mediadata_functions.php index 151aa2783e..60b713ae1d 100644 --- a/inc/libs/mediadata_functions.php +++ b/inc/libs/mediadata_functions.php @@ -81,13 +81,13 @@ LIMIT 1", array($key), __FUNCTION__, __LINE__); // Check affected rows if (is_null($added)) { - //* DEBUG: */ debugOutput(__FUNCTION__ . '(' . __LINE__ . '):added='.intval($added)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added)); $added = (!SQL_HASZEROAFFECTED()); - //* DEBUG: */ debugOutput(__FUNCTION__ . '(' . __LINE__ . '):added='.intval($added)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added)); } else { - //* DEBUG: */ debugOutput(__FUNCTION__ . '(' . __LINE__ . '):added='.intval($added)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added)); $added = ($added && (!SQL_HASZEROAFFECTED())); - //* DEBUG: */ debugOutput(__FUNCTION__ . '(' . __LINE__ . '):added='.intval($added)); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'added='.intval($added)); } } // END - foreach } // END - if diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php index b720966c23..fd085a87b8 100644 --- a/inc/modules/admin/what-config_beg.php +++ b/inc/modules/admin/what-config_beg.php @@ -77,8 +77,8 @@ if (isFormSent()) { $content['pay_mode_' . strtolower(getBegPayMode())] = ' selected="selected"'; // Init beg_mode elements - foreach (array('direct', 'ref') as $entry) { - $content['beg_mode_' . $entry] = ''; + foreach (array('DIRECT', 'REFERAL') as $entry) { + $content['beg_mode_' . strtolower($entry)] = ''; } // END - foreach // Set default mode diff --git a/inc/modules/admin/what-config_birthday.php b/inc/modules/admin/what-config_birthday.php index 73206717aa..cac121f34c 100644 --- a/inc/modules/admin/what-config_birthday.php +++ b/inc/modules/admin/what-config_birthday.php @@ -47,7 +47,7 @@ if (isFormSent()) { // Save configuration adminSaveSettingsFromPostData(); } else { - // Init all other templates + // Init all other template entries foreach (array('active_y','active_n','mode_direct','mode_ref') as $entry) { $content[$entry] = ''; } // END - foreach diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 478c040521..5f2a8d9e46 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -71,7 +71,7 @@ if (isFormSent()) { setConfigEntry('bonus_disable_notify', postRequestParameter('bonus_disable_notify')); } else { // Transfer options to template - $content['bonus_userid'] = addMemberSelectionBox(getBonusUserId(), false, true, true, 'bonus_userid'); + $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), false, true, true, 'bonus_userid'); // Initialize array for the points list $RANKS = explode(';', getConfig('turbo_rates')); diff --git a/inc/modules/admin/what-config_coupon.php b/inc/modules/admin/what-config_coupon.php index fb9a11a90e..36118680ad 100644 --- a/inc/modules/admin/what-config_coupon.php +++ b/inc/modules/admin/what-config_coupon.php @@ -50,8 +50,22 @@ if (isFormSent()) { // Save data adminSaveSettingsFromPostData(); } else { + // Add userid selection + $content['coupon_userid'] = addMemberSelectionBox(getConfig('coupon_userid'), false, true, true, 'coupon_userid'); + + // Init all other template entries + foreach (array('payment_method_ref', 'payment_method_direct', 'points_account_order', 'points_account_general', 'locked_points_mode_locked', 'locked_points_mode_unlocked') as $entry) { + $content['coupon_' . $entry] = ''; + } // END - foreach + + // Set current selections + foreach (array('payment_method', 'points_account', 'locked_points_mode') as $entry) { + $content['coupon_' . $entry . '_' . strtolower(getConfig('coupon_' . $entry))] = ' checked="checked"'; + } // END - foreach + // Prepare some template data - $content['coupon_default_time_selection'] = createConfigurationTimeSelections('coupon_default_time', 'WDh'); + $content['coupon_default_time_selection'] = createConfigurationTimeSelections('coupon_default_time' , 'WDh'); + $content['coupon_autopurge_time_selection'] = createConfigurationTimeSelections('coupon_autopurge_time', 'WDh'); // Load template loadTemplate('admin_config_coupon', false, $content); diff --git a/inc/modules/admin/what-send_coupon.php b/inc/modules/admin/what-send_coupon.php index a3329ae3e3..b304dbe7ba 100644 --- a/inc/modules/admin/what-send_coupon.php +++ b/inc/modules/admin/what-send_coupon.php @@ -49,7 +49,7 @@ if (isFormSent()) { if (!isPostRequestParameterSet('points')) { // Points not entered displayMessage('{--ADMIN_SEND_COUPON_POINTS_NOT_ENTERED--}'); - } elseif (!isPostRequestParameterSet('description')) { + } elseif (!isPostRequestParameterSet('coupon_description')) { // Description not entered displayMessage('{--ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED--}'); } else { @@ -63,12 +63,12 @@ if (isFormSent()) { $expirationTime = time() + createEpocheTimeFromSelections('coupon_default_time', postRequestArray()); // Insert coupon data - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_coupon_data` (`timestamp_expired`, `total_created`, `points`, `coupon_description`) VALUES('{%%pipe,SQL_EPOCHE_TO_TIMESTAMP=%s%%}', %s,%s,'%s')", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_coupon_data` (`coupon_expired`, `total_created`, `points`, `coupon_description`) VALUES('{%%pipe,SQL_EPOCHE_TO_TIMESTAMP=%s%%}', %s,%s,'%s')", array( $expirationTime, SQL_NUMROWS($result), bigintval(postRequestParameter('points')), - postRequestParameter('description') + postRequestParameter('coupon_description') ), __FILE__, __LINE__ ); @@ -104,7 +104,7 @@ if (isFormSent()) { 'userid' => $userid, 'points' => bigintval(postRequestParameter('points')), 'coupon_code' => $couponCode, - 'coupon_expires' => generateDateTime($expirationTime, '0') + 'coupon_expired' => generateDateTime($expirationTime, '0') ); // Load member email template @@ -123,12 +123,12 @@ if (isFormSent()) { // Prepare content for template $content = array( - 'userids' => implode(',', $adminUserids), - 'userid_count' => count($adminUserids), - 'coupon_id' => $couponId, - 'points' => bigintval(postRequestParameter('points')), - 'description' => postRequestParameter('description'), - 'coupon_expires' => generateDateTime($expirationTime, '0') + 'userids' => implode(',', $adminUserids), + 'userid_count' => count($adminUserids), + 'coupon_id' => $couponId, + 'points' => bigintval(postRequestParameter('points')), + 'coupon_description' => postRequestParameter('coupon_description'), + 'coupon_expired' => generateDateTime($expirationTime, '0') ); // Send admin notification diff --git a/inc/modules/member/what-cash_coupon.php b/inc/modules/member/what-cash_coupon.php index 2984ec788d..90280846df 100644 --- a/inc/modules/member/what-cash_coupon.php +++ b/inc/modules/member/what-cash_coupon.php @@ -53,7 +53,100 @@ if ((!isExtensionActive('coupon')) && (!isAdmin())) { // Is the form sent? if (isFormSent()) { - // @TODO + // Is the coupon code entered? + if (isPostRequestParameterSet('coupon_code')) { + // Search for the coupon + $result = SQL_QUERY_ESC("SELECT + c.`coupon_id`, + UNIX_TIMESTAMP(d.`coupon_created`) AS `coupon_created`, + UNIX_TIMESTAMP(d.`coupon_expired`) AS `coupon_expired`, + d.`coupon_type`, + d.`total_created`, + d.`total_used`, + d.`points`, + d.`coupon_description` +FROM + `{?_MYSQL_PREFIX?}_user_coupons` AS c +INNER JOIN + `{?_MYSQL_PREFIX?}_coupon_data` AS d +ON + c.`coupon_id`=d.`id` +WHERE + c.`coupon_code`='%s' AND + c.`userid`=%s AND + c.`cashed_on` IS NULL AND + UNIX_TIMESTAMP(d.`coupon_expired`) > UNIX_TIMESTAMP() +LIMIT 1", + array( + postRequestParameter('coupon_code'), + getMemberId() + ), __FILE__, __LINE__); + + // Do we have an entry? + if (SQL_NUMROWS($result) == 1) { + // Load data + $content = SQL_FETCHARRAY($result); + + // Mark it as "cashed" + SQL_QUERY_ESC("UPDATE + `{?_MYSQL_PREFIX?}_user_coupons` +SET + `cashed_on`=NOW(), + `coupon_code`=NULL +WHERE + `coupon_code`='%s' AND + `userid`=%s +LIMIT 1", + array( + postRequestParameter('coupon_code'), + getMemberId() + ), __FILE__, __LINE__); + + // Does it work? + if (SQL_HASZEROAFFECTED()) { + // Abort it here, it always must work + debug_report_bug(__FILE__, __LINE__, 'User coupon cannot be updated! coupon_id=' . $content['coupon_id']); + } // END - if + + // Update count as well + SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_coupon_data` SET `total_used`=`total_used`+1 WHERE `id`=%s AND `total_used` < `total_created` LIMIT 1", + array(bigintval($content['coupon_id'])), __FILE__, __LINE__); + + // Does it work? + if (SQL_HASZEROAFFECTED()) { + // Abort it here, it always must work + debug_report_bug(__FILE__, __LINE__, 'Coupon data cannot be updated! coupon_id=' . $content['coupon_id']); + } // END - if + + // Now we just need to book that points on the user's account + addPointsThroughReferalSystem('coupon_cashed', getMemberId(), $content['points'], false, 0, getConfig('coupon_payment_method')); + + // Subtract points from member account if the admin has selected one + if (isValidUserId(getConfig('coupon_userid'))) { + // Subtract from this account + subtractPoints('cashed_coupon', getConfig('coupon_userid'), $content['points']); + } // END - if + + // Translate some data + $content['coupon_expired'] = generateDateTime($content['coupon_expired'], '0'); + $content['coupon_created'] = generateDateTime($content['coupon_created'], '0'); + + // Send admin notification + sendAdminNotification('{--ADMIN_COUPON_CASHED_SUBJECT--}', 'admin_coupon_cashed', $content, getMemberId()); + + // Display message + displayMessage(getMaskedMessage('MEMBER_COUPON_CODE_CASHED', $content['points'])); + } else { + // No coupon found + displayMessage('{--MEMBER_COUPON_CODE_ALREADY_USED--}'); + } + + // Free the result + SQL_FREERESULT($result); + } else { + // No code entered! + displayMessage('{--MEMBER_COUPON_CODE_EMPTY--}'); + } } else { // Load form template loadTemplate('member_cash_coupon', false); diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 65abc76504..5505c9dbb7 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -74,7 +74,7 @@ LIMIT 1", } // END - if // Display it depending on mail (data) type - loadTemplate('member_mail_bonus_'.strtolower($content['data_type']), false, $content); + loadTemplate('member_mail_bonus_' . strtolower($content['data_type']), false, $content); // Free result SQL_FREERESULT($result_data); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 9a774b446c..0ab004d2fc 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -752,7 +752,7 @@ function getActionFromModuleWhat ($module, $what) { // Get it directly from URL return getAction(); } - //* DEBUG: */ debugOutput(__FUNCTION__ . '(' . __LINE__ . '): ret=' . $data['action']); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' ret=' . $data['action']); // Does the module have a menu? if (ifModuleHasMenu($module)) { @@ -1007,16 +1007,16 @@ function getReferalLevelPercents ($level) { * sendNotify = shall I send the referal an email or not? * refid = inc/modules/guest/what-confirm.php need this * locked = Shall I pay it to normal (false) or locked (true) points ammount? - * add_mode = Add points only to $userid or also refs? (WARNING! Changing 'ref' to 'direct' + * add_mode = Add points only to $userid or also refs? (WARNING! Changing 'REFERAL' to 'DIRECT' * for default value will cause no referal will get points ever!!!) */ -function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $addMode = 'ref') { +function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $addMode = 'REFERAL') { // By default nothing has been added $added = false; //* DEBUG: */ debugOutput('----------------------- ' . __FUNCTION__ . ' - ENTRY ------------------------