X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-sql_patches.php;h=1cfd76056c9d036024c3ac569e9918ae19c9bd97;hb=eac3d0759a2d43000f8efbeb6ecd193fcc87aca1;hp=2efdb59de6e0a6d6ab189b899415bb9001993f44;hpb=dc1d66c49b8cb1e4fb8056d46b9c7e3fecd0ffdd;p=mailer.git
diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php
index 2efdb59de6..1cfd76056c 100644
--- a/inc/extensions/ext-sql_patches.php
+++ b/inc/extensions/ext-sql_patches.php
@@ -38,13 +38,13 @@ if (!defined('__SECURITY')) {
}
// Version number
-$EXT_VERSION = "0.4.8";
+$EXT_VERSION = "0.5.0";
// Auto-set extension version
if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("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");
+$EXT_VER_HISTORY = array("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");
switch ($EXT_LOAD_MODE)
{
@@ -85,6 +85,7 @@ action='account'";
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las";
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_las_data";
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admin_menu_stats";
+ $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_refs";
// Drop indexes
$SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_extensions DROP UNIQUE KEY (ext_name)";
@@ -147,7 +148,7 @@ case "update": // Update an extension
$SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT '1209600'";
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "In der Tabelle mxchange_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)";
+ $UPDATE_NOTES = "In der Tabelle "._MYSQL_PREFIX."_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)";
break;
case "0.0.3": // SQL queries for v0.0.3
@@ -623,13 +624,47 @@ PRIMARY KEY (id)
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Index für Betreff eingefügt.";
break;
+
+ case "0.4.9": // SQL queries for v0.4.9
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL";
+ $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD UNIQUE (`user_hash`)";
+
+ // Update notes (these will be set as task text!)
+ $UPDATE_NOTES = "User-Hash zum Bestätigen wird auf NULL gesetzt, wenn Account bestätigt wird.";
+ break;
+
+ case "0.5.0": // SQL queries for v0.5.0
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `level`";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_refs`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_refs` (
+`id` bigint(20) NOT NULL auto_increment,
+`userid` bigint(20) NOT NULL DEFAULT 0,
+`level` smallint(6) NOT NULL DEFAULT 0,
+`refid` bigint(20) NOT NULL DEFAULT 0,
+`refback` float(4,1) NOT NULL DEFAULT 0.0,
+`points` FLOAT( 20,5) DEFAULT '0.00000' NOT NULL,
+PRIMARY KEY (`id`),
+UNIQUE `user_refid` (`userid`,`level`,`refid`),
+KEY (`level`),
+KEY (`refid`),
+) ENGINE=MyISAM COMMENT='User Referals With Refback'";
+
+ // Update notes (these will be set as task text!)
+ $UPDATE_NOTES = "Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr.";
+
+ // Execute this special file on this update
+ $INC_POOL[] = PATH."inc/gen_refback.php";
+ break;
}
break;
default: // Do stuff when extension is loaded
// When the sql_patches is not installed we cannot load it's configuration... *sigh*
if (GET_EXT_VERSION("sql_patches") != '') {
- $_CONFIG['secret_key'] = "";
+ // Init key
+ $_CONFIG['secret_key'] = "";
// Read key from secret file
if ((empty($_CONFIG['file_hash'])) || (empty($_CONFIG['master_salt'])) || (empty($_CONFIG['pass_scramble']))) {
@@ -688,4 +723,4 @@ $EXT_LANG_PREFIX = "sql_patches";
$EXT_ALWAYS_ACTIVE = "Y";
//
-?>
\ No newline at end of file
+?>