X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilters.php;h=a75f8dd0c9011f11ea2cadd3248c3b3230df33bd;hb=34297125f617f854d2cc009d3cc4f16b6581a1f5;hp=8ae57cee986bbdfce660d4d311db869d4fdcef2b;hpb=0ddf8f6c578aa2c1ff1db9fb8eb0b93a1e247b73;p=mailer.git diff --git a/inc/filters.php b/inc/filters.php index 8ae57cee98..a75f8dd0c9 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')); @@ -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_')); @@ -714,7 +714,7 @@ 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 + // Check for patch level differences between database and current hard-coded 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(getCurrentRepositoryRevision(), 'UNIX_TIMESTAMP()')); @@ -738,9 +738,9 @@ function FILTER_RUN_DAILY_RESET () { // Filter for loading more runtime includes (not for installation) function FILTER_LOAD_RUNTIME_INCLUDES () { // Load more includes - foreach (array('inc/databases.php','inc/session.php','inc/versions.php') as $inc) { + foreach (array('databases', 'session', 'versions') as $inc) { // Load the include - loadIncludeOnce($inc); + loadIncludeOnce('inc/' . $inc . '.php'); } // END - foreach } @@ -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", @@ -959,11 +959,11 @@ LIMIT 1", function FILTER_DO_LOGIN_ADMIN ($data) { // Now set all session variables and store the result for later processing $GLOBALS['admin_login_success'] = (( - setSession('admin_md5', encodeHashForCookie($data['pass_hash'])) + setAdminMd5(encodeHashForCookie($data['pass_hash'])) ) && ( - setSession('admin_id', $data['id']) + setAdminId($data['id']) ) && ( - setSession('admin_last', time()) + setAdminLast(time()) )); // Return the data for further processing