X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffilters.php;h=1bbede3a98313c2113f8d7b2b5dbc942d429b8cf;hp=164acb9225af28f2b27de87acf576a9504d9e7a8;hb=5d89789720c77e954b2eba28c00ec710dd28900d;hpb=c8d76610eb94093d4eed4fcd8a6cb72e74c8f6d8 diff --git a/inc/filters.php b/inc/filters.php index 164acb9225..1bbede3a98 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -109,10 +109,10 @@ function FILTER_FLUSH_FILTERS () { // Update all counters foreach ($GLOBALS['cache_array']['filter']['counter'] as $filterName => $filterArray) { // Walk through all filters - foreach ($filterArray as $filterFunction => $cnt) { + foreach ($filterArray as $filterFunction => $count) { // Construct and add the query addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_filters` SET `filter_counter`=%s WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT 1", - bigintval($cnt), + bigintval($count), $filterName, $filterFunction )); @@ -137,7 +137,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) { // Handle failed logins here if not in guest //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "type=".$data['type'].",action=".getAction().",what=".getWhat().",level=".$data['access_level']."
"); - if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getIndexHome()))) && ($data['access_level'] != 'guest') && ((isExtensionInstalledAndNewer('sql_patches', '0.4.7')) || (isExtensionInstalledAndNewer('admins', '0.7.0')))) { + if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getIndexHome()))) && ($data['access_level'] != 'guest') && ((isExtensionInstalledAndNewer('sql_patches', '0.4.7')) || (isExtensionInstalledAndNewer('admins', '0.7.6')))) { // Handle failure $content['content'] .= handleLoginFailures($data['access_level']); } // END - if @@ -330,7 +330,7 @@ function FILTER_INIT_RANDOMIZER () { setConfigEntry('_PRIME', 591623); // Calculate "entropy" with the prime number (for code generation) - setConfigEntry('_ADD', (getPrime() * getPrime() / (pi() * getConfig('code_length') + 1))); + setConfigEntry('_ADD', (getPrime() * getPrime() / (pi() * getCodeLength() + 1))); // Simply init the randomizer with seed and _ADD value mt_srand(generateSeed() + getConfig('_ADD')); @@ -354,7 +354,7 @@ function FILTER_REMOVE_UPDATES ($data) { // Shall we remove this update? if (in_array($ext_name, getExtensionRemovalList())) { // Then remove this extension! - removeExtensionUpdateDependency($ext_name); + removeExtensionDependency($ext_name); } // END - if } // END - foreach } // END - if @@ -469,7 +469,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) { $callback = ''; $extraFunction = ''; $extraFunction2 = ''; - $value = ''; + $value = null; // Extract command and call-back $cmdArray = explode(',', $cmd); @@ -521,7 +521,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) { $code = call_user_func($commandFunction, $data); } else { // Unsupported command detected - logDebugMessage(__FUNCTION__, __LINE__, 'Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.'); + logDebugMessage(__FUNCTION__, __LINE__, 'Command cmd=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.'); } } // END - foreach } // END - if @@ -580,7 +580,7 @@ function FILTER_RUN_RESET_INCLUDES () { $currMonth = getMonth(); // Has it changed? - if ((getConfig('last_month') != $currMonth) || (isMonthlyResetDebugEnabled())) { + if ((getLastMonth() != $currMonth) || (isMonthlyResetDebugEnabled())) { // Include monthly reset scripts mergeIncludePool('reset', getArrayFromDirectory('inc/monthly/', 'monthly_')); @@ -710,15 +710,15 @@ function FILTER_TRIGGER_SENDING_POOL () { } // Filter for checking and updating SVN revision -function FILTER_CHECK_SVN_REVISION () { +function FILTER_CHECK_REPOSITORY_REVISION () { // Only execute this filter if installed and all config entries are there if ((!isInstalled()) || (!isConfigEntrySet('patch_level'))) return; // Check for patch level differences between databases and current hard-coded - if ((getCurrSvnRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURR_SVN_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) { + if ((getCurrentRepositoryRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURRENT_REPOSITORY_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) { // Update database and CONFIG array - updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrSvnRevision(), 'UNIX_TIMESTAMP()')); - setConfigEntry('patch_level', getCurrSvnRevision()); + updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrentRepositoryRevision(), 'UNIX_TIMESTAMP()')); + setConfigEntry('patch_level', getCurrentRepositoryRevision()); setConfigEntry('patch_ctime', time()); } // END - if } @@ -937,13 +937,13 @@ function FILTER_RESET_USER_LOGIN_FAILURE () { } // END - if // Remmeber login failures if available - if (isExtensionInstalledAndNewer('sql_patches', '0.6.1')) { + if (isExtensionInstalledAndNewer('user', '0.3.7')) { // Reset login failures SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `login_failures`=0, - `last_failure`='0000-00-00 00:00:00' + `last_failure`=NULL WHERE `userid`=%s LIMIT 1", @@ -1020,7 +1020,7 @@ function FILTER_SET_CURRENT_DATE () { setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3')); // Timestamp for yesterday, today ... all at 00:00 am - setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('ONE_DAY'))); + setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getOneDay())); setConfigEntry('START_TDAY', makeTime(0, 0, 0, time())); }