]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-sql_patches.php
Refback will be payed now (user cannot setup currently)
[mailer.git] / inc / extensions / ext-sql_patches.php
index 2efdb59de6e0a6d6ab189b899415bb9001993f44..4517ec3a44a4e0e67ad814080da95abdb2c01a8c 100644 (file)
@@ -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 <STRONG>mxchange_config</STRONG> musste die Spalte <STRONG>auto_purge</STRONG> (autom. L&ouml;schen von Best&auml;tigungsmails angepasst werden (war auf dem Testsystem auf tiny(4) gesetzt.)";
+               $UPDATE_NOTES = "In der Tabelle <STRONG>"._MYSQL_PREFIX."_config</STRONG> musste die Spalte <STRONG>auto_purge</STRONG> (autom. L&ouml;schen von Best&auml;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,46 @@ PRIMARY KEY (id)
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Index f&uuml;r Betreff eingef&uuml;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&auml;tigen wird auf NULL gesetzt, wenn Account best&auml;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,
+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&uuml;tzt nun detailierte Referal-&Uuml;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 +722,4 @@ $EXT_LANG_PREFIX = "sql_patches";
 $EXT_ALWAYS_ACTIVE = "Y";
 
 //
-?>
\ No newline at end of file
+?>