X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fautopurge%2Fpurge-unconfirmed.php;h=66d707ab47c644fa2cb3469995b3d65a9d3ffa9c;hb=6b13c5c64eebedd56683c78d799879e0dc618b21;hp=baa56db400d3bcd501627431b93a8317386ca4b3;hpb=0f22badfd5054b8c0c1cef83424bfd1bd415d507;p=mailer.git diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index baa56db400..66d707ab47 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -1,7 +1,7 @@ 0) { +if (getConfig('autopurge_unconfirmed') == 'Y') { + // Init variables and find unconfirmed accounts which I shall auto-purge; + $result_uncon = SQL_QUERY("SELECT + `userid`, `email`, `joined` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - {?ap_unconfirmed_time?}) +ORDER BY + `userid` ASC", __FILE__, __LINE__); + if (!SQL_HASZERONUMS($result_uncon)) { // Prepare variable... - $UIDs = ""; - define('__UNCONFIRMED_TIME' , (getConfig('ap_un_time') / 60 / 60)); + $userids = ''; + $content['time'] = (getApUnconfirmedTime() / 60 / 60); // Delete inactive accounts - while (list($uid, $email, $joined) = SQL_FETCHROW($result_uncon)) { + while ($row = SQL_FETCHARRAY($result_uncon)) { + // Merge both arrays + $content = merge_array($content, $row); + // Remember userids for the admin - $UIDs .= $uid.", "; + $userids .= $content['userid'] . ', '; // Get date/time from timestamp - $joined = MAKE_DATETIME($joined, "0"); + $content['joined'] = generateDateTime($content['joined'], 0); // Finnaly delete this inactive account - DELETE_USER_ACCOUNT($uid, LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $joined, "")); + deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_unconfirmed', $content, '')); } // END - while // Remove last comma - $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2)); + $userids = str_replace(', ', "\n", substr($userids, 0, -2)); // Send mail notification to admin - if (getConfig('ap_un_notify') == "Y") { - SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT, "admin_autopurge_unconfirmed", $UIDs, ""); + if (getConfig('ap_un_notify') == 'Y') { + sendAdminNotification('{--ADMIN_AUTOPURGE_UNCONFIRMED_SUBJECT--}', 'admin_autopurge_unconfirmed', $userids); } // END - if } // END - if // Free memory SQL_FREERESULT($result_uncon); -} +} // END - if -// +// [EOF] ?>