Extension ext-coupon continued, a lot improvements applied:
authorRoland Häder <roland@mxchange.org>
Tue, 28 Jun 2011 18:11:16 +0000 (18:11 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 28 Jun 2011 18:11:16 +0000 (18:11 +0000)
- Extension ext-coupon: Sending of coupons finished and member form added
- Deprecated variables removed
- All SQLs containing some kind of 'timeout' rewritten
- A lot more code improvements/cleanups applied (I cannot remember all)
- TODOs.txt updated

46 files changed:
.gitattributes
DOCS/TODOs.txt
beg.php
inc/autopurge/purge-general.php
inc/autopurge/purge-inact.php
inc/autopurge/purge-mails.php
inc/autopurge/purge-tsks.php
inc/autopurge/purge-unconfirmed.php
inc/classes/resolver.class.php
inc/daily/daily_birthday.php
inc/daily/daily_profile.php
inc/db/lib-mysql3.php
inc/extensions/ext-coupon.php
inc/filter/bonus_filter.php
inc/filter/online_filter.php
inc/functions.php
inc/language/coupon_de.php
inc/language/de.php
inc/libs/autopurge_functions.php
inc/libs/bonus_functions.php
inc/libs/rallye_functions.php
inc/libs/register_functions.php
inc/libs/task_functions.php
inc/modules/admin/what-config_autopurge.php
inc/modules/admin/what-list_autopurge.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-send_coupon.php
inc/modules/member/action-coupon.php [new file with mode: 0644]
inc/modules/member/what-
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-booking.php
inc/modules/member/what-cash_coupon.php [new file with mode: 0644]
inc/modules/member/what-logout.php
inc/modules/member/what-mydata.php
inc/modules/member/what-order.php
inc/modules/member/what-transfer.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/mysql-manager.php
inc/template-functions.php
inc/wrapper-functions.php
templates/de/emails/member/member_coupon.tpl [new file with mode: 0644]
templates/de/html/member/member_cash_coupon.tpl [new file with mode: 0644]
templates/de/html/menu/menu_member_advert_coupon.tpl [new file with mode: 0644]

index dc5b4944c6dbad480465b38fdb0ac665055298f3..254726a057630422d1e0166d5630034eb4b6206e 100644 (file)
@@ -597,6 +597,7 @@ inc/modules/member/.htaccess svneol=native#text/plain
 inc/modules/member/action- svneol=native#text/plain
 inc/modules/member/action-account.php svneol=native#text/plain
 inc/modules/member/action-bank.php svneol=native#text/plain
 inc/modules/member/action- svneol=native#text/plain
 inc/modules/member/action-account.php svneol=native#text/plain
 inc/modules/member/action-bank.php svneol=native#text/plain
+inc/modules/member/action-coupon.php svneol=native#text/plain
 inc/modules/member/action-earn.php svneol=native#text/plain
 inc/modules/member/action-extras.php svneol=native#text/plain
 inc/modules/member/action-logout.php svneol=native#text/plain
 inc/modules/member/action-earn.php svneol=native#text/plain
 inc/modules/member/action-extras.php svneol=native#text/plain
 inc/modules/member/action-logout.php svneol=native#text/plain
@@ -616,6 +617,7 @@ inc/modules/member/what-beg.php svneol=native#text/plain
 inc/modules/member/what-beg2.php svneol=native#text/plain
 inc/modules/member/what-bonus.php svneol=native#text/plain
 inc/modules/member/what-booking.php svneol=native#text/plain
 inc/modules/member/what-beg2.php svneol=native#text/plain
 inc/modules/member/what-bonus.php svneol=native#text/plain
 inc/modules/member/what-booking.php svneol=native#text/plain
+inc/modules/member/what-cash_coupon.php svneol=native#text/plain
 inc/modules/member/what-categories.php svneol=native#text/plain
 inc/modules/member/what-doubler.php svneol=native#text/plain
 inc/modules/member/what-guest.php svneol=native#text/plain
 inc/modules/member/what-categories.php svneol=native#text/plain
 inc/modules/member/what-doubler.php svneol=native#text/plain
 inc/modules/member/what-guest.php svneol=native#text/plain
@@ -857,6 +859,7 @@ templates/de/emails/member/member_birthday.tpl svneol=native#text/plain
 templates/de/emails/member/member_birthday_confirm.tpl svneol=native#text/plain
 templates/de/emails/member/member_bonus.tpl svneol=native#text/plain
 templates/de/emails/member/member_contct.tpl svneol=native#text/plain
 templates/de/emails/member/member_birthday_confirm.tpl svneol=native#text/plain
 templates/de/emails/member/member_bonus.tpl svneol=native#text/plain
 templates/de/emails/member/member_contct.tpl svneol=native#text/plain
+templates/de/emails/member/member_coupon.tpl svneol=native#text/plain
 templates/de/emails/member/member_del_surfbar_urls.tpl svneol=native#text/plain
 templates/de/emails/member/member_doubler.tpl svneol=native#text/plain
 templates/de/emails/member/member_edit_surfbar_urls.tpl svneol=native#text/plain
 templates/de/emails/member/member_del_surfbar_urls.tpl svneol=native#text/plain
 templates/de/emails/member/member_doubler.tpl svneol=native#text/plain
 templates/de/emails/member/member_edit_surfbar_urls.tpl svneol=native#text/plain
@@ -1564,6 +1567,7 @@ templates/de/html/member/member_bonus.tpl svneol=native#text/plain
 templates/de/html/member/member_bonus_404.tpl svneol=native#text/plain
 templates/de/html/member/member_bonus_row.tpl svneol=native#text/plain
 templates/de/html/member/member_bonus_turbo_row.tpl svneol=native#text/plain
 templates/de/html/member/member_bonus_404.tpl svneol=native#text/plain
 templates/de/html/member/member_bonus_row.tpl svneol=native#text/plain
 templates/de/html/member/member_bonus_turbo_row.tpl svneol=native#text/plain
+templates/de/html/member/member_cash_coupon.tpl svneol=native#text/plain
 templates/de/html/member/member_cat_row.tpl svneol=native#text/plain
 templates/de/html/member/member_cats_footer.tpl svneol=native#text/plain
 templates/de/html/member/member_cats_header.tpl svneol=native#text/plain
 templates/de/html/member/member_cat_row.tpl svneol=native#text/plain
 templates/de/html/member/member_cats_footer.tpl svneol=native#text/plain
 templates/de/html/member/member_cats_header.tpl svneol=native#text/plain
@@ -1686,6 +1690,7 @@ templates/de/html/menu/menu_guest_advert_online.tpl svneol=native#text/plain
 templates/de/html/menu/menu_guest_advert_sponsor.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_account.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_bank.tpl svneol=native#text/plain
 templates/de/html/menu/menu_guest_advert_sponsor.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_account.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_bank.tpl svneol=native#text/plain
+templates/de/html/menu/menu_member_advert_coupon.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_earn.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_end.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_extras.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_earn.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_end.tpl svneol=native#text/plain
 templates/de/html/menu/menu_member_advert_extras.tpl svneol=native#text/plain
index dc7531ef7d6e7b074b6e4ccba706d537a3cff2ca..f0b3a5452dd2f4def6b620003c8dd90d77b794d7 100644 (file)
@@ -8,7 +8,7 @@
 ./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... :-/
 ./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye
 ./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... :-/
 ./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye
-./inc/daily/daily_birthday.php:92:                     // @TODO 4 is hard-coded here, should we move it out in config?
+./inc/daily/daily_birthday.php:95:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
 ./inc/expression-functions.php:46:     // @TODO is escapeQuotes() enougth for strings with single/double quotes?
 ./inc/extensions/ext-html_mail.php:136:                // @TODO Move these arrays into config
 ./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
 ./inc/expression-functions.php:46:     // @TODO is escapeQuotes() enougth for strings with single/double quotes?
 ./inc/extensions/ext-html_mail.php:136:                // @TODO Move these arrays into config
 ./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/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:1219:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1307:                      // @TODO Are these convertions still required?
-./inc/functions.php:1325:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./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/functions.php:163:// @TODO Rewrite this to an extension 'smtp'
 ./inc/functions.php:163:// @TODO Rewrite this to an extension 'smtp'
-./inc/functions.php:1907:      // @TODO Find a way to cache this
-./inc/functions.php:2008:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2188:      // @TODO Rename column data_type to e.g. mail_status
+./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: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);
 ./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);
