2 /************************************************************************
3 * MXChange v0.2.1 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 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
43 // Ok, let's have a look...
44 $since = bigintval(time() - $CONFIG['ap_in_since']);
45 $EXCLUDE_LIST = " AND d.userid != c.def_refid";
47 // Check for more extensions
48 if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != c.beg_uid";
49 if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid";
50 if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid";
52 // Check for all accounts
53 $result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.sex, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified
54 FROM "._MYSQL_PREFIX."_user_data AS d, "._MYSQL_PREFIX."_config AS c
55 WHERE d.status='CONFIRMED' AND d.joined < %s AND d.last_online < %s AND d.ap_notified < %s
57 ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__);
59 if (SQL_NUMROWS($result) > 0)
61 // Ok, we have found some inactive accounts
63 while(list($uid, $sex, $sname, $fname, $email, $joined, $last, $notified) = SQL_FETCHROW($result))
65 // Prepare data for the row template
68 'uid' => ADMIN_USER_PROFILE_LINK($uid),
69 'sex' => TRANSLATE_SEX($sex),
72 'email' => "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>",
73 'joined' => MAKE_DATETIME($joined, "2"),
74 'last' => MAKE_DATETIME($last, "2"),
75 'notified' => MAKE_DATETIME($notified, "2"),
79 $OUT .= LOAD_TEMPLATE("admin_list_autopurge_row", true, $content);
84 SQL_FREERESULT($result);
85 define('__AUTOPURGE_ROWS', $OUT);
88 LOAD_TEMPLATE("admin_list_autopurge");
92 // All members are active or you don't have any registered
93 LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_AUTOPURGE_ALL_ACTIVE);