From fc741216b12245da56b5de93d1f967586b0848d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 24 Jan 2013 22:06:39 +0000 Subject: [PATCH] Added more configuration wrappers --- inc/libs/blacklist_functions.php | 42 +++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/inc/libs/blacklist_functions.php b/inc/libs/blacklist_functions.php index 23594f1bbc..ab92566791 100644 --- a/inc/libs/blacklist_functions.php +++ b/inc/libs/blacklist_functions.php @@ -174,12 +174,36 @@ function isGenericBlacklistEnabled ($type) { return $GLOBALS[__FUNCTION__]; } +// Getter for url_blacklist +function getUrlBlacklist () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('url_blacklist'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // Wrapper to check if url_blacklist is enabled function isUrlBlacklistEnabled () { // Is there cache? if (!isset($GLOBALS[__FUNCTION__])) { // Determine it - $GLOBALS[__FUNCTION__] = (getConfig('url_blacklist') == 'Y'); + $GLOBALS[__FUNCTION__] = (getUrlBlacklist() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for email_blacklist +function getEmailBlacklist () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('email_blacklist'); } // END - if // Return cache @@ -191,7 +215,19 @@ function isEmailBlacklistEnabled () { // Is there cache? if (!isset($GLOBALS[__FUNCTION__])) { // Determine it - $GLOBALS[__FUNCTION__] = (getConfig('email_blacklist') == 'Y'); + $GLOBALS[__FUNCTION__] = (getEmailBlacklist() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for ip_blacklist +function getIpBlacklist () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('ip_blacklist'); } // END - if // Return cache @@ -203,7 +239,7 @@ function isIpBlacklistEnabled () { // Is there cache? if (!isset($GLOBALS[__FUNCTION__])) { // Determine it - $GLOBALS[__FUNCTION__] = (getConfig('ip_blacklist') == 'Y'); + $GLOBALS[__FUNCTION__] = (getIpBlacklist() == 'Y'); } // END - if // Return cache -- 2.39.5