From a524135c24dd0a8fa359c9a92399467d50fd69e0 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 28 Mar 2016 18:07:19 +0200 Subject: [PATCH] Moved "fix" files (which only helps to fix stuff) in own inc/fixes/ folder. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/extensions/ext-menu.php | 2 +- inc/extensions/ext-refback.php | 2 +- inc/extensions/ext-user.php | 4 +-- inc/extensions/sql_patches/mode-update.php | 2 +- inc/extensions/user/mode-update.php | 12 +++++-- inc/fixes/.htaccess | 1 + inc/fixes/fix_ | 39 ++++++++++++++++++++++ inc/{ => fixes}/fix_filters.php | 0 inc/{ => fixes}/fix_menu.php | 0 inc/{ => fixes}/fix_refsystem.php | 0 inc/{ => fixes}/fix_user_points.php | 0 inc/libs/user_functions.php | 32 +++++++++++++++--- inc/modules/admin/what-repair_refs.php | 2 +- 13 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 inc/fixes/.htaccess create mode 100644 inc/fixes/fix_ rename inc/{ => fixes}/fix_filters.php (100%) rename inc/{ => fixes}/fix_menu.php (100%) rename inc/{ => fixes}/fix_refsystem.php (100%) rename inc/{ => fixes}/fix_user_points.php (100%) 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/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/fix_filters.php b/inc/fixes/fix_filters.php similarity index 100% rename from inc/fix_filters.php rename to inc/fixes/fix_filters.php diff --git a/inc/fix_menu.php b/inc/fixes/fix_menu.php similarity index 100% rename from inc/fix_menu.php rename to inc/fixes/fix_menu.php diff --git a/inc/fix_refsystem.php b/inc/fixes/fix_refsystem.php similarity index 100% rename from inc/fix_refsystem.php rename to inc/fixes/fix_refsystem.php diff --git a/inc/fix_user_points.php b/inc/fixes/fix_user_points.php similarity index 100% rename from inc/fix_user_points.php rename to inc/fixes/fix_user_points.php 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--}'); -- 2.30.2