X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fautopurge%2Fpurge-unconfirmed.php;h=cdfd391b596b973dbc90ce365aa7dbb2d5de87a7;hb=9f6c30cc0e06098171d773d671292081ecee3d29;hp=152689ba989dddf21bfad894f4d5de7c5837ce6e;hpb=116747e4dba29e9e2e4daa82c45d8bbb302e9378;p=mailer.git diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index 152689ba98..cdfd391b59 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -17,7 +17,7 @@ * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * - * Copyright (c) 2003 - 2008 by Roland Haeder * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -38,54 +38,55 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; - require($INC); + die(); } // END - if // Abort if autopurge is not active or disabled by admin -if ((!EXT_IS_ACTIVE('autopurge')) || (getConfig('auto_purge_active') != 'Y')) { +if ((!isExtensionActive('autopurge')) || (getConfig('auto_purge_active') != 'Y')) { // Abort here return false; } // END - if // 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 -FROM `{!_MYSQL_PREFIX!}_user_data` -WHERE `status`='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) -ORDER BY userid ASC", - array($time), __FILE__, __LINE__); + // 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_NUMROWS($result_uncon) > 0) { // Prepare variable... $UIDs = ''; - define('__UNCONFIRMED_TIME' , (getConfig('ap_un_time') / 60 / 60)); + $content['time'] = (getConfig('ap_unconfirmed_time') / 60 / 60); // 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'] = MAKE_DATETIME($content['joined'], "0"); + $content['joined'] = generateDateTime($content['joined'], 0); // Finnaly delete this inactive account - DELETE_USER_ACCOUNT($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $content['joined'], '')); + deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_unconfirmed', $content, '')); } // END - while // Remove last comma - $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2)); + $UIDs = str_replace(', ', "\n", substr($UIDs, 0, -2)); // Send mail notification to admin if (getConfig('ap_un_notify') == 'Y') { - SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), "admin_autopurge_unconfirmed", $UIDs, ''); + sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), 'admin_autopurge_unconfirmed', $UIDs, ''); } // END - if } // END - if // Free memory SQL_FREERESULT($result_uncon); -} +} // END - if -// +// [EOF] ?>