]> git.mxchange.org Git - mailer.git/blobdiff - inc/autopurge/purge-unconfirmed.php
Extension ext-coupon continued, a lot improvements applied:
[mailer.git] / inc / autopurge / purge-unconfirmed.php
index bb4e920ab0bf366407497ff88d162de9b67acdda..c4eed02a77ac7fc0c926ad38d295ff08bde9d71d 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * 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 *
@@ -43,7 +41,7 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Abort if autopurge is not active or disabled by admin
-if ((!isExtensionActive('autopurge')) || (getConfig('auto_purge_active') != 'Y')) {
+if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
        // Abort here
        return false;
 } // END - if
@@ -56,16 +54,20 @@ if (getConfig('autopurge_unconfirmed') == 'Y') {
 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_NUMROWS($result_uncon) > 0) {
+       if (!SQL_HASZERONUMS($result_uncon)) {
                // Prepare variable...
                $userids = '';
-               $content['time'] = (getConfig('ap_unconfirmed_time')  / 60 / 60);
+               $content['time'] = (getApUnconfirmedTime()  / 60 / 60);
 
                // Delete inactive accounts
-               while ($content = merge_array($content, SQL_FETCHARRAY($result_uncon))) {
+               while ($row = SQL_FETCHARRAY($result_uncon)) {
+                       // Merge both arrays
+                       $content = merge_array($content, $row);
+
                        // Remember userids for the admin
                        $userids .= $content['userid'] . ', ';
 
@@ -81,7 +83,7 @@ ORDER BY
 
                // Send mail notification to admin
                if (getConfig('ap_un_notify') == 'Y') {
-                       sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), 'admin_autopurge_unconfirmed', $userids);
+                       sendAdminNotification('{--ADMIN_AUTOPURGE_UNCONFIRMED_SUBJECT--}', 'admin_autopurge_unconfirmed', $userids);
                } // END - if
        } // END - if