From bcbfcb34e8ced3ceec5a416ebe75d36bab8d83d9 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 14 Aug 2024 20:26:18 +0200 Subject: [PATCH] fix typo in varchar length of selector field of new panel_2fa_tokens table, thx to Davidd Signed-off-by: Michael Kaufmann --- index.php | 3 +++ install/froxlor.sql.php | 4 ++-- install/updates/froxlor/update_2.2.inc.php | 9 +++++++++ lib/Froxlor/Froxlor.php | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 3ee8b9427d..4251ff9eea 100644 --- a/index.php +++ b/index.php @@ -394,6 +394,9 @@ } exit(); } + // not found or invalid, this cookie is useless, get rid of it + unset($_COOKIE['frx_2fa_remember']); + setcookie('frx_2fa_remember', "", time()-3600); } // redirect to code-enter-page diff --git a/install/froxlor.sql.php b/install/froxlor.sql.php index 65769e2017..701cb58812 100644 --- a/install/froxlor.sql.php +++ b/install/froxlor.sql.php @@ -731,7 +731,7 @@ ('panel', 'settings_mode', '0'), ('panel', 'menu_collapsed', '1'), ('panel', 'version', '2.2.0-rc3'), - ('panel', 'db_version', '202407200'); + ('panel', 'db_version', '202408140'); DROP TABLE IF EXISTS `panel_tasks`; @@ -1054,7 +1054,7 @@ DROP TABLE IF EXISTS `panel_2fa_tokens`; CREATE TABLE `panel_2fa_tokens` ( `id` int(11) NOT NULL auto_increment, - `selector` varchar(20) NOT NULL, + `selector` varchar(200) NOT NULL, `token` varchar(200) NOT NULL, `userid` int(11) NOT NULL default '0', `valid_until` int(15) NOT NULL, diff --git a/install/updates/froxlor/update_2.2.inc.php b/install/updates/froxlor/update_2.2.inc.php index e84786c371..27dc4d1581 100644 --- a/install/updates/froxlor/update_2.2.inc.php +++ b/install/updates/froxlor/update_2.2.inc.php @@ -150,3 +150,12 @@ Update::showUpdateStep("Updating from 2.2.0-rc2 to 2.2.0-rc3", false); Froxlor::updateToVersion('2.2.0-rc3'); } + +if (Froxlor::isDatabaseVersion('202407200')) { + + Update::showUpdateStep("Adjusting field in 2fa-token table"); + Database::query("ALTER TABLE `panel_2fa_tokens` CHANGE COLUMN `selector` `selector` varchar(200) NOT NULL;"); + Update::lastStepStatus(0); + + Froxlor::updateToDbVersion('202408140'); +} diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index aa06a15d7f..78894a6bb4 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -34,7 +34,7 @@ final class Froxlor const VERSION = '2.2.0-rc3'; // Database version (YYYYMMDDC where C is a daily counter) - const DBVERSION = '202407200'; + const DBVERSION = '202408140'; // Distribution branding-tag (used for Debian etc.) const BRANDING = '';