-./inc/language/de.php:1082:    // @TODO Rewrite these two constants
-./inc/language/de.php:1103:    // @TODO Rewrite these three constants
-./inc/language/de.php:777:// @TODO Are these constants longer used?
+./inc/language/de.php:1083:    // @TODO Rewrite these two constants
+./inc/language/de.php:1104:    // @TODO Rewrite these three constants
+./inc/language/de.php:778:// @TODO Are these constants longer used?
 ./inc/language-functions.php:255:      // @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
 ./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no       *
 ./inc/language-functions.php:255:      // @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
 ./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no       *
 ./inc/modules/admin/what-guest_add.php:80:             // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-holiday_list.php:46:// @TODO Unused at the moment
 ./inc/modules/admin/what-list_autopurge.php:47:// @TODO Rewrite those lines to filter
 ./inc/modules/admin/what-guest_add.php:80:             // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-holiday_list.php:46:// @TODO Unused at the moment
 ./inc/modules/admin/what-list_autopurge.php:47:// @TODO Rewrite those lines to filter
-./inc/modules/admin/what-list_bonus.php:132:           // @TODO Can't this be moved into our expression language?
+./inc/modules/admin/what-list_bonus.php:133:           // @TODO Can't this be moved into our expression language?
 ./inc/modules/admin/what-list_cats.php:54:             // @TODO No longer needed? define('__CATEGORIES_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
 ./inc/modules/admin/what-list_cats.php:69:                             // @TODO Rewrite this to countSum.....() function
 ./inc/modules/admin/what-list_links.php:55:            // @TODO Try to rewrite this to a filter
 ./inc/modules/admin/what-list_cats.php:54:             // @TODO No longer needed? define('__CATEGORIES_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
 ./inc/modules/admin/what-list_cats.php:69:                             // @TODO Rewrite this to countSum.....() function
 ./inc/modules/admin/what-list_links.php:55:            // @TODO Try to rewrite this to a filter
 ./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-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-categories.php:131:          // @TODO Rewrite this to use $OUT .= ...
-./inc/modules/member/what-order.php:426:                       // @TODO Rewrite this to a filter
+./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
+./inc/modules/member/what-order.php:85:                // @TODO Rewrite this to SQL_FETCHARRAY()
 ./inc/modules/member/what-payout.php:194:                                      // @TODO Rewrite this to a filter
 ./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
 ./inc/modules/member/what-rallyes.php:89:      // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&amp;what=impressum&amp;admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
 ./inc/modules/member/what-payout.php:194:                                      // @TODO Rewrite this to a filter
 ./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
 ./inc/modules/member/what-rallyes.php:89:      // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&amp;what=impressum&amp;admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
 ./inc/modules/member/what-unconfirmed.php:142: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/member/what-unconfirmed.php:207:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
 ./inc/modules/order.php:74:            // @TODO Unused: 2,4
 ./inc/modules/member/what-unconfirmed.php:142: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/member/what-unconfirmed.php:207:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
 ./inc/modules/order.php:74:            // @TODO Unused: 2,4
-./inc/monthly/monthly_bonus.php:67:    // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1208:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1468:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1556:          // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1580:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1954:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1998:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/monthly/monthly_bonus.php:64:    // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1211:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1471:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1559:          // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1583:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1957:                  // @TODO Rewrite this to a filter
+./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/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
 ./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/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1050:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1061:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1148:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1181:             // @TODO Add a little more infos here
-./inc/template-functions.php:1492:// @TODO Lame description for this function
-./inc/template-functions.php:1514:                     // @TODO Move this in a filter
+./inc/template-functions.php:1055:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1066:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1153:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1186:             // @TODO Add a little more infos here
+./inc/template-functions.php:1497:// @TODO Lame description for this function
+./inc/template-functions.php:1519:                     // @TODO Move this in a filter
 ./inc/template-functions.php:189:       * @TODO On some pages this is buggy
 ./inc/template-functions.php:265:      // @TODO Remove this sanity-check if all is fine
 ./inc/template-functions.php:189:       * @TODO On some pages this is buggy
 ./inc/template-functions.php:265:      // @TODO Remove this sanity-check if all is fine
-./inc/template-functions.php:578:// @TODO $simple/$constants are deprecated
-./inc/template-functions.php:604:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
+./inc/template-functions.php:583:// @TODO $simple/$constants are deprecated
+./inc/template-functions.php:609:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
 ./inc/wrapper-functions.php:130:// @TODO Implement $compress
 ./inc/wrapper-functions.php:137:// @TODO Implement $decompress
 ./inc/wrapper-functions.php:507:// @TODO Do some more sanity check here
 ./inc/wrapper-functions.php:130:// @TODO Implement $compress
 ./inc/wrapper-functions.php:137:// @TODO Implement $decompress
 ./inc/wrapper-functions.php:507:// @TODO Do some more sanity check here
diff --git a/beg.php b/beg.php
index 9aaef503068c988d604f01297c4b3e4846758b0d..e46a44d872ca2fdc0d0e2ddd35e3a28d8a32e2e6 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -103,8 +103,8 @@ if (isGetRequestParameterSet('userid')) {
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(getUserData('userid')), __FILE__, __LINE__);
 
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(getUserData('userid')), __FILE__, __LINE__);
 
-               // Check for last entry for userid w/o IP number
-               $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE (`timeout` > (UNIX_TIMESTAMP() - {?beg_timeout?}) OR (`timeout` > (UNIX_TIMESTAMP() - {?beg_userid_timeout?}) AND `userid`=%s)) AND (`remote_ip`='%s' OR `sid`='%s') LIMIT 1",
+               // Check for last entry for userid w/o IP number                            12              33                               2    23              44            3                                          21     1                              1
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE ((UNIX_TIMESTAMP() - `timeout`) >= {?beg_timeout?} OR ((UNIX_TIMESTAMP() - `timeout`) >= {?beg_userid_timeout?} AND `userid`=%s)) AND (`remote_ip`='%s' OR `sid`='%s') LIMIT 1",
                        array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                // Entry not found, points set and not logged in?
                        array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                // Entry not found, points set and not logged in?
