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'));
} // END - if
// Recheck if logged in
- if (!isMember()) {
+ if ((!isMember()) || ((isAdmin()) && (!isDebugModeEnabled()))) {
return false;
} // END - if
// 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));
}
// 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
+}
+
// [EOF]
?>