]> git.mxchange.org Git - mailer.git/blobdiff - inc/autopurge/purge-unconfirmed.php
Heavy rewrite:
[mailer.git] / inc / autopurge / purge-unconfirmed.php
index a31d7b6ef6fa8f76e79cb949c33f16038cd84ce8..617a5903a79d501fca44431a887fd11846e95a5b 100644 (file)
@@ -50,13 +50,12 @@ if ((!EXT_IS_ACTIVE('autopurge')) || (getConfig('auto_purge_active') != 'Y')) {
 
 // Shall I auto-purge unconfirmed accounts?
 if (getConfig('autopurge_unconfirmed') == 'Y') {
-       // Init variables and find unconfirmed accounts which I shall auto-purge
-       $time = getConfig(('ap_un_time'));
-       $result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined
+       // Init variables and find unconfirmed accounts which I shall auto-purge;
+       $result_uncon = SQL_QUERY_ESC("SELECT `userid`, `email`, `joined`
 FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s)
-ORDER BY userid ASC",
-       array($time), __FILE__, __LINE__);
+WHERE `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - %s)
+ORDER BY `userid` ASC",
+               array(getConfig('ap_un_time')), __FILE__, __LINE__);
        if (SQL_NUMROWS($result_uncon) > 0) {
                // Prepare variable...
                $UIDs = '';
@@ -65,13 +64,13 @@ ORDER BY userid ASC",
                // Delete inactive accounts
                while ($content = SQL_FETCHARRAY($result_uncon)) {
                        // Remember userids for the admin
-                       $UIDs .= $content['userid'].", ";
+                       $UIDs .= $content['userid'] . ', ';
 
                        // Get date/time from timestamp
                        $content['joined'] = generateDateTime($content['joined'], '0');
 
                        // Finnaly delete this inactive account
-                       deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $content['joined'], ''));
+                       deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE('member_autopurge_unconfirmed', $content['joined'], ''));
                } // END - while
 
                // Remove last comma
@@ -79,7 +78,7 @@ ORDER BY userid ASC",
 
                // Send mail notification to admin
                if (getConfig('ap_un_notify') == 'Y') {
-                       sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), "admin_autopurge_unconfirmed", $UIDs, '');
+                       sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), 'admin_autopurge_unconfirmed', $UIDs, '');
                } // END - if
        } // END - if