From: Roland Haeder Date: Mon, 28 Mar 2016 16:07:19 +0000 (+0200) Subject: Moved "fix" files (which only helps to fix stuff) in own inc/fixes/ folder. X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=a524135c24dd0a8fa359c9a92399467d50fd69e0 Moved "fix" files (which only helps to fix stuff) in own inc/fixes/ folder. Signed-off-by: Roland Häder --- diff --git a/inc/extensions/ext-menu.php b/inc/extensions/ext-menu.php index 8e2b7272e0..21fae0baad 100644 --- a/inc/extensions/ext-menu.php +++ b/inc/extensions/ext-menu.php @@ -93,7 +93,7 @@ switch (getExtensionMode()) { case '0.0.2': // SQL queries for v0.0.2 // Load the fix include - addIncludeToPool('extension', 'inc/fix_menu.php'); + addIncludeToPool('extension', 'inc/fixes/fix_menu.php'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Doppelte Menüpunkte bereinigt."); diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 9a89d6c276..16d9f15cff 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { addMemberMenuSql('main', 'reflist', 'Ref-Übersicht', 5); // Execute this special file on registration - addIncludeToPool('extension', 'inc/fix_refsystem.php'); + addIncludeToPool('extension', 'inc/fixes/fix_refsystem.php'); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 529886dbdf..5e5557ac0b 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -41,10 +41,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.6.2'); +setThisExtensionVersion('0.6.3'); // Version history array (add more with , '0.0.1' and so on) -setExtensionVersionHistory(array('0.0.0', '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')); +setExtensionVersionHistory(array('0.0.0', '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')); // Keep this extension always active! setExtensionAlwaysActive('Y'); diff --git a/inc/extensions/sql_patches/mode-update.php b/inc/extensions/sql_patches/mode-update.php index 74f48b1bea..12f05d7202 100644 --- a/inc/extensions/sql_patches/mode-update.php +++ b/inc/extensions/sql_patches/mode-update.php @@ -572,7 +572,7 @@ UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)", setExtensionUpdateNotes("Filter-Tabelle bereinigt um doppelte Einträge und Unique-Key auf filter_name und filter_function zusammen gesetzt."); // Add special fix include to fix filters - addIncludeToPool('extension', 'inc/fix_filters.php'); + addIncludeToPool('extension', 'inc/fixes/fix_filters.php'); break; case '0.6.4': // SQL queries for v0.6.4 diff --git a/inc/extensions/user/mode-update.php b/inc/extensions/user/mode-update.php index 25c42c3b37..ee6a940a1e 100644 --- a/inc/extensions/user/mode-update.php +++ b/inc/extensions/user/mode-update.php @@ -267,7 +267,7 @@ INDEX (`userid`)", case '0.4.1': // SQL queries for v0.4.1 // Add special fix include to fix filters - addIncludeToPool('extension', 'inc/fix_user_points.php'); + addIncludeToPool('extension', 'inc/fixes/fix_user_points.php'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Das Mitgliederguthaben musste repariert werden, da für Referral-Ebene 0, noch NULL geschrieben wurde."); @@ -303,7 +303,7 @@ INDEX (`refid`)", 'User referrals'); // Load ext-refback's special include to regenerate the referral table - addIncludeToPool('extension', 'inc/fix_refsystem.php'); + addIncludeToPool('extension', 'inc/fixes/fix_refsystem.php'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Neues Tabellenlayout und verschoben von ext-refback."); @@ -557,6 +557,14 @@ PRIMARY KEY (`provider_id`)", // Update notes (these will be set as task text!) setExtensionUpdateNotes("Filter für das Handling der Loginanfragen hinzugeügt."); break; + + case '0.6.3': // SQL queries for v0.6.3 + addExtensionAddTableColumnSql('user_data', 'confirmed_timestamp', 'TIMESTAMP NULL DEFAULT NULL'); + addExtensionAddTableColumnSql('user_data', 'confirmed_ip_address', 'VARCHAR(255) NULL DEFAULT NULL'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Spalten für Bestätigungszeitpunkt und IP-Adresse hinzugefügt."); + break; } // END - switch // [EOF] diff --git a/inc/fix_filters.php b/inc/fix_filters.php deleted file mode 100644 index 040333fda9..0000000000 --- a/inc/fix_filters.php +++ /dev/null @@ -1,75 +0,0 @@ - 1) { - // Then clean them up, except one - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_filters` WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT %s", - array($filter['filter_name'], $filter['filter_function'], ($count - 1))); - } // END - while - } // END - while - - // Rebuild the cache - rebuildCache('filter', 'filter'); -} // END - if - -// Free result -sqlFreeResult($result); - -// Now insert our unqiue key -addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` DROP KEY `name_function`'); -addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)'); - -// [EOF] -?> diff --git a/inc/fix_menu.php b/inc/fix_menu.php deleted file mode 100644 index 16a328be0c..0000000000 --- a/inc/fix_menu.php +++ /dev/null @@ -1,108 +0,0 @@ - 1) { - // Remove all except one - if (is_null($entry['what'])) { - // Main menu is double - sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` IS NULL LIMIT %s", - array( - $menu, - $entry['action'], - ($entries - 1) - ), __FILE__, __LINE__); - } else { - // Sub menu is double - sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s' LIMIT %s", - array( - $menu, - $entry['action'], - $entry['what'], - ($entries - 1) - ), __FILE__, __LINE__); - } - } // END - if - } - } // END - while - - // Free result - sqlFreeResult($result); - - // Init sqls - initSqls(); - - // Now insert our unqiue key for action-what combination - addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `action_what`', $menu)); - addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `action_what` (`action`, `what`)', $menu)); - - // Now insert our unqiue key for what - addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `what`', $menu)); - addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `what` (`what`)', $menu)); - - // And run all - runFilterChain('run_sqls'); -} // END - foreach - -// [EOF] -?> diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php deleted file mode 100644 index 566f03f92a..0000000000 --- a/inc/fix_refsystem.php +++ /dev/null @@ -1,86 +0,0 @@ - diff --git a/inc/fix_user_points.php b/inc/fix_user_points.php deleted file mode 100644 index a070afaeab..0000000000 --- a/inc/fix_user_points.php +++ /dev/null @@ -1,91 +0,0 @@ - diff --git a/inc/fixes/.htaccess b/inc/fixes/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/fixes/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/fixes/fix_ b/inc/fixes/fix_ new file mode 100644 index 0000000000..9f2df726c7 --- /dev/null +++ b/inc/fixes/fix_ @@ -0,0 +1,39 @@ + diff --git a/inc/fixes/fix_filters.php b/inc/fixes/fix_filters.php new file mode 100644 index 0000000000..040333fda9 --- /dev/null +++ b/inc/fixes/fix_filters.php @@ -0,0 +1,75 @@ + 1) { + // Then clean them up, except one + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_filters` WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT %s", + array($filter['filter_name'], $filter['filter_function'], ($count - 1))); + } // END - while + } // END - while + + // Rebuild the cache + rebuildCache('filter', 'filter'); +} // END - if + +// Free result +sqlFreeResult($result); + +// Now insert our unqiue key +addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` DROP KEY `name_function`'); +addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_filters` ADD UNIQUE INDEX `name_function` (`filter_name`, `filter_function`)'); + +// [EOF] +?> diff --git a/inc/fixes/fix_menu.php b/inc/fixes/fix_menu.php new file mode 100644 index 0000000000..16a328be0c --- /dev/null +++ b/inc/fixes/fix_menu.php @@ -0,0 +1,108 @@ + 1) { + // Remove all except one + if (is_null($entry['what'])) { + // Main menu is double + sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what` IS NULL LIMIT %s", + array( + $menu, + $entry['action'], + ($entries - 1) + ), __FILE__, __LINE__); + } else { + // Sub menu is double + sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `action`='%s' AND `what`='%s' LIMIT %s", + array( + $menu, + $entry['action'], + $entry['what'], + ($entries - 1) + ), __FILE__, __LINE__); + } + } // END - if + } + } // END - while + + // Free result + sqlFreeResult($result); + + // Init sqls + initSqls(); + + // Now insert our unqiue key for action-what combination + addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `action_what`', $menu)); + addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `action_what` (`action`, `what`)', $menu)); + + // Now insert our unqiue key for what + addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` DROP INDEX `what`', $menu)); + addSql(sprintf('ALTER TABLE `{?_MYSQL_PREFIX?}_%s_menu` ADD UNIQUE INDEX `what` (`what`)', $menu)); + + // And run all + runFilterChain('run_sqls'); +} // END - foreach + +// [EOF] +?> diff --git a/inc/fixes/fix_refsystem.php b/inc/fixes/fix_refsystem.php new file mode 100644 index 0000000000..566f03f92a --- /dev/null +++ b/inc/fixes/fix_refsystem.php @@ -0,0 +1,86 @@ + diff --git a/inc/fixes/fix_user_points.php b/inc/fixes/fix_user_points.php new file mode 100644 index 0000000000..a070afaeab --- /dev/null +++ b/inc/fixes/fix_user_points.php @@ -0,0 +1,91 @@ + diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index f20c7f3b00..5c0dcb4946 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -596,10 +596,30 @@ function doConfirmUserAccount ($hash) { } // END - if // Load all data and add points - $content = getUserDataArray(); + $content = merge_array($content, getUserDataArray()); - // Unlock his account (but only when it is on UNCONFIRMED!) - sqlQueryEscaped("UPDATE + // Is 'user' updated? + if (isExtensionInstalledAndNewer('user', '0.6.3')) { + // Unlock his account (but only when it is on UNCONFIRMED!) + sqlQueryEscaped("UPDATE + `{?_MYSQL_PREFIX?}_user_data` +SET + `status`='CONFIRMED', + `user_hash`=NULL, + `confirmed_timestamp`=NOW(), + `confirmed_ip_address`='%s' +WHERE + `user_hash`='%s' AND + `status`='UNCONFIRMED' +LIMIT 1", + array( + determineRealRemoteAddress(), + $hash + ), __FILE__, __LINE__ + ); + } else { + // Unlock his account (but only when it is on UNCONFIRMED!) + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='CONFIRMED', @@ -608,7 +628,11 @@ WHERE `user_hash`='%s' AND `status`='UNCONFIRMED' LIMIT 1", - array($hash), __FILE__, __LINE__); + array( + $hash + ), __FILE__, __LINE__ + ); + } // Was it updated? if (ifSqlHasZeroAffectedRows()) { diff --git a/inc/modules/admin/what-repair_refs.php b/inc/modules/admin/what-repair_refs.php index b77436b396..f761b4d725 100644 --- a/inc/modules/admin/what-repair_refs.php +++ b/inc/modules/admin/what-repair_refs.php @@ -51,7 +51,7 @@ if (isExtensionInstalledAndOlder('user', '0.4.4')) { } // END - if // Just include fix_refsystem.php again -loadIncludeOnce('inc/fix_refsystem.php'); +loadIncludeOnce('inc/fixes/fix_refsystem.php'); // Output message displayMessage('{--ADMIN_REPAIR_REFERRAL_SYSTEM_DONE--}');