From c60f53306468facda19f7fc16e7a0228a9e017c8 Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Sat, 13 Jan 2024 06:36:10 +0100 Subject: [PATCH] 3.1.1 Fix #4006 --- includes/config/include.php | 4 ++-- install/install.queries.php | 2 +- install/upgrade_run_3.1.php | 8 +++++++- sources/items.queries.php | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/config/include.php b/includes/config/include.php index 1ad6cdeaa..49f98aae4 100755 --- a/includes/config/include.php +++ b/includes/config/include.php @@ -27,8 +27,8 @@ */ define('TP_VERSION', '3.1.1'); -define("UPGRADE_MIN_DATE", "1702452416"); -define('TP_VERSION_MINOR', '38'); +define("UPGRADE_MIN_DATE", "1705123921"); +define('TP_VERSION_MINOR', '39'); define('TP_TOOL_NAME', 'Teampass'); define('TP_ONE_DAY_SECONDS', 86400); define('TP_ONE_WEEK_SECONDS', 604800); diff --git a/install/install.queries.php b/install/install.queries.php index cc8743ed2..c2f64740c 100755 --- a/install/install.queries.php +++ b/install/install.queries.php @@ -1322,7 +1322,7 @@ function encryptFollowingDefuse($message, $ascii_key) $mysqli_result = mysqli_query( $dbTmp, "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "items_otp` ( - `increment_id` int(12) NOT NULL, + `increment_id` int(12) NOT NULL AUTO_INCREMENT, `item_id` int(12) NOT NULL, `secret` text NOT NULL, `timestamp` varchar(100) NOT NULL, diff --git a/install/upgrade_run_3.1.php b/install/upgrade_run_3.1.php index 269df3f20..1b2a080c1 100755 --- a/install/upgrade_run_3.1.php +++ b/install/upgrade_run_3.1.php @@ -111,7 +111,7 @@ mysqli_query( $db_link, 'CREATE TABLE IF NOT EXISTS `' . $pre . 'items_otp` ( - `increment_id` int(12) NOT NULL, + `increment_id` int(12) NOT NULL AUTO_INCREMENT, `item_id` int(12) NOT NULL, `secret` text NOT NULL, `timestamp` varchar(100) NOT NULL, @@ -122,6 +122,12 @@ ) CHARSET=utf8;' ); +// Alter table items_otp (see #4006) +mysqli_query( + $db_link, + 'ALTER TABLE `' . $pre . 'items_otp` CHANGE `increment_id` `increment_id` INT(12) NOT NULL AUTO_INCREMENT;' +); + // Alter table TOKENS mysqli_query( $db_link, diff --git a/sources/items.queries.php b/sources/items.queries.php index 7aa58db17..fdb8d1e7a 100755 --- a/sources/items.queries.php +++ b/sources/items.queries.php @@ -3825,7 +3825,7 @@ 'httponly' => true, 'samesite' => 'Lax' // None || Lax || Strict ); - // deepcode ignore WebCookieSecureDisabledByDefault: + // deepcode ignore WebCookieSecureDisabledByDefault: defined in $arr_cookie_options, deepcode ignore WebCookieHttpOnlyDisabledByDefault: defined in $arr_cookie_options setcookie('jstree_select', $inputData['id'], $arr_cookie_options); // CHeck if roles have 'allow_pw_change' set to true