// Is a database link here and not in installation mode?
if ((!SQL_IS_LINK_UP()) && (!isInstalling())) {
// Abort here
- addFatalMessage(__FUNCTION__, __LINE__, getMessage('FILTER_FLUSH_FAILED_NO_DATABASE'));
+ addFatalMessage(__FUNCTION__, __LINE__, '{--FILTER_FLUSH_FAILED_NO_DATABASE--}');
return false;
} // END - if
if ($compiled === true) {
// Run the code
$eval = "\$GLOBALS['compiled_config'][\$uncompiled] = \"" . $GLOBALS['compiled_config'][$uncompiled] . '";';
- //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>' . str_replace('$', '$', htmlentities($eval)) . '</pre>');
+ //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>' . encodeEntities($eval) . '</pre>');
eval($eval);
} // END - if
// Runs some generic filter update steps
function FILTER_UPDATE_EXTENSION_DATA ($ext_name) {
- // Create task
+ // Create task (we ignore the task id here)
createExtensionUpdateTask(getCurrentAdminId(), $ext_name, $GLOBALS['update_ver'][$ext_name], SQL_ESCAPE(getExtensionNotes(getExtensionNotes())));
// Update extension's version
// Is the config entry set?
if (isExtensionInstalledAndNewer('sql_patches', '0.4.2')) {
// Create current week mark
- $currWeek = date('W', time());
+ $currWeek = getWeek();
// Has it changed?
if ((getConfig('last_week') != $currWeek) || ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'))) {
} // END - if
// Create current month mark
- $currMonth = date('m', time());
+ $currMonth = getMonth();
// Has it changed?
if ((getConfig('last_month') != $currMonth) || ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'))) {
if ((isInstallationPhase()) || (!isInstalled()) || (!isAdminRegistered()) || (!isExtensionInstalled('sql_patches'))) return;
// Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
- if (((date('d', getConfig('last_update')) != date('d', time())) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getOutputMode() != 1)) {
+ if (((getDay(getConfig('last_update')) != getDay()) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getOutputMode() != 1)) {
// Tell every module we are in reset-mode!
doReset();
} // END - if
$GLOBALS['admin_login_success'] = ((
setSession('admin_md5', encodeHashForCookie($data['pass_hash']))
) && (
- setSession('admin_login', $data['login'])
+ setSession('admin_id', $data['id'])
) && (
setSession('admin_last', time())
));