]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
No die() here
[mailer.git] / inc / filters.php
index 775b140a7ba158373ccd98daa20d68430f161ed9..d03062155950a7abff44db8496477c07746d3a64 100644 (file)
@@ -1099,5 +1099,30 @@ function FILTER_GENERATE_POOL_MAIL_LINKS ($data) {
        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]
 ?>