]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-sql_patches.php
Removed double version number
[mailer.git] / inc / extensions / ext-sql_patches.php
index fa54c1efa23883a30fc248a1f17dd424e431b9dd..c309afee2bea104ef5af6716e1e8291842479937 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.9.0');
+setThisExtensionVersion('0.9.3');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -61,6 +61,7 @@ switch (getExtensionMode()) {
                addDropTableSql('admin_menu_las_data');
                addDropTableSql('admin_las_stats');
                addDropTableSql('dns_cache');
+               addDropTableSql('server_name_log');
 
                // Delete admin menu entries
                addExtensionSql("DELETE LOW_PRIORITY FROM
@@ -107,6 +108,7 @@ IN (
                unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', TRUE, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', TRUE, isExtensionDryRun());
                unregisterFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -932,6 +934,47 @@ INDEX (`history_last_used` DESC)",
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Filter zum Initialisieren von ext-sql_patches registriert und Eintr&auml;ge in <strong>{?_MYSQL_PREFIX?}_points_data</strong> hinzugef&uuml;gt.");
                                break;
+
+                       case '0.9.1': // SQL queries for v0.9.1
+                               // Add admin menu
+                               addAdminMenuSql('misc', 'list_server_name', 'Verkehrte Domains auflisten', 'Listet alle als verkehrt erkannten Domains auf.', 4);
+
+                               // Create table
+                               addCreateTableSql('server_name_log', "
+`server_name_id` BIGINT (20) NOT NULL AUTO_INCREMENT,
+`server_name` VARCHAR (255) NOT NULL DEFAULT 'invalid',
+`server_name_remote_addr` VARCHAR (15) NOT NULL DEFAULT '0.0.0.0',
+`server_name_ua` TINYTEXT NULL DEFAULT NULL,
+`server_name_referrer` TINYTEXT NULL DEFAULT NULL,
+`server_name_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`server_name_counter` BIGINT (20) NOT NULL DEFAULT 1,
+PRIMARY KEY (`server_name_id`)
+", 'Logging of wrong SERVER_NAME');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Loggen von falschen <strong>SERVER_NAME</strong> Eintr&auml;gen hinzugef&uuml;gt.");
+                               break;
+
+                       case '0.9.2': // SQL queries for v0.9.2
+                               addExtensionAddTableColumnSql('server_name_log', 'server_name_remote_addr', "VARCHAR (15) NOT NULL DEFAULT '0.0.0.0'");
+                               addExtensionAddTableColumnSql('server_name_log', 'server_name_counter', 'BIGINT (20) NOT NULL DEFAULT 0');
+                               addExtensionAddTableColumnSql('server_name_log', 'server_name_ua', 'TINYTEXT NULL DEFAULT NULL');
+                               addExtensionAddTableColumnSql('server_name_log', 'server_name_referrer', 'TINYTEXT NULL DEFAULT NULL');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Sorry, hatte noch IP-Nummer, User-Agent, aufrufende Seite und Z&auml;hler vergessen.");
+                               break;
+
+                       case '0.9.3': // SQL queries for v0.9.3
+                               addConfigAddSql('ap_server_name', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+                               addConfigAddSql('ap_server_name_since', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
+
+                               // Register filter
+                               registerFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', FALSE, TRUE, isExtensionDryRun());
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Bereinigung von verkehrten <strong>SERVER_NAME</strong> Eintr&auml;gen hinzugef&uuml;gt.");
+                               break;
                } // END - switch
                break;
 
@@ -942,41 +985,6 @@ INDEX (`history_last_used` DESC)",
                break;
 
        case 'init': // Do stuff when extension is initialized
-               // Transfer POINTS word
-               if (isExtensionInstalledAndNewer('sql_patches', '0.0.3')) {
-                       // Okay, recent enough, so transfer the word for POINTS
-                       setConfigEntry('POINTS', getPointsWord());
-               } // END - if
-
-               // Init key
-               setConfigEntry('secret_key', '');
-
-               // Is the version recent enought for secret keys?
-               if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
-                       // Read key from secret file
-                       if ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == '')) {
-                               // Maybe need setup of secret key!
-                               loadIncludeOnce('inc/gen_sql_patches.php');
-                       } // END - if
-
-                       // Test again
-                       if ((getFileHash() != '') && (getMasterSalt() != '') && (getPassScramble() != '')) {
-                               // File hash fas generated so we can also file the secret file... hopefully.
-                               $hashFile = sprintf("%s%s.%s.cache", getPath(), getCachePath(), getFileHash());
-
-                               // Is the secret key file readable?
-                               if (isFileReadable($hashFile)) {
-                                       // Read file
-                                       setConfigEntry('secret_key', readFromFile($hashFile));
-                               } else {
-                                       // Remove it from database
-                                       updateConfiguration('file_hash', '');
-
-                                       // Cannot read secret file!
-                                       reportBug(__FILE__, __LINE__, 'Cannot read secret file! Please try to reload.');
-                               }
-                       } // END - if
-               } // END - if
                break;
 
        default: // Unknown extension mode