Fixes for auto-purge scripts (missing array elements)
authorRoland Häder <roland@mxchange.org>
Tue, 1 Dec 2009 04:41:31 +0000 (04:41 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 1 Dec 2009 04:41:31 +0000 (04:41 +0000)
inc/autopurge/purge-inact.php
inc/autopurge/purge-mails.php
inc/autopurge/purge-tsks.php
inc/autopurge/purge-unconfirmed.php

index 652a561..eb5bc27 100644 (file)
@@ -94,7 +94,7 @@ ORDER BY
                $content['time']  = (getConfig('ap_inactive_time')  / 60 / 60);
 
                // Mark found accounts as inactive and send an email
-               while ($content = SQL_FETCHARRAY($result_inactive)) {
+               while ($content = merge_array($content, SQL_FETCHARRAY($result_inactive))) {
                        // Remember userids for the admin
                        $useridsContent .= $content['userid'].", ";
 
index 2a2df0f..29f1349 100644 (file)
@@ -69,6 +69,8 @@ if (SQL_NUMROWS($result_mails) > 0) {
                        // Okay we found some mails!
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
+
+                       // Get all affected (deleted) rows
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...;
@@ -106,6 +108,8 @@ if (SQL_NUMROWS($result_mails) > 0) {
                        // Okay we found some mails!
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
+
+                       // Get all affected (deleted) rows
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...
index d39f7f1..708c880 100644 (file)
@@ -54,7 +54,8 @@ if ((isExtensionInstalledAndNewer('task') > '0.0') && (getConfig('autopurge_task
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
-       `status`='DELETED' AND `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__);
+       `status`='DELETED' AND
+       `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__);
 
        // Get deleted rows
        $deletedTasks = SQL_AFFECTEDROWS();
index 31d825d..faa5b76 100644 (file)
@@ -64,7 +64,7 @@ ORDER BY
                $content['time'] = (getConfig('ap_unconfirmed_time')  / 60 / 60);
 
                // Delete inactive accounts
-               while ($content = SQL_FETCHARRAY($result_uncon)) {
+               while ($content = merge_array($content, SQL_FETCHARRAY($result_uncon))) {
                        // Remember userids for the admin
                        $userids .= $content['userid'] . ', ';