+ die();
+} // END - if
+
+// Add points in autopurge-mode
+function addPointsAutoPurge ($userid, $points) {
+ // Is the userid valid?
+ if ((!isValidId($userid)) || ($points <= 0)) {
+ // Please report all these bugs
+ reportBug(__FUNCTION__, __LINE__, 'Invalid call. userid=' . $userid . ',points=' . $points);
+ } // END - if
+
+ // Add points over the ref system directly now
+ initReferralSystem();
+ addPointsThroughReferralSystem('autopurge_add', $userid, $points);
+
+ // Send out mail to user
+ $message = loadEmailTemplate('member_autopurge_points', array('points' => $points), $userid);
+ sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
+}
+
+// ----------------------------------------------------------------------------
+// Wrapper for configuration entries
+// ----------------------------------------------------------------------------
+
+// Checks whether auto-purging is enabled
+function isAutoPurgingActive () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getConfig('auto_purge_active') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Wrapper for 'autopurge_inactive
+function getAutopurgeInactive () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getConfig('autopurge_inactive') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether purging of inactive accounts is enabled
+function isAutopurgeInactiveEnabled () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getAutopurgeInactive() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];