2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 06/26/2004 *
4 * =================== Last change: 06/26/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-list_autopurge.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Find inactive accounts and just list them *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Inaktive Accounts finden und dann auflisten *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2012 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if ((!defined('__SECURITY')) || (!isAdmin())) {
43 // Add description as navigation point
44 addYouAreHereLink('admin', __FILE__);
46 // Exclude default referral id if set
47 // @TODO Rewrite those lines to filter
48 $userExclusionSql = runFilterChain('user_exclusion_sql', ' ');
49 if (isValidId(getDefRefid())) $userExclusionSql .= ' AND d.userid != {?def_refid?}';
50 if (isExtensionActive('beg')) $userExclusionSql .= ' AND d.userid != {?beg_userid?}';
51 if (isExtensionActive('bonus')) $userExclusionSql .= ' AND d.userid != {?bonus_userid?}';
52 if (isExtensionActive('doubler')) $userExclusionSql .= ' AND d.userid != {?doubler_userid?}';
53 if (isExtensionInstalledAndNewer('holiday', '0.1.3')) $userExclusionSql .= " AND `d`.`holiday_active`='N'";
55 // Check for all accounts
56 $result = SQL_QUERY("SELECT
66 `{?_MYSQL_PREFIX?}_user_data` AS `d`
68 `d`.`status`='CONFIRMED' AND
69 (UNIX_TIMESTAMP() - `d`.`joined`) >= {?ap_inactive_since?} AND
70 (UNIX_TIMESTAMP() - `d`.`last_online`) >= {?ap_inactive_since?} AND
71 (UNIX_TIMESTAMP() - `d`.`ap_notified`) >= {?ap_inactive_since?}
72 " . $userExclusionSql . "
74 `d`.`userid` ASC", __FILE__, __LINE__);
76 if (!SQL_HASZERONUMS($result)) {
77 // Ok, we have found some inactive accounts
79 while ($content = SQL_FETCHARRAY($result)) {
80 // Prepare data for the row template
82 'userid' => $content['userid'],
83 'gender' => $content['gender'],
84 'surname' => $content['surname'],
85 'family' => $content['family'],
86 'email' => '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['email'] . '</a>',
87 'joined' => generateDateTime($content['joined'], 2),
88 'last_online' => generateDateTime($content['last_online'], 2),
89 'ap_notified' => generateDateTime($content['ap_notified'], 2),
93 $OUT .= loadTemplate('admin_list_autopurge_row', TRUE, $content);
97 SQL_FREERESULT($result);
98 $content['rows'] = $OUT;
100 // Load main template
101 loadTemplate('admin_list_autopurge', FALSE, $content);
103 // All members are active or you don't have any registered
104 displayMessage('{--ADMIN_AUTOPURGE_ALL_ACTIVE--}');