2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 05/30/2004 *
4 * =================== Last change: 08/09/2004 *
6 * -------------------------------------------------------------------- *
7 * File : autopurge_functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Special functions *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Spezielle Funktionen *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 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')) {
43 // Add points in autopurge-mode
44 function addPointsAutoPurge ($userid, $points) {
45 // Is the userid valid?
46 if ((!isValidId($userid)) || ($points <= 0)) {
47 // Please report all these bugs
48 reportBug(__FUNCTION__, __LINE__, 'Invalid call. userid=' . $userid . ',points=' . $points);
51 // Add points over the ref system directly now
53 addPointsThroughReferralSystem('autopurge_add', $userid, $points);
55 // Send out mail to user
56 $message = loadEmailTemplate('member_autopurge_points', array('points' => $points), $userid);
57 sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
60 // ----------------------------------------------------------------------------
61 // Wrapper for configuration entries
62 // ----------------------------------------------------------------------------
64 // Checks whether auto-purging is enabled
65 function isAutoPurgingActive () {
67 if (!isset($GLOBALS[__FUNCTION__])) {
69 $GLOBALS[__FUNCTION__] = (getConfig('auto_purge_active') == 'Y');
73 return $GLOBALS[__FUNCTION__];
76 // Wrapper for 'autopurge_inactive
77 function getAutopurgeInactive () {
79 if (!isset($GLOBALS[__FUNCTION__])) {
81 $GLOBALS[__FUNCTION__] = (getConfig('autopurge_inactive') == 'Y');
85 return $GLOBALS[__FUNCTION__];
88 // Checks whether purging of inactive accounts is enabled
89 function isAutopurgeInactiveEnabled () {
91 if (!isset($GLOBALS[__FUNCTION__])) {
93 $GLOBALS[__FUNCTION__] = (getAutopurgeInactive() == 'Y');
97 return $GLOBALS[__FUNCTION__];
100 // "Getter" for ap_inactive_time
101 function getApInactiveTime () {
103 if (!isset($GLOBALS[__FUNCTION__])) {
105 $GLOBALS[__FUNCTION__] = getConfig('ap_inactive_time');
109 return $GLOBALS[__FUNCTION__];
112 // "Getter" for auto_purge
113 function getAutoPurge () {
115 if (!isset($GLOBALS[__FUNCTION__])) {
117 $GLOBALS[__FUNCTION__] = getConfig('auto_purge');
121 return $GLOBALS[__FUNCTION__];
124 // "Getter" for ap_dm_timeout
125 function getApDmTimeout () {
127 if (!isset($GLOBALS[__FUNCTION__])) {
129 $GLOBALS[__FUNCTION__] = getConfig('ap_dm_timeout');
133 return $GLOBALS[__FUNCTION__];
136 // "Getter" for ap_tasks_time
137 function getApTasksTime () {
139 if (!isset($GLOBALS[__FUNCTION__])) {
141 $GLOBALS[__FUNCTION__] = getConfig('ap_tasks_time');
145 return $GLOBALS[__FUNCTION__];
148 // "Getter" for ap_unconfirmed_time
149 function getApUnconfirmedTime () {
151 if (!isset($GLOBALS[__FUNCTION__])) {
153 $GLOBALS[__FUNCTION__] = getConfig('ap_unconfirmed_time');
157 return $GLOBALS[__FUNCTION__];