]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-del_email.php
Extension ext-network cleaned up
[mailer.git] / inc / modules / admin / what-del_email.php
index 06e2da757c59ef4356158c43f45339e8e8bcfcf3..1ffcee889cc0b3fc3cc9c9c002487c0481c507a5 100644 (file)
@@ -46,10 +46,10 @@ addYouAreHereLink('admin', __FILE__);
 // Init counter for deleted mails
 $count = '0';
 
-if (isGetRequestElementSet('mid')) {
+if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
        // Load email data
        $result = SQL_QUERY_ESC("SELECT `id`, `sender`, `subject`, `url`, `timestamp`, `cat_id`, `payment_id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
-               array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__);
+               array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
 
        // Delete mail only once
        if (SQL_NUMROWS($result) == 1) {
@@ -82,7 +82,7 @@ ON
 WHERE
        s.`pool_id`=%s
 LIMIT 1",
-                       array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__);
+                       array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
                if (SQL_NUMROWS($result_pool) == 1) {
                        // Fetch stats id
                        list($stats_id) = SQL_FETCHROW($result_pool);
@@ -91,7 +91,7 @@ LIMIT 1",
                        $links = countSumTotalData($stats_id, 'user_links', 'userid', 'stats_id', TRUE);
 
                        // Reset sent mails for recipient(s)
-                       reduceRecipientReceivedMails('stats_id', getRequestElement('mid'), $links);
+                       reduceRecipientReceivedMails('stats_id', getRequestElement('id'), $links);
 
                        // Calc total points and pay them back
                        $totalPoints = $links * $content['price'];
@@ -131,7 +131,7 @@ LIMIT 1",
                        $count += SQL_AFFECTEDROWS();
 
                        // Load template for link
-                       displayMessage('<a href="{%url=modules.php?module=admin&amp;what=del_email&amp;pid=' . bigintval(getRequestElement('mid')) . '%}">{--ADMIN_REMOVE_STATS_ENTRY--}</a>');
+                       displayMessage('<a href="{%url=modules.php?module=admin&amp;what=del_email&amp;pid=' . bigintval(getRequestElement('id')) . '%}">{--ADMIN_REMOVE_STATS_ENTRY--}</a>');
                } // END - if
 
                // Free the result
@@ -139,7 +139,7 @@ LIMIT 1",
 
                // Delete mail from queue
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
-                       array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__);
+                       array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
                $count += SQL_AFFECTEDROWS();
 
                // Output link for manually removing stats entry
@@ -158,10 +158,10 @@ LIMIT 1",
 
        // Output message
        displayMessage('{--ADMIN_USER_STATS_REMOVED--}');
-} elseif ((isGetRequestElementSet('bid')) && (isExtensionActive('bonus'))) {
+} elseif (((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'bonus')) && (isExtensionActive('bonus'))) {
        // Load data from bonus mail
        $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp`, `mails_sent` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
-               array(bigintval(getRequestElement('bid'))), __FILE__, __LINE__);
+               array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
 
        // Delete mail only once
        if (SQL_NUMROWS($result) == 1) {
@@ -169,17 +169,17 @@ LIMIT 1",
                $content = SQL_FETCHARRAY($result);
 
                // Reset sent mails for recipient(s)
-               reduceRecipientReceivedMails('bonus_id', getRequestElement('bid'), $content['mails_sent']);
+               reduceRecipientReceivedMails('bonus_id', getRequestElement('id'), $content['mails_sent']);
 
                // Init counter for deleted mails
                $count = '0';
 
                // Delete bonus mail entirely from database
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
-                       array(bigintval(getRequestElement('bid'))), __FILE__, __LINE__);
+                       array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
                $count += SQL_AFFECTEDROWS();
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
-                       array(bigintval(getRequestElement('bid'))), __FILE__, __LINE__);
+                       array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
                $count += SQL_AFFECTEDROWS();
 
                // Prepare data for the template