Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

chore(release): merge hotfix-mon-15318 in 22.04.x (Centreon WEB 22.04.7) #11982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions www/class/centreonAuth.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion www/install/insertBaseConf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion www/install/php/Update-22.04.0-beta.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions www/install/php/Update-22.04.6.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
20 changes: 20 additions & 0 deletions www/install/php/Update-22.04.7.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* Copyright 2005 - 2022 Centreon (https://www.centreon.com/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : contact@centreon.com
*
*/