// Is a database link here and not in installation mode?
if ((!SQL_IS_LINK_UP()) && (!isInstalling())) {
// Abort here
- addFatalMessage(__FUNCTION__, __LINE__, '{--FILTER_FLUSH_FAILED_NO_DATABASE--}');
+ debug_report_bug(__FUNCTION__, __LINE__, 'No database link is up. Cannot flush filters.');
return false;
} // END - if
- // Is the extension sql_patches updated?
+ // Is the extension ext-sql_patches updated?
if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) {
// Abort silently here
logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, sql_patches might be missing. isExtensionInstalled()=' . isExtensionInstalled('sql_patches') . ',isExtensionInstalledAndOlder()=' . isExtensionInstalledAndOlder('sql_patches', '0.5.9'));
$content = $data;
// Handle failed logins here if not in guest
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "type=".$data['type'].",action=".getAction().",what=".getWhat().",level=".$data['access_level']."<br />");
+ //* 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.6')))) {
// Handle failure
$content['content'] .= handleLoginFailures($data['access_level']);
// Filter for solving task given task
function FILTER_SOLVE_TASK ($data) {
// Don't solve anything if no admin!
- if (!isAdmin()) return $data;
+ if (!isAdmin()) {
+ return $data;
+ } // END - if
// Is this a direct task id or array element task_id is found?
if (is_int($data)) {
} // END - if
// Recheck if logged in
- if (!isMember()) {
+ if ((!isMember()) || ((isAdmin()) && (!isDebugModeEnabled()))) {
return false;
} // END - if
$callback = '';
$extraFunction = '';
$extraFunction2 = '';
- $value = null;
+ $value = NULL;
// Extract command and call-back
$cmdArray = explode(',', $cmd);
// Init random number/cache buster
function FILTER_INIT_RANDOM_NUMBER () {
- // Is the extension sql_patches installed and at least 0.3.6?
+ // Is the extension ext-sql_patches installed and at least 0.3.6?
if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && (isExtensionInstalledAndNewer('other', '0.2.5'))) {
// Generate random number
- setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 32766), getMemberId(), ''));
+ setConfigEntry('RAND_NUMBER', generateRandomCode(10, mt_rand(10000, 99999), getMemberId(), ''));
} else {
// Generate *WEAK* code
setConfigEntry('RAND_NUMBER', mt_rand(1000000, 9999999));
// Update module counter
function FILTER_COUNT_MODULE () {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getModule()=' . getModule() . ' - ENTERED!');
// Do count all other modules but not accesses on CSS file css.php!
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `clicks`=`clicks`+1 WHERE `module`='%s' LIMIT 1",
array(getModule()), __FUNCTION__, __LINE__);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getModule()=' . getModule() . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS() . ' - EXIT!');
}
// Handles fatal errors
// Load config here
loadIncludeOnce('inc/load_config.php');
- // Set unset variable
- if (empty($check)) $check = '';
-
- // Default is none
+ // Default content is none
$content = '';
// Installation phase or regular mode?
// Message to regular users (non-admin)
$CORR = '{--FATAL_REPORT_ERRORS--}';
- // PHP warnings fixed
- if ($check == 'done') {
- if (isAdmin()) $CORR = '{--FATAL_CORRECT_ERRORS--}';
+ // Maybe the admin wants to take a look?
+ if (isAdmin()) {
+ $CORR = '{--FATAL_CORRECT_ERRORS--}';
} // END - if
// Remember all in array
}
// Filter for loading user data
-function FILTER_FETCH_USER_DATA ($userid = 0) {
+function FILTER_FETCH_USER_DATA ($userid = NULL) {
// Is the userid not set? Then use member id
- if (($userid == '0') || (is_null($userid))) $userid = getMemberId();
+ if (!isValidUserId($userid)) {
+ $userid = getMemberId();
+ } // END - if
// Get user data
if (!fetchUserData($userid)) {
return $data;
}
+// Filter to activate exchange
+function FILTER_ACTIVATE_EXCHANGE () {
+ // Is the extension 'user' there?
+ if ((!isExtensionActive('user')) || (getActivateXchange() == '0')) {
+ // Silently abort here
+ return false;
+ } // END - if
+
+ // Check total amount of users
+ if (getTotalConfirmedUser() >= getActivateXchange()) {
+ // Activate System
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1");
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2");
+
+ // Run SQLs
+ runFilterChain('run_sqls');
+
+ // Update configuration
+ updateConfiguration('activate_xchange' ,0);
+
+ // Rebuild cache
+ rebuildCache('modules', 'modules');
+ } // END - if
+}
+
+// Filter to handle configuration
+function FILTER_HANDLE_HOME_IN_INDEX_SETTING ($data) {
+ // Is ext-sql_patches up-to-date?
+ if ((isExtensionInstalledAndNewer('sql_patches', '0.8.3')) && (isDisplayHomeInIndexEnabled())) {
+ // Is 'search' as same as 'index_home'?
+ if ($data['search'] == getIndexHome()) {
+ // Then set 'content' to link to index.php
+ $data['content'] = $data['prefix'] . '<strong><a class="you_are_here" href="{%url=index.php' . $data['link_add'] . '%}">' . getTitleFromMenu($data['access_level'], $data['search'], $data['type'], $data['add']) . '</a></strong>';
+ } // END - if
+ } // END - if
+
+ // Return data
+ return $data;
+}
+
// [EOF]
?>