@@ -116,7 +116,7 @@ if (isGetRequestParameterSet('userid')) {
                                 * but only when there is no admin begging.
                                 * Admins shall be able to test it!
                                 */
                                 * but only when there is no admin begging.
                                 * Admins shall be able to test it!
                                 */
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_beg_ips` (`userid`, `remote_ip`,`sid`, `timeout`) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
+                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_beg_ips` (`userid`, `remote_ip`, `sid`, `timeout`) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
                                        array(
                                                getUserData('userid'),
                                                detectRemoteAddr(),
                                        array(
                                                getUserData('userid'),
                                                detectRemoteAddr(),
index 60831e688c151630cde3f89edd3b3a49aab4511a..30c18977e406b2e62e40ac4afdffd2be1ade0adf 100644 (file)
@@ -59,9 +59,9 @@ FROM
 LEFT JOIN
        `{?_MYSQL_PREFIX?}_payments` AS t
 ON
 LEFT JOIN
        `{?_MYSQL_PREFIX?}_payments` AS t
 ON
-       s.payment_id=t.id
+       s.`payment_id`=t.`id`
 WHERE
 WHERE
-       s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
+       (UNIX_TIMESTAMP() - s.`timestamp_ordered`) >= {?auto_purge?}
 ORDER BY
        s.userid ASC', __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {
 ORDER BY
        s.userid ASC', __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {
index b598c25d0550ca205e37987bd65546a1d4788032..917ff93dd157f18438735df9bf227c0368a05daf 100644 (file)
@@ -47,7 +47,7 @@ if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
 } // END - if
 
 // Shall I look for inactive accounts and autopurge inactive accounts?
 } // END - if
 
 // Shall I look for inactive accounts and autopurge inactive accounts?
-if (getConfig('autopurge_inactive') == 'Y') {
+if (isAutopurgeInactiveEnabled()) {
        // Init SQLs
        initSqls();
 
        // Init SQLs
        initSqls();
 
@@ -55,6 +55,7 @@ if (getConfig('autopurge_inactive') == 'Y') {
        // @TODO Rewrite these if() blocks to a filter
        $EXCLUDE_LIST = '';
        if (isValidUserId(getDefRefid())) $EXCLUDE_LIST .= ' AND `userid` != {?def_refid?}';
        // @TODO Rewrite these if() blocks to a filter
        $EXCLUDE_LIST = '';
        if (isValidUserId(getDefRefid())) $EXCLUDE_LIST .= ' AND `userid` != {?def_refid?}';
+
        // Check for more extensions
        if (isExtensionActive('beg'))     $EXCLUDE_LIST .= ' AND `userid` != {?beg_userid?}';
        if (isExtensionActive('bonus'))   $EXCLUDE_LIST .= ' AND `userid` != {?bonus_userid?}';
        // Check for more extensions
        if (isExtensionActive('beg'))     $EXCLUDE_LIST .= ' AND `userid` != {?beg_userid?}';
        if (isExtensionActive('bonus'))   $EXCLUDE_LIST .= ' AND `userid` != {?bonus_userid?}';
@@ -73,9 +74,9 @@ FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
-       `joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       `last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       `ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
+       (UNIX_TIMESTAMP() - `joined`) >= {?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__);
        " . $EXCLUDE_LIST . "
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
@@ -124,21 +125,21 @@ FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
-       `joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       `last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       `ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_time?})
+       (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)) {
 " . $EXCLUDE_LIST . "
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
        if (!SQL_HASZERONUMS($result_inactive)) {
-               // Prepare variable...
-               $useridsContent = '';
+               // Prepare userid array for admin...
+               $userids = array();
 
                // Delete inactive accounts
                while ($content = SQL_FETCHARRAY($result_inactive)) {
                        // Remember userids for the admin
 
                // Delete inactive accounts
                while ($content = SQL_FETCHARRAY($result_inactive)) {
                        // Remember userids for the admin
-                       $useridsContent .= $content['userid'] . ', ';
+                       $useridsContent[] = $content['userid'];
 
                        // Get date/time from timestamp
                        $content['last_online'] = generateDateTime($content['last_online'], 0);
 
                        // Get date/time from timestamp
                        $content['last_online'] = generateDateTime($content['last_online'], 0);
@@ -147,8 +148,8 @@ ORDER BY
                        deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_delete', $content['last_online'], ''));
                } // END - while
 
                        deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_delete', $content['last_online'], ''));
                } // END - while
 
-               // Remove last comma
-               $useridsContent = str_replace(', ', "\n", substr($useridsContent, 0, -2));
+               // Display all userids
+               $useridsContent = implode("\n", $userids);
 
                // Send mail notification to admin
                if (getConfig('ap_in_notify') == 'Y') {
 
                // Send mail notification to admin
                if (getConfig('ap_in_notify') == 'Y') {
index a12731342f2d9f61d9c33bec78bd4c96722bce2b..61f911bdfaeebb8b3a89ce03ac01d6c55f60ed8b 100644 (file)
@@ -53,7 +53,7 @@ FROM
        `{?_MYSQL_PREFIX?}_pool`
 WHERE
        `data_type`='DELETED' AND
        `{?_MYSQL_PREFIX?}_pool`
 WHERE
        `data_type`='DELETED' AND
-       `timestamp` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+       (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?}
 ORDER BY
        `sender` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `sender` ASC", __FILE__, __LINE__);
 
@@ -80,7 +80,7 @@ FROM
        `{?_MYSQL_PREFIX?}_pool`
 WHERE
        `data_type`='DELETED' AND
        `{?_MYSQL_PREFIX?}_pool`
 WHERE
        `data_type`='DELETED' AND
-       `timestamp` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+       (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?}
 ORDER BY
        `sender` ASC", __FILE__, __LINE__);
                } // END - if
 ORDER BY
        `sender` ASC", __FILE__, __LINE__);
                } // END - if
@@ -96,7 +96,7 @@ $result_mails = SQL_QUERY("SELECT
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
 WHERE
-       `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+       (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?}
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
@@ -119,7 +119,7 @@ if (!SQL_HASZERONUMS($result_mails)) {
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
 WHERE
-       `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+       (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?}
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
                } // END - if
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
                } // END - if
index a8e97cce3ac631073e131ef40b72489ea7a889fd..cc5ccd156f3df417d80a24298f88866725e71629 100644 (file)
@@ -54,7 +54,7 @@ FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
        `status`='DELETED' AND
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
        `status`='DELETED' AND
-       `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__);
+       (UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__);
 
        // Get deleted rows
        $deletedTasks = SQL_AFFECTEDROWS();
 
        // Get deleted rows
        $deletedTasks = SQL_AFFECTEDROWS();
index e5525387b103ba084d69fb68d36a119bf0bd00ce..c4eed02a77ac7fc0c926ad38d295ff08bde9d71d 100644 (file)
@@ -54,7 +54,8 @@ if (getConfig('autopurge_unconfirmed') == 'Y') {
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
-       `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - {?ap_unconfirmed_time?})
+       `status`='UNCONFIRMED' AND
+       (UNIX_TIMESTAMP() - `joined`) >= {?ap_unconfirmed_time?}
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result_uncon)) {
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result_uncon)) {
index 2b5badb44a9e10aaeeb93c3e1ad1e415d2542012..317114d27b6a6215520c705bfa78ba2d50935ecd 100644 (file)
@@ -125,7 +125,7 @@ class HostnameResolver {
        // Purge old entries
        function purgeEntries() {
                // SQL for cleaning up
        // Purge old entries
        function purgeEntries() {
                // SQL for cleaning up
-               SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE UNIX_TIMESTAMP(`added`) < (UNIX_TIMESTAMP() - {?dns_cache_timeout?})',
+               SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`added`) >= {?dns_cache_timeout?})',
                        __METHOD__, __LINE__);
        }
 }
                        __METHOD__, __LINE__);
        }
 }
index 64e89cebd493c4f782e820c86f123d2e4c62b2f1..7167648dc4815758d461bb038a943bfc10f25d74 100644 (file)
@@ -42,6 +42,7 @@ if (!defined('__SECURITY')) {
        // Do not execute when script is in CSS mode
        return;
 } elseif (!isExtensionActive('birthday')) {
        // Do not execute when script is in CSS mode
        return;
 } elseif (!isExtensionActive('birthday')) {
+       // Extension not active/installed
        logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
        return;
 }
        logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
        return;
 }
@@ -54,10 +55,12 @@ $day   = getDay();
 $month = getMonth();
 $year  = getYear();
 
 $month = getMonth();
 $year  = getYear();
 
+// Init variable
+$lastOnline = '';
+
 // Shall I include only active members?
 // Shall I include only active members?
