* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009, 2010 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// 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
));
// Handle failed logins here if not in guest
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "type=".$data['type'].",action=".getAction().",what=".getWhat().",level=".$data['access_level']."<br />");
- 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
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'));
// 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
$callback = '';
$extraFunction = '';
$extraFunction2 = '';
- $value = '';
+ $value = null;
// Extract command and call-back
$cmdArray = explode(',', $cmd);
$data = array(
'matches' => $matches,
'key' => $key,
- 'mode' => $outputMode,
+ 'mode' => getScriptOutputMode(),
'code' => $code,
'callback' => $callback,
'extra_func' => $extraFunction,
$code = call_user_func($commandFunction, $data);
} else {
// Unsupported command detected
- debug_report_bug(__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
// Do we have non-HTML mode?
- if ((!isHtmlOutputMode()) || ($outputMode != '0')) $code = decodeEntities($code);
+ if (!isHtmlOutputMode()) {
+ $code = decodeEntities($code);
+ } // END - if
// Return compiled code
//* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.($code).'</pre>');
} // END - if
// Get more daily reset scripts
- setIncludePool('reset', getArrayFromDirectory('inc/reset/', 'reset_'));
+ setIncludePool('reset', getArrayFromDirectory('inc/daily/', 'daily_'));
// Update database
if ((!isConfigEntrySet('DEBUG_RESET')) || (getConfig('DEBUG_RESET') != 'Y')) updateConfiguration('last_update', 'UNIX_TIMESTAMP()');
$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_'));
}
// 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')) {
+ // 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(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
}
// 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
}
// Generate random number
setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getMemberId(), ''));
} else {
- // Generate weak (!!!) code
+ // Generate *WEAK* code
setConfigEntry('RAND_NUMBER', mt_rand(1000000, 9999999));
}
} // 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",
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
function FILTER_SET_CURRENT_DATE () {
// 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() - getOneDay()));
+ setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
}
// [EOF]