Mahor rewrite:
[mailer.git] / inc / autopurge / purge-mails.php
index 99a02c48735f105351c486a719f3646b26515b29..89f4dd7d632175357da2a62c1368191fb12da49f 100644 (file)
@@ -38,15 +38,15 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Abort if autopurge is not active or disabled by admin
-if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) {
+if ((!EXT_IS_ACTIVE("autopurge")) || (getConfig('auto_purge_active') == "N")) {
        // Abort here
        return false;
 } // END - if
 
 // Search for mails from deleted members?
-if ($_CONFIG['ap_del_mails'] == "Y") {
+if (getConfig('ap_del_mails') == "Y") {
        // Okay, let's check for them...
-       $since = bigintval($_CONFIG['ap_dm_timeout']);
+       $since = bigintval(getConfig('ap_dm_timeout'));
        $result_mails = SQL_QUERY_ESC("SELECT sender\
 FROM "._MYSQL_PREFIX."_pool
 WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
@@ -70,7 +70,7 @@ ORDER BY sender ASC",
                                $DELETED += SQL_AFFECTEDROWS();
 
                                // Reset query (to prevent possible errors) ...
-                               $since = bigintval($_CONFIG['ap_dm_timeout']);
+                               $since = bigintval(getConfig('ap_dm_timeout'));
                                $result_mails = SQL_QUERY_ESC("SELECT sender
 FROM "._MYSQL_PREFIX."_pool
 WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
@@ -84,7 +84,7 @@ ORDER BY sender ASC",
        SQL_FREERESULT($result_mails);
 
        // Now let's check for stats entries as well
-       $since = bigintval($_CONFIG['ap_dm_timeout']);
+       $since = bigintval(getConfig('ap_dm_timeout'));
        $result_mails = SQL_QUERY_ESC("SELECT sender
 FROM "._MYSQL_PREFIX."_user_stats
 WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
@@ -103,7 +103,7 @@ ORDER BY sender ASC",
                                $DELETED += SQL_AFFECTEDROWS();
 
                                // Reset query (to prevent possible errors) ...
-                               $since = bigintval($_CONFIG['ap_dm_timeout']);
+                               $since = bigintval(getConfig('ap_dm_timeout'));
                                $result_mails = SQL_QUERY_ESC("SELECT sender
 FROM "._MYSQL_PREFIX."_user_stats
 WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
@@ -117,7 +117,7 @@ ORDER BY sender ASC",
        SQL_FREERESULT($result_mails);
 
        // Do we have deleted mails and the admin want's to receive a notification
-       if (($DELETED > 0) && ($_CONFIG['ap_dm_notify'] == "Y")) {
+       if (($DELETED > 0) && (getConfig('ap_dm_notify') == "Y")) {
                // Send out email to admin
                SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT, "admin_autopurge_del_mails", $DELETED, "");
        }