-$add = '%s'; $value = '';
-if ((getConfig('birthday_active')) && (isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
-       $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+if ((getConfig('birthday_active')  == 'Y') && (isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
+       $add = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
 } // END - if
 
 // Only confirmed members shall receive birthday mails...
 } // END - if
 
 // Only confirmed members shall receive birthday mails...
@@ -69,10 +72,10 @@ WHERE
        `birth_day`=%s AND
        `birth_month`=%s AND
        `birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
        `birth_day`=%s AND
        `birth_month`=%s AND
        `birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
-       ".$add."
+       ".$lastOnline."
 ORDER BY
        `userid` ASC",
 ORDER BY
        `userid` ASC",
-       array($day, $month, $value), __FILE__, __LINE__);
+       array($day, $month), __FILE__, __LINE__);
 
 if (!SQL_HASZERONUMS($result_birthday)) {
        // Start sending out birthday mails
 
 if (!SQL_HASZERONUMS($result_birthday)) {
        // Start sending out birthday mails
index 07a03447e6e031562ec4f954505fd6ae2c78d0c1..3e8e9a6d6412b4a12a008fea1dedf02f5d95ee7c 100644 (file)
@@ -59,13 +59,13 @@ FROM
 WHERE
        `status`='CONFIRMED' AND (
                (
 WHERE
        `status`='CONFIRMED' AND (
                (
-                       `last_update` < (UNIX_TIMESTAMP() - {?profile_update?}) AND
+                       (UNIX_TIMESTAMP() - `last_update`) >= {?profile_update?} AND
                        `last_update` > 0 AND
                        `last_update` > 0 AND
-                       `last_profile_sent` < (UNIX_TIMESTAMP() - {?resend_profile_update?})
+                       (UNIX_TIMESTAMP() - `last_profile_sent`) >= {?resend_profile_update?}
                ) OR (
                        `last_update` = 0 AND
                        `last_profile_sent` = 0 AND
                ) OR (
                        `last_update` = 0 AND
                        `last_profile_sent` = 0 AND
-                       `joined` < (UNIX_TIMESTAMP() - {?profile_update?})
+                       (UNIX_TIMESTAMP() - `joined`) >= {?profile_update?}
                )
        )
 ORDER BY
                )
        )
 ORDER BY
index f8c429e42655bda9889c5415c8682d1de2abec4f..13e69f99b9b328df6721c46bdaf003bff3caf8e4 100644 (file)
@@ -547,6 +547,11 @@ function SQL_PREPARE_SQL_STRING ($sqlString, $enableCodes = true) {
        return $GLOBALS['sql_strings'][$sqlString];
 }
 
        return $GLOBALS['sql_strings'][$sqlString];
 }
 
+// Creates a MySQL TIMESTAMP compatible string from given Uni* timestamp
+function SQL_EPOCHE_TO_TIMESTAMP ($timestamp) {
+       return generateDateTime($timestamp, 7);
+}
+
 // Check if there is a SQL table created
 function isSqlTableCreated ($tableName) {
        // Do we have cache?
 // Check if there is a SQL table created
 function isSqlTableCreated ($tableName) {
        // Do we have cache?
index ea480f402bc8dea476999a3a3457bac10b355423..6d3671a88e8f2b2a729f907eead7b60f5d835622 100644 (file)
@@ -57,7 +57,7 @@ switch (getExtensionMode()) {
                addDropTableSql('coupon_data');
                addCreateTableSql('coupon_data', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
                addDropTableSql('coupon_data');
                addCreateTableSql('coupon_data', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`timestamp_created` TIMESTAMP NULL DEFAULT NULL,
+`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `timestamp_expired` TIMESTAMP NULL DEFAULT NULL,
 `coupon_type` ENUM('CODE','API') NOT NULL DEFAULT 'CODE',
 `total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `timestamp_expired` TIMESTAMP NULL DEFAULT NULL,
 `coupon_type` ENUM('CODE','API') NOT NULL DEFAULT 'CODE',
 `total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
@@ -109,12 +109,12 @@ UNIQUE KEY (`coupon_code`)
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
-               addExtensionSql('');
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='coupon' LIMIT 3");
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
-               addExtensionSql('');
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `action`='coupon' LIMIT 3");
                break;
 
        case 'update': // Update an extension
                break;
 
        case 'update': // Update an extension
index b72d994b6c20ec9b848e4533f72ad070ae96b80d..5faccd7cb23669996c6d5b85697a57ad45248511 100644 (file)
@@ -59,7 +59,7 @@ SET
        `last_login`=UNIX_TIMESTAMP()
 WHERE
        `userid`=%s AND
        `last_login`=UNIX_TIMESTAMP()
 WHERE
        `userid`=%s AND
-       `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
+        (UNIX_TIMESTAMP() - `last_login`) >= {?login_timeout?}
 LIMIT 1',
                        array(
                                getMemberId()
 LIMIT 1',
                        array(
                                getMemberId()
@@ -73,7 +73,7 @@ LIMIT 1',
        if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
                // Output message with added points
                $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
        if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
                // Output message with added points
                $GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
-       } elseif (isExtensionActive('bonus')) {
+       } else {
                // No login bonus added!
                $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
        }
                // No login bonus added!
                $GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
        }
index 50fb19a473c78a287188dc881168c8f7456d2509..ca48771cd95e1bdfd76849b0f5be8512a1fa64f2 100644 (file)
@@ -125,7 +125,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Purge old entries
        SQL_FREERESULT($result);
 
        // Purge old entries
-       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
+       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE (UNIX_TIMESTAMP() - `timestamp`) >= {?online_timeout?}', __FUNCTION__, __LINE__);
 }
 
 // [EOF]
 }
 
 // [EOF]
index 1b9710bb8057afb5a247e5d9400949173d6ed9ed..dbb38836ce3805886a5b7280f30b48474b2d9714 100644 (file)
@@ -241,13 +241,18 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) {
 }
 
 // Generate a password in a specified length or use default password length
 }
 
 // Generate a password in a specified length or use default password length
-function generatePassword ($length = '0') {
+function generatePassword ($length = '0', $exclude =  array()) {
        // Auto-fix invalid length of zero
        // Auto-fix invalid length of zero
-       if ($length == '0') $length = getPassLen();
+       if ($length == '0') {
+               $length = getPassLen();
+       } // END - if
 
        // Initialize array with all allowed chars
        $ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
 
 
        // Initialize array with all allowed chars
        $ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
 
+       // Exclude some entries
+       $ABC = array_diff($ABC, $exclude);
+
        // Start creating password
        $PASS = '';
        for ($i = '0'; $i < $length; $i++) {
        // Start creating password
        $PASS = '';
        for ($i = '0'; $i < $length; $i++) {
@@ -293,6 +298,7 @@ function generateDateTime ($time, $mode = '0') {
                                case '4': $ret = date('d.m.Y|H:i:s', $time); break;
                                case '5': $ret = date('d-m-Y (l-F-T)', $time); break;
                                case '6': $ret = date('Ymd', $time); break;
                                case '4': $ret = date('d.m.Y|H:i:s', $time); break;
                                case '5': $ret = date('d-m-Y (l-F-T)', $time); break;
                                case '6': $ret = date('Ymd', $time); break;
+                               case '7': $ret = date('Y-m-d H:i:s', $time); break; // Compatible with MySQL TIMESTAMP
                                default:
                                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                        break;
                                default:
                                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                        break;
@@ -308,6 +314,7 @@ function generateDateTime ($time, $mode = '0') {
                                case '4': $ret = date('d.m.Y|H:i:s', $time); break;
                                case '5': $ret = date('d-m-Y (l-F-T)', $time); break;
                                case '6': $ret = date('Ymd', $time); break;
                                case '4': $ret = date('d.m.Y|H:i:s', $time); break;
                                case '5': $ret = date('d-m-Y (l-F-T)', $time); break;
                                case '6': $ret = date('Ymd', $time); break;
+                               case '7': $ret = date('Y-m-d H:i:s', $time); break; // Compatible with MySQL TIMESTAMP
                                default:
                                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                        break;
                                default:
                                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                        break;
index 0c22a419d0a5aa459ed35af029376f00c54b5b88..90637aca7e136420ddffddff838cbcaba387a721 100644 (file)
@@ -42,9 +42,11 @@ if (!defined('__SECURITY')) {
 
 // Language definitions
 addMessages(array(
 
 // Language definitions
 addMessages(array(
+       // Admin - Configuration
        'ADMIN_CONFIG_COUPON_SETTINGS_TITLE' => "Allgemeine Einstellungen zu den Gutscheinen",
        'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
        'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsverg&uuml;tung in {?POINTS?}. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
        'ADMIN_CONFIG_COUPON_SETTINGS_TITLE' => "Allgemeine Einstellungen zu den Gutscheinen",
        'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
        'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsverg&uuml;tung in {?POINTS?}. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
+       // Admin - Send coupon to members
        'ADMIN_SEND_COUPON_TITLE' => "Gutschein versenden (aktuell nur Code-Gutscheine)",
        'ADMIN_SEND_COUPON_EXPIRATION_TIME' => "Ablaufzeit (ab Versandzeitpunkt)",
        'ADMIN_SEND_COUPON_POINTS' => "Verg&uuml;tung f&uuml;r eingel&ouml;sten Gutschein",
        'ADMIN_SEND_COUPON_TITLE' => "Gutschein versenden (aktuell nur Code-Gutscheine)",
        'ADMIN_SEND_COUPON_EXPIRATION_TIME' => "Ablaufzeit (ab Versandzeitpunkt)",
        'ADMIN_SEND_COUPON_POINTS' => "Verg&uuml;tung f&uuml;r eingel&ouml;sten Gutschein",
@@ -52,6 +54,16 @@ addMessages(array(
        'ADMIN_SEND_COUPON' => "Gutschein versenden",
        'ADMIN_SEND_COUPON_POINTS_NOT_ENTERED' => "Bitte geben Sie eine Verg&uuml;tung (in {?POINTS?}) ein.",
        'ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED' => "Bitte geben Sie eine kurze Beschreibung (oder einen Hinweis an Ihre Mitglieder) ein.",
        'ADMIN_SEND_COUPON' => "Gutschein versenden",
        'ADMIN_SEND_COUPON_POINTS_NOT_ENTERED' => "Bitte geben Sie eine Verg&uuml;tung (in {?POINTS?}) ein.",
        'ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED' => "Bitte geben Sie eine kurze Beschreibung (oder einen Hinweis an Ihre Mitglieder) ein.",
+
+       // Member
+       'MEMBER_CASH_COUPON_TITLE' => "Gutschein einl&ouml;sen",
+       '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&ouml;sen",
+       'MEMBER_ENTER_COUPON_CODE' => "Gutschein-Code eingeben:",
+
+       // Subject lines
+       'MEMBER_COUPON_SUBJECT' => "Gutschein bei {?MAIN_TITLE?}",
+       'ADMIN_COUPON_SUBJECT'  => "Es wurde ein Gutschein versendet",
 ));
 
 // [EOF]
 ));
 
 // [EOF]
index cbe6b8df3eec4a64033d1669e178cc9979a00bc9..5dc0b744eb32b79584e433b47108a90072ff5e03 100644 (file)
@@ -213,7 +213,8 @@ addMessages(array(
        'ADMIN_ENTER_POINTS_REGISTER' => "Willkommensgutschrift",
        'ADMIN_ENTER_POINTS_REFERAL' => "Einmalige Referal-Gutschrift",
        'CHOOSE_MORE_CATEGORIES' => "Bitte w&auml;hlen Sie mehr Kategorien aus! Minimum ist: <span class=\"data\">{?least_cats?}</span>",
        'ADMIN_ENTER_POINTS_REGISTER' => "Willkommensgutschrift",
        'ADMIN_ENTER_POINTS_REFERAL' => "Einmalige Referal-Gutschrift",
        'CHOOSE_MORE_CATEGORIES' => "Bitte w&auml;hlen Sie mehr Kategorien aus! Minimum ist: <span class=\"data\">{?least_cats?}</span>",
-       'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
+       'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns nicht erlaubt.",
+       'MEMBER_EMAIL_IS_ALREADY_REGISTERED' => "Die Email-Adresse wird bereits von einem anderen Account verwendet.",
        'ADMIN_CONFIG_REJECT_DOUBLE_EMAIL' => "Doppelt angemeldete Email-Adressen ablehnen?",
        'ADMIN_EDIT_POINTS' => "Willkommensgutschrift und andere Festbetr&auml;ge editieren",
        'ADMIN_EDIT_REFERAL_DEPTHS' => "Referal-Ebenen editieren / l&ouml;schen / hinzuf&uuml;gen",
        'ADMIN_CONFIG_REJECT_DOUBLE_EMAIL' => "Doppelt angemeldete Email-Adressen ablehnen?",
        'ADMIN_EDIT_POINTS' => "Willkommensgutschrift und andere Festbetr&auml;ge editieren",
        'ADMIN_EDIT_REFERAL_DEPTHS' => "Referal-Ebenen editieren / l&ouml;schen / hinzuf&uuml;gen",
index ccd77450465dbda18bf086ed979ee6573e55a9a4..270c7a9f90fb98be1589434d8cf62122ebb80539 100644 (file)
@@ -56,7 +56,7 @@ function addPointsAutoPurge ($userid, $points) {
        sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
 }
 
        sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
 }
 
-// Checks wether auto-purging is active
+// Checks wether auto-purging is enabled
 function isAutoPurgingActive () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
 function isAutoPurgingActive () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
@@ -68,5 +68,29 @@ function isAutoPurgingActive () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// Wrapper for 'autopurge_inactive
+function getAutopurgeInactive () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getConfig('autopurge_inactive') == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether purging of inactive accounts is enabled
+function isAutopurgeInactiveEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getAutopurgeInactive() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index db0a942de571c92be5943e51b26045cea3ef01d7..bd3948445860d43f39270df080dfdb1f82804aee 100644 (file)
@@ -268,7 +268,7 @@ function handleBonusPoints ($mode) {
 // Purges expired fast-click bonus entries
 function purgeExpiredTurboBonus() {
        // Remove entries
 // Purges expired fast-click bonus entries
 function purgeExpiredTurboBonus() {
        // Remove entries
-       $result = SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `timemark` < (UNIX_TIMESTAMP() - {?bonus_timeout?})', __FUNCTION__, __LINE__);
+       $result = SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE (UNIX_TIMESTAMP() - `timemark`) >= {?bonus_timeout?}', __FUNCTION__, __LINE__);
 
        if (!SQL_HASZEROAFFECTED()) {
                // Send out email to admin
 
        if (!SQL_HASZEROAFFECTED()) {
                // Send out email to admin
index 99c029890f7c38938072886f53007913bd52c03a..1d50a4d95c23f48e3f9e9a656f89906719cbe56f 100644 (file)
@@ -771,7 +771,7 @@ function purgeExpiredReferalRallyes () {
 FROM
        `{?_MYSQL_PREFIX?}_rallye_data`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_rallye_data`
 WHERE
-       `end_time` <= (UNIX_TIMESTAMP() - {?ONE_DAY?} - %s) AND
+       (UNIX_TIMESTAMP() - `end_time`) > ({?ONE_DAY?} * %s) AND
        `expired`='Y'",
                array($EXPIRE), __FUNCTION__, __LINE__);
 
        `expired`='Y'",
                array($EXPIRE), __FUNCTION__, __LINE__);
 
index 85af2723d934b35d61c1673b0d626ba1bbadedaf..8eb91a20cb08d6d4e0dbfd02d8243b6b91cbaf69 100644 (file)
@@ -237,7 +237,7 @@ function isRegistrationDataComplete () {
 
        if ((postRequestParameter('email') != '!') && (isCheckDoubleEmailEnabled())) {
                // Does the email address already exists in our database?
 
        if ((postRequestParameter('email') != '!') && (isCheckDoubleEmailEnabled())) {
                // Does the email address already exists in our database?
-               if ((!isAdmin()) && (isEmailTaken(postRequestParameter('email')))) {
+               if ((isEmailTaken(postRequestParameter('email'))) && (!isAdmin())) {
                        setPostRequestParameter('email', '?');
                        $isOkay = false;
                } // END - if
                        setPostRequestParameter('email', '?');
                        $isOkay = false;
                } // END - if
@@ -482,30 +482,6 @@ function getIpTimeout () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
-// Getter for 'check_double_email'
-function getCheckDoubleEmail () {
-       // Is the cache entry set?
-       if (!isset($GLOBALS[__FUNCTION__])) {
-               // No, so determine it
-               $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
-       } // END - if
-
-       // Return cached entry
-       return $GLOBALS[__FUNCTION__];
-}
-
-// Checks wether 'check_double_email' is "YES"
-function isCheckDoubleEmailEnabled () {
-       // Is the cache entry set?
-       if (!isset($GLOBALS[__FUNCTION__])) {
-               // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
-       } // END - if
-
-       // Return cached entry
-       return $GLOBALS[__FUNCTION__];
-}
-
 // Getter for 'register_default'
 function getRegisterDefault () {
        // Is the cache entry set?
 // Getter for 'register_default'
 function getRegisterDefault () {
        // Is the cache entry set?
index 7636970fd7924d012a5f2c0f8689934a3dbc8ffe..d8e62f093197855ab067388ec525015417f88fc6 100644 (file)
@@ -253,9 +253,9 @@ FROM
        `{?_MYSQL_PREFIX?}_user_data` AS d
 WHERE
        d.`status`='CONFIRMED' AND
        `{?_MYSQL_PREFIX?}_user_data` AS d
 WHERE
        d.`status`='CONFIRMED' AND
-       d.joined < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       d.last_online < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       d.ap_notified < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
+       (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND
+       (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND
+       (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?}
 ".$EXCLUDE_LIST."
 ORDER BY
        d.userid ASC");
 ".$EXCLUDE_LIST."
 ORDER BY
        d.userid ASC");
@@ -332,11 +332,13 @@ ORDER BY
                        $USE = 'turbo_bonus';
                }
 
                        $USE = 'turbo_bonus';
                }
 
-               // Autopurge installed?
+               // Init variable
                $lastOnline = '';
                $lastOnline = '';
-               if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
+
+               // Autopurge installed?
+               if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
                        // Use last online timestamp to keep inactive members away from here
                        // Use last online timestamp to keep inactive members away from here
-                       $lastOnline   = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
+                       $lastOnline   = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
                } // END - if
 
                addSql("SELECT
                } // END - if
 
                addSql("SELECT
@@ -356,13 +358,15 @@ ORDER BY
        }
 
        if (isExtensionInstalledAndNewer('beg', '0.1.2')) {
        }
 
        if (isExtensionInstalledAndNewer('beg', '0.1.2')) {
-               // Begging rallye
+               // ----- Begging rallye -----
 
 
-               // Autopurge installed?
+               // Init variable
                $lastOnline = '';
                $lastOnline = '';
-               if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
+
+               // Autopurge installed?
+               if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
                        // Use last online timestamp to keep inactive members away from here
                        // Use last online timestamp to keep inactive members away from here
-                       $lastOnline   = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
+                       $lastOnline   = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
                } // END - if
 
                addSql("SELECT
                } // END - if
 
                addSql("SELECT
index 93e24239cdece47bb4e35beb80b8c81519a6f274..61f640ec9ffb438e3c99211701af65aa3a57604b 100644 (file)
@@ -48,7 +48,7 @@ if (isFormSent()) {
        adminSaveSettingsFromPostData();
 } else {
        // Output de-/activation selections
        adminSaveSettingsFromPostData();
 } else {
        // Output de-/activation selections
-       $content['ap_inactive_selection']    = addSelectionBox('yn', getConfig('autopurge_inactive')   , 'autopurge_inactive');
+       $content['ap_inactive_selection']    = addSelectionBox('yn', getAutopurgeInactive()   , 'autopurge_inactive');
        $content['ap_unconfirmed_selection'] = addSelectionBox('yn', getConfig('autopurge_unconfirmed'), 'autopurge_unconfirmed');
        $content['ap_tasks_selection']       = addSelectionBox('yn', getConfig('autopurge_tasks')      , 'autopurge_tasks');
        $content['ap_del_mails_selection']   = addSelectionBox('yn', getConfig('ap_del_mails')         , 'ap_del_mails');
        $content['ap_unconfirmed_selection'] = addSelectionBox('yn', getConfig('autopurge_unconfirmed'), 'autopurge_unconfirmed');
        $content['ap_tasks_selection']       = addSelectionBox('yn', getConfig('autopurge_tasks')      , 'autopurge_tasks');
        $content['ap_del_mails_selection']   = addSelectionBox('yn', getConfig('ap_del_mails')         , 'ap_del_mails');
index 1aa19ca73bea3118c0ac2b28e4d3be5eae70cf84..b10ac0abe459dd88c933a9e6bae1f5e5410acaa9 100644 (file)
@@ -59,9 +59,9 @@ FROM
        `{?_MYSQL_PREFIX?}_user_data` AS d
 WHERE
        d.`status`='CONFIRMED' AND
        `{?_MYSQL_PREFIX?}_user_data` AS d
 WHERE
        d.`status`='CONFIRMED' AND
-       d.`joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       d.`last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
-       d.`ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
+       (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND
+       (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND
+       (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?}
        ".$EXCLUDE_LIST."
 ORDER BY
        d.`userid` ASC", __FILE__, __LINE__);
        ".$EXCLUDE_LIST."
 ORDER BY
        d.`userid` ASC", __FILE__, __LINE__);
index f349aee801b404d41e0e37f163f79f8c3e119c0e..654f7eccca0a90e6a3598fdfeb5bb7f17af8bf4b 100644 (file)
@@ -53,11 +53,13 @@ if (isBegRallyeEnabled()) {
                displayMessage('{--ADMIN_BEG_WITHDRAW_PREPARED--}');
        } // END - if
 
                displayMessage('{--ADMIN_BEG_WITHDRAW_PREPARED--}');
        } // END - if
 
-       // Autopurge installed?
+       // Init variable
        $lastOnline = '';
        $lastOnline = '';
-       if (isExtensionActive('autopurge')) {
+
+       // Autopurge installed?
+       if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
                // Use last online timestamp to keep inactive members away from here
                // Use last online timestamp to keep inactive members away from here
-               $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+               $lastOnline   = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
        } // END - if
 
        // Check if at least one is in the active rallye
        } // END - if
 
        // Check if at least one is in the active rallye
index f1749a980b3969e315dc05e00ec259ce824d63a3..0c8129d11d2f89124b69b5f526b192b2695a0ff6 100644 (file)
@@ -67,27 +67,28 @@ if (isBonusRallyeActive()) {
                $USE = '`turbo_bonus`';
        }
 
                $USE = '`turbo_bonus`';
        }
 
+       // Init variables
+       $lastOnline = '';
+
        // Autopurge installed?
        // Autopurge installed?
-       $lastOnline = '%s'; $ONLINE = '';
-       if (isExtensionActive('autopurge')) {
+       if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
                // Use last online timestamp to keep inactive members away from here
                // Use last online timestamp to keep inactive members away from here
-               $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+               $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
        } // END - if
 
        // Check if at least one is in the active rallye
        } // END - if
 
        // Check if at least one is in the active rallye
-       $result = SQL_QUERY_ESC("SELECT
+       $result = SQL_QUERY("SELECT
        `userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS `points`, `last_online`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
        `userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS `points`, `last_online`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
        `status`='CONFIRMED' AND
-       ".$USE." > 0
-       ".$lastOnline."
+       " . $USE . " > 0
+       " . $lastOnline . "
 ORDER BY
        `points` DESC,
        `last_online` DESC,
 ORDER BY
        `points` DESC,
        `last_online` DESC,
-       `userid` ASC",
-               array($ONLINE), __FILE__, __LINE__);
+       `userid` ASC", __FILE__, __LINE__);
 
        if (!SQL_HASZERONUMS($result)) {
                // List users
 
        if (!SQL_HASZERONUMS($result)) {
                // List users
index 2e4d66a2fcd9ab44b721d01aeb34b033c1f02a7b..a3329ae3e3614f4a1518b46e324d44ed775fbece 100644 (file)
@@ -54,6 +54,88 @@ if (isFormSent()) {
                displayMessage('{--ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED--}');
        } else {
                // All fields are set, so we can start looking for users who wants to receive coupons
                displayMessage('{--ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED--}');
        } else {
                // All fields are set, so we can start looking for users who wants to receive coupons
+               $result = SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `receiving_coupons`='Y' ORDER BY `userid` ASC",
+                       __FILE__, __LINE__);
+
+               // Do we have entries left?
+               if (SQL_NUMROWS($result) > 0) {
+                       // Convert timestamp selections
+                       $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')",
+                               array(
+                                       $expirationTime,
+                                       SQL_NUMROWS($result),
+                                       bigintval(postRequestParameter('points')),
+                                       postRequestParameter('description')
+                               ), __FILE__, __LINE__
+                       );
+
+                       // Get the insert id from the table
+                       $couponId = SQL_INSERTID();
+
+                       // Load entry
+                       while (list($userid) = SQL_FETCHROW($result)) {
+                               // By default no code is unique
+                               $isUnique = false;
+                               $couponCode = '';
+
+                               // Look for a unique id
+                               while (!$isUnique) {
+                                       /**
+                                        * Add a coupon for this user, first we need to create a
+                                        * table-unique "id". The function generatePassword() can do
+                                        * this job for us but we want to exclude some characters.
+                                        */
+                                       $couponCode = generatePassword(30, array('-','+','_','/','.'));
+
+                                       // Is it really unique?
+                                       $isUnique = (countSumTotalData($couponCode, 'user_coupons', 'id', 'coupon_code', true) == 0);
+                               } // END - while
+
+                               // The above loop should always set $couponCode, so we can now insert it
+                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_coupons` (`coupon_id`, `userid`, `coupon_code`) VALUES(%s,%s,'%s')",
+                                       array($couponId, $userid, $couponCode), __FILE__, __LINE__);
+
+                               // Fill array with all required data
+                               $content = array(
+                                       'coupon_id'      => $couponId,
+                                       'userid'         => $userid,
+                                       'points'         => bigintval(postRequestParameter('points')),
+                                       'coupon_code'    => $couponCode,
+                                       'coupon_expires' => generateDateTime($expirationTime, '0')
+                               );
+
+                               // Load member email template
+                               $mailText = loadEmailTemplate('member_coupon', $content, $userid);
+
+                               // And deliver it
+                               sendEmail($userid, '{--MEMBER_COUPON_SUBJECT--}', $mailText);
+
+                               // Rember this user for the admin email
+                               $adminUserids[] = $userid;
+                       } // END - while
+               } else {
+                       // No user was found
+                       displayMessage('{--ADMIN_SEND_COUPON_USER_404--}');
+               }
+
+               // 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')
+               );
+
+               // Send admin notification
+               sendAdminNotification('{--ADMIN_COUPON_SUBJECT--}', 'admin_coupon', $content);
+
+               // Free result
+               SQL_FREERESULT($result);
        }
 } else {
        // Prepare some template data
        }
 } else {
        // Prepare some template data
diff --git a/inc/modules/member/action-coupon.php b/inc/modules/member/action-coupon.php
new file mode 100644 (file)
index 0000000..645231f
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 28/06/2011 *
+ * ===================                          Last change: 28/06/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-coupon.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Coupons                                          *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Gutscheine                                       *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} elseif (!isMember()) {
+       redirectToIndexMemberOnlyModule();
+} elseif (isBlockModeEnabled()) {
+       // Block mode detected
+       return;
+}
+
+// Add description as navigation point
+addYouAreHereLink('member', __FILE__);
+
+if ((!isExtensionActive('coupon')) && (!isAdmin())) {
+       displayMessage(generateExtensionInactiveNotInstalledMessage('coupon'));
+       return;
+} // END - if
+
+// Load the include file
+$inc = sprintf("inc/modules/member/what-%s.php", getWhat());
+if (isIncludeReadable($inc)) {
+       // Ok, we finally load the member action module
+       loadInclude($inc);
+} else {
+       addFatalMessage(__FILE__, __LINE__, '{--MEMBER_404_WHAT--}', getWhat());
+}
+
+// [EOF]
+?>
index e1e3056127e476e7d17167b85cab24e61eb3ab2a..71eb76f2296f20428809383e96a8211d9cacfe48 100644 (file)
@@ -45,6 +45,12 @@ if (!defined('__SECURITY')) {
 // Add description as navigation point
 addYouAreHereLink('member', __FILE__);
 
 // Add description as navigation point
 addYouAreHereLink('member', __FILE__);
 
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('')) && (!isAdmin())) {
+       displayMessage(generateExtensionInactiveNotInstalledMessage(''));
+       return;
+} // END - if
+
 // Loads the name-matching template
 loadTemplate(substr(basename(__FILE__), 5, -4));
 
 // Loads the name-matching template
 loadTemplate(substr(basename(__FILE__), 5, -4));
 
index 30ff574716be4f119a1e904f4b8fc1ba4fdeac20..78285c2ca14ab22e2d9d034b7e14bff337216c6c 100644 (file)
@@ -54,9 +54,9 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) {
 $lastOnline = '%s';
 $ONLINE = '';
 
 $lastOnline = '%s';
 $ONLINE = '';
 
-if (isExtensionActive('autopurge')) {
+if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
        // Use last online timestamp to keep inactive members away from here
        // Use last online timestamp to keep inactive members away from here
-       $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+       $lastOnline   = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
 } // END - if
 
 // Let's check if there are some points left we can pay...
 } // END - if
 
 // Let's check if there are some points left we can pay...
index 2fc94b378ae610245231f27453fd96514b972215..0850e128535bb79f7623b3115785a139ca815e92 100644 (file)
@@ -65,11 +65,14 @@ if (isExtensionInstalledAndNewer('bonus', '0.6.9')) {
        $USE = '`turbo_bonus`';
 }
 
        $USE = '`turbo_bonus`';
 }
 
+// Init variables
+$lastOnline = '%s';
+$ONLINE = '';
+
 // Autopurge installed?
 // Autopurge installed?
-$lastOnline = '%s'; $ONLINE = '';
-if (isExtensionActive('autopurge')) {
+if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
        // Use last online timestamp to keep inactive members away from here
        // Use last online timestamp to keep inactive members away from here
-       $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+       $lastOnline   = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
 } // END - if
 
 // Let's check if there are some points left we can 'pay'...
 } // END - if
 
 // Let's check if there are some points left we can 'pay'...
index 27a9d9e26656e6b8b2421b2efffde85d7ec9fcf8..210450fbfd45f1980ceb2c47c5f247b00f42bd46 100644 (file)
@@ -45,5 +45,11 @@ if (!defined('__SECURITY')) {
 // Add description as navigation point
 addYouAreHereLink('member', __FILE__);
 
 // Add description as navigation point
 addYouAreHereLink('member', __FILE__);
 
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('booking')) && (!isAdmin())) {
+       displayMessage(generateExtensionInactiveNotInstalledMessage('booking'));
+       return;
+} // END - if
+
 // [EOF]
 ?>
 // [EOF]
 ?>
diff --git a/inc/modules/member/what-cash_coupon.php b/inc/modules/member/what-cash_coupon.php
new file mode 100644 (file)
index 0000000..2984ec7
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 28/06/2011 *
+ * ===================                          Last change: 28/06/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-cash_coupon.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : To cash a coupon                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einen Gutschein einloesen                        *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} elseif (!isMember()) {
+       redirectToIndexMemberOnlyModule();
+}
+
+// Add description as navigation point
+addYouAreHereLink('member', __FILE__);
+
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('coupon')) && (!isAdmin())) {
+       displayMessage(generateExtensionInactiveNotInstalledMessage('coupon'));
+       return;
+} // END - if
+
+// Is the form sent?
+if (isFormSent()) {
+       // @TODO
+} else {
+       // Load form template
+       loadTemplate('member_cash_coupon', false);
+}
+
+// [EOF]
+?>
index 9f98cf504767c8013622c9d2c045d6335f12b262..88abed7a7a62a4995131fbe7f2793d68596e0f93 100644 (file)
@@ -14,6 +14,7 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
+ * @TODO Rewrite the code to a filter                                   *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
@@ -47,7 +48,9 @@ $url = 'modules.php?module=index&amp;code=';
 
 if (destroyMemberSession()) {
        // Remove theme cookie as well
 
 if (destroyMemberSession()) {
        // Remove theme cookie as well
-       if (isExtensionActive('theme')) setTheme('');
+       if (isExtensionActive('theme')) {
+               setTheme('');
+       } // END - if
 
        // Logout completed
        $url .= getCode('LOGOUT_DONE');
 
        // Logout completed
        $url .= getCode('LOGOUT_DONE');
index d30f62a40fe1a999c45a4b4d8baf628d0b22ff2a..4b9f8584bfba94b645818ee4e8e9265ac271f48c 100644 (file)
@@ -188,13 +188,16 @@ LIMIT 1",
 
                // How far is last change on his profile away from now?
                if (($content['update_check'] > time()) && (!isAdmin()) && (getProfileLock() > 0)) {
 
                // How far is last change on his profile away from now?
                if (($content['update_check'] > time()) && (!isAdmin()) && (getProfileLock() > 0)) {
+                       // You cannot change your account
                        $content['update_check'] = generateDateTime($content['update_check'] + getProfileLock(), 0);
 
                        $content['update_check'] = generateDateTime($content['update_check'] + getProfileLock(), 0);
 
-                       // You cannot change your account
                        displayMessage($content['update_check']);
                } elseif ((!isEmailValid(postRequestParameter('email'))) && (!isAdmin())) {
                        // Invalid email address!
                        displayMessage('{--INVALID_EMAIL_ENTERED--}');
                        displayMessage($content['update_check']);
                } elseif ((!isEmailValid(postRequestParameter('email'))) && (!isAdmin())) {
                        // Invalid email address!
                        displayMessage('{--INVALID_EMAIL_ENTERED--}');
+               } elseif ((isEmailTaken(postRequestParameter('email'))) && (isCheckDoubleEmailEnabled()) && (!isAdmin())) {
+                       // Email address is already registered
+                       displayMessage('{--MEMBER_EMAIL_IS_ALREADY_REGISTERED--}');
                } else {
                        // Generate hash
                        $hash = generateHash(postRequestParameter('pass1'), substr($content['password'], 0, -40));
                } else {
                        // Generate hash
                        $hash = generateHash(postRequestParameter('pass1'), substr($content['password'], 0, -40));
index 0110dfec0235d9d7abf867882033ebeb7b02bed3..f1d4a2444c179500f701339fd4ed2360b677c02e 100644 (file)
@@ -72,7 +72,7 @@ FROM
 WHERE
        `sender`=%s AND
        `url`='%s' AND
 WHERE
        `sender`=%s AND
        `url`='%s' AND
-       `timestamp` > (UNIX_TIMESTAMP() - {?url_tlock?})
+       (UNIX_TIMESTAMP() - `timestamp`) >= {?url_tlock?}
 LIMIT 1",
                array(
                        getMemberId(),
 LIMIT 1",
                array(
                        getMemberId(),
@@ -82,6 +82,7 @@ LIMIT 1",
        $type = 'TEMP'; $id = '0';
        if (SQL_NUMROWS($result) == 1) {
                // Load id and mail type
        $type = 'TEMP'; $id = '0';
        if (SQL_NUMROWS($result) == 1) {
                // Load id and mail type
+               // @TODO Rewrite this to SQL_FETCHARRAY()
                list($id, $type) = SQL_FETCHROW($result);
        } // END - if
 
                list($id, $type) = SQL_FETCHROW($result);
        } // END - if
 
index cf6fec76cfa512bc46b1a8b9491cee4e4121fde4..4255b1f6d8a28e429944d981b2917c1d7a918b9d 100644 (file)
@@ -504,7 +504,7 @@ KEY (`party_userid`)
 FROM
        `{?_MYSQL_PREFIX?}_user_transfers_out`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_user_transfers_out`
 WHERE
-       `time_trans` > (UNIX_TIMESTAMP() - {?transfer_timeout?}) AND
+       (UNIX_TIMESTAMP() - `time_trans`) >= {?transfer_timeout?} AND
        `userid`=%s
 ORDER BY
        `time_trans` DESC
        `userid`=%s
 ORDER BY
        `time_trans` DESC
index c1effc065c918e777e5a0581d5dee514865a223c..fa34df7d042891c64866fb3c7170e034014ceed3 100644 (file)
@@ -52,21 +52,18 @@ if (!defined('__SECURITY')) {
 // Check if month is done
 if ((getBegRanks() > 0) && (!isCssOutputMode())) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
 // Check if month is done
 if ((getBegRanks() > 0) && (!isCssOutputMode())) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
-       $whereStatement1 = '';
+       $whereStatement = '';
 
        // Shall we exclude webmaster's own userid?
        if ((!isBegIncludeOwnEnabled()) && (isValidUserId(getBegUserid()))) {
                // Exclude it
 
        // Shall we exclude webmaster's own userid?
        if ((!isBegIncludeOwnEnabled()) && (isValidUserId(getBegUserid()))) {
                // Exclude it
-               $whereStatement1 = " AND `userid` != {?beg_userid?}";
+               $whereStatement = " AND `userid` != {?beg_userid?}";
        } // END - if
 
        // Let's check if there are some points left we can pay...
        } // END - if
 
        // Let's check if there are some points left we can pay...
-       if (isExtensionActive('autopurge')) {
-               // Use last online stamp only when autopurge for inactive members is activated
-               if ((getApInactiveSince() > 0) && (isBegActiveEnabled())) {
-                       // Okay, include last online timestamp
-                       $whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
-               } // END - if
+       if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
+               // Okay, include last online timestamp
+               $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
        } // END - if
 
        // SQL string to check for accounts
        } // END - if
 
        // SQL string to check for accounts
@@ -75,7 +72,7 @@ if ((getBegRanks() > 0) && (!isCssOutputMode())) {
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
-       `status`='CONFIRMED'" . $whereStatement1 . " AND
+       `status`='CONFIRMED'" . $whereStatement . " AND
        `beg_points` > 0
 ORDER BY
        `beg_points` DESC,
        `beg_points` > 0
 ORDER BY
        `beg_points` DESC,
index ca916cb6bc5cffa5d892d51261882d19732c1a93..a4b8f85652420ac6e163c4a203929edef8d6fb42 100644 (file)
@@ -51,15 +51,12 @@ if (!defined('__SECURITY')) {
 
 if ((getConfig('bonus_ranks') > 0) && (!isCssOutputMode())) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
 
 if ((getConfig('bonus_ranks') > 0) && (!isCssOutputMode())) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
-       $whereStatement1 = "WHERE `status`='CONFIRMED'";
+       $whereStatement = "WHERE `status`='CONFIRMED'";
 
        // Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
 
        // Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
-       if (isExtensionActive('autopurge')) {
-               // Use last online stamp only when autopurge for inactive members is activated
-               if (getApInactiveSince() > 0) {
-                       // Okay, include last online timestamp
-                       $whereStatement1 = "WHERE `status`='CONFIRMED' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
-               } // END - if
+       if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
+               // Okay, include last online timestamp
+               $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
        } // END - if
 
        // Add more bonus points here
        } // END - if
 
        // Add more bonus points here
@@ -73,7 +70,7 @@ if ((getConfig('bonus_ranks') > 0) && (!isCssOutputMode())) {
 
        // Shall we add some entries?
        if (!empty($add)) {
 
        // Shall we add some entries?
        if (!empty($add)) {
-               $whereStatement1 .= ' AND (0' . $add . ') > 0';
+               $whereStatement .= ' AND (0' . $add . ') > 0';
        } // END - if
 
        // Run SQL string to check for accounts
        } // END - if
 
        // Run SQL string to check for accounts
@@ -81,7 +78,7 @@ if ((getConfig('bonus_ranks') > 0) && (!isCssOutputMode())) {
        `userid`, `email`, `gender`, `surname`, `family`, (0' . $add . ') AS `points`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
        `userid`, `email`, `gender`, `surname`, `family`, (0' . $add . ') AS `points`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
-' . $whereStatement1 . '
+' . $whereStatement . '
 ORDER BY
        `points` DESC,
        `userid` ASC
 ORDER BY
        `points` DESC,
        `userid` ASC
index 15a1126c27fbe6fb653f4e6098cf3f0895b892e2..9a774b446cebaa14de8930dc3375e201b04e7cda 100644 (file)
@@ -630,18 +630,21 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
 
 // Checks wether the given email address is used.
 function isEmailTaken ($email) {
 
 // Checks wether the given email address is used.
 function isEmailTaken ($email) {
+       // Replace dot with {DOT}
+       $email = str_replace('.', '{DOT}', $email);
+
        // Query the database
        // Query the database
-       $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '%%%s%%' OR `email` LIKE '%%%s%%' LIMIT 1",
-               array($email, str_replace('.', '{DOT}', $email)), __FUNCTION__, __LINE__);
+       $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '%%%s%%' LIMIT 1",
+               array($email), __FUNCTION__, __LINE__);
 
        // Is the email there?
 
        // Is the email there?
-       $ret = (SQL_NUMROWS($result) == 1);
+       $isTaken = (SQL_NUMROWS($result) == 1);
 
        // Free the result
        SQL_FREERESULT($result);
 
        // Return result
 
        // Free the result
        SQL_FREERESULT($result);
 
        // Return result
-       return $ret;
+       return $isTaken;
 }
 
 // Validate the given menu action
 }
 
 // Validate the given menu action
@@ -665,7 +668,7 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry=false) {
        //* DEBUG: */ debugOutput(__LINE__ . ':' . $mode . '/' . $action . '/' . $what . '*');
        if (($mode != 'admin') && ($updateEntry === true)) {
                // Update guest or member menu
        //* DEBUG: */ debugOutput(__LINE__ . ':' . $mode . '/' . $action . '/' . $what . '*');
        if (($mode != 'admin') && ($updateEntry === true)) {
                // Update guest or member menu
-               $sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
+               $sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `counter`=`counter`+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
                        array(
                                $mode,
                                $action,
                        array(
                                $mode,
                                $action,
index 08fa2e50c288b79126e14226ac601289b3c16cb7..0c10acd3396a0a8fbc565c25a3062d6dc93f2c4b 100644 (file)
@@ -455,8 +455,13 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
                // Merge data if valid
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
                if ((isUserDataValid()) && ($loadUserData === true)) {
                // Merge data if valid
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
                if ((isUserDataValid()) && ($loadUserData === true)) {
+                       // It is valid
                        $content = merge_array($content, getUserDataArray());
                        $content = merge_array($content, getUserDataArray());
+
+                       // But we don't like hashed passwords be mailed
+                       unset($content['password']);
                } // END - if
                } // END - if
+
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
        } // END - if
 
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
        } // END - if
 
index 02c2e4c09d8cc0f5db17252273b83f3ce15d3586..0c2c4425efa2beb4bc47669cf68636dd3a46396e 100644 (file)
@@ -2473,5 +2473,29 @@ function convertCommaToDotInPostDataArray (array $postEntries) {
        } // END - foreach
 }
 
        } // END - foreach
 }
 
+// Getter for 'check_double_email'
+function getCheckDoubleEmail () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'check_double_email' is "YES"
+function isCheckDoubleEmailEnabled () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
diff --git a/templates/de/emails/member/member_coupon.tpl b/templates/de/emails/member/member_coupon.tpl
new file mode 100644 (file)
index 0000000..37bbb77
--- /dev/null
@@ -0,0 +1,19 @@
+Hallo {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,family=$userid%},
+
+------------------------------
+Ihre Mitglied-Id lautet: $userid
+------------------------------
+
+Es wurde soeben ein Gutschein erstellt und der Code Ihnen per Email zugesandt. Der Wert ist {%pipe,translateComma=$content[points]%} {?POINTS?}.
+
+Hier ist Ihr pers&ouml;nlicher Gutscheincode, den nur Sie kennen:
+$content[coupon_code]
+
+Sie k&ouml;nnen diesen im Mitgliedbereich bis zum $content[coupon_expires] einl&ouml;sen.
+
+Sie k&ouml;nnen den Empfang von Gutscheinen jederzeit im Mitgliedsbereich unter Gutscheine->Gutschein einl&ouml;sen abbestellen und auch wieder bestellen.
+
+Mit freundlichen Gr&uuml;&szlig;en,
+  Ihr {?MAIN_TITLE?} Team
+
+{?URL?}/login.php ({?WEBMASTER?})
diff --git a/templates/de/html/member/member_cash_coupon.tpl b/templates/de/html/member/member_cash_coupon.tpl
new file mode 100644 (file)
index 0000000..f6c5a23
--- /dev/null
@@ -0,0 +1,21 @@
+<div align="center">
+<form accept-charset="UTF-8" id="form" action="{%url=modules.php?module=login&amp;what=cash_coupon%}" method="post">
+<div class="table dashed">
+       <div class="table_header bottom">
+               <strong>{--MEMBER_CASH_COUPON_TITLE--}</strong>
+       </div>
+       <div class="bottom" style="height:23px;padding-top:4px">
+               {--MEMBER_ENTER_COUPON_CODE--}
+               <input type="text" class="form_field" name="coupon_code" size="30" maxlength="30" />
+       </div>
+       <div class="table_footer">
+               <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+               <input type="submit" class="form_submit" name="ok" value="{--MEMBER_CASH_COUPON--}" />
+       </div>
+</div>
+</form>
+</div>
+
+<div class="notice">
+       {--MEMBER_CASH_COUPON_NOTE--}
+</div>
diff --git a/templates/de/html/menu/menu_member_advert_coupon.tpl b/templates/de/html/menu/menu_member_advert_coupon.tpl
new file mode 100644 (file)
index 0000000..e15f630
--- /dev/null
@@ -0,0 +1,6 @@
+<tr>
+       <td class="menu_advert">
+               <!-- Fuegen Sie hier Ihre Werbung ein! //-->
+               <a href="{%url=modules.php?module=index&amp;what=impressum%}" target="_blank">Hier k&ouml;nnte Ihre Werbung stehen!</a>
+       </td>
+</tr>