diff --git a/www/class/centreonAuth.class.php b/www/class/centreonAuth.class.php index f4927c283af..c288665df3f 100644 --- a/www/class/centreonAuth.class.php +++ b/www/class/centreonAuth.class.php @@ -202,6 +202,14 @@ protected function checkPassword($password, $token = "", $autoImport = false) */ private function checkAutologinKey($password, $token): void { + if ( + array_key_exists('contact_oreon', $this->userInfos) + && $this->userInfos['contact_oreon'] !== '1' + ) { + $this->passwdOk = self::PASSWORD_INVALID; + return; + } + if ( !empty($this->userInfos["contact_autologin_key"]) && $this->userInfos["contact_autologin_key"] === $token diff --git a/www/install/insertBaseConf.sql b/www/install/insertBaseConf.sql index 64c58364d05..f8fdcb12ba8 100644 --- a/www/install/insertBaseConf.sql +++ b/www/install/insertBaseConf.sql @@ -2,7 +2,7 @@ -- Insert version -- -INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '22.04.6'); +INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '22.04.7'); -- -- Contenu de la table `contact` diff --git a/www/install/php/Update-22.04.0-beta.1.php b/www/install/php/Update-22.04.0-beta.1.php index 5e4a9550566..db39246c105 100644 --- a/www/install/php/Update-22.04.0-beta.1.php +++ b/www/install/php/Update-22.04.0-beta.1.php @@ -539,7 +539,7 @@ function migrateBrokerConfigOutputsToUnifiedSql(CentreonDB $pearDB): void AND config_value IN ($blockIdBinds)"); $grpIdStatement->bindValue(':configId', (int) $configId, PDO::PARAM_INT); foreach ($blockIdsQueryBinds as $key => $value) { - $grpIdStatement->bindValue($key, (int) $value, PDO::PARAM_INT); + $grpIdStatement->bindValue($key, $value, PDO::PARAM_STR); } $grpIdStatement->execute(); $configGroupIds = $grpIdStatement->fetchAll(\PDO::FETCH_COLUMN, 0); diff --git a/www/install/php/Update-22.04.6.php b/www/install/php/Update-22.04.6.php index 932a8d14d06..a96fd9372f1 100644 --- a/www/install/php/Update-22.04.6.php +++ b/www/install/php/Update-22.04.6.php @@ -29,14 +29,22 @@ try { $errorMessage = "Impossible to update 'hosts' table"; if (! str_contains(strtolower($pearDBO->getColumnType('hosts', 'notification_number')), 'bigint')) { + $pearDBO->beginTransaction(); + $pearDBO->query("UPDATE `hosts` SET `notification_number`= 0 WHERE `notification_number`< 0"); $pearDBO->query("ALTER TABLE `hosts` MODIFY `notification_number` BIGINT(20) UNSIGNED DEFAULT NULL"); } $errorMessage = "Impossible to update 'services' table"; if (! str_contains(strtolower($pearDBO->getColumnType('services', 'notification_number')), 'bigint')) { + $pearDBO->beginTransaction(); + $pearDBO->query("UPDATE `services` SET `notification_number`= 0 WHERE `notification_number`< 0"); $pearDBO->query("ALTER TABLE `services` MODIFY `notification_number` BIGINT(20) UNSIGNED DEFAULT NULL"); } } catch (\Exception $e) { + if ($pearDBO->inTransaction()) { + $pearDBO->rollBack(); + } + $centreonLog->insertLog( 4, $versionOfTheUpgrade . $errorMessage . diff --git a/www/install/php/Update-22.04.7.php b/www/install/php/Update-22.04.7.php new file mode 100644 index 00000000000..8572f2a05df --- /dev/null +++ b/www/install/php/Update-22.04.7.php @@ -0,0 +1,20 @@ +