]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/autopurge_functions.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / libs / autopurge_functions.php
index a8ecdd1771ab09d833cefc5ebefe83404e0b959e..baa71aa6cba9fbdd5deb8a216f3cbc3b0ac88c3b 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 // Add points in autopurge-mode
 function addPointsAutoPurge ($userid, $points) {
        // Is the userid valid?
-       if (!isValidUserId($userid)) {
+       if ((!isValidId($userid)) || ($points <= 0)) {
                // Please report all these bugs
                reportBug(__FUNCTION__, __LINE__, 'Invalid call. userid=' . $userid . ',points=' . $points);
        } // END - if
@@ -109,6 +109,18 @@ function getApInactiveTime () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for auto_purge
+function getAutoPurge () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('auto_purge');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // "Getter" for ap_dm_timeout
 function getApDmTimeout () {
        // Is there cache?