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

Commit

Permalink
chore(release): merge hotfix-mon-15318 in 22.04.x (Centreon WEB 22.04…
Browse files Browse the repository at this point in the history
….7) (#11982)

* chore(install): update version to 22.04.7 in insertBaseConf

* fixed issue with negative notification_numbers during update (#11936)

Co-authored-by: dmyios <[email protected]>

Refs: MON-15318

* Add update 22.04.7 php file

* enh(auth): autologin enhancement (#11956)

Refs: MON-15384

* fix(upgrade) migration to unifiedsql ouput in broker conf (#11951) (#11960)

Co-authored-by: Kevin Duret <[email protected]>
Co-authored-by: alaunois <[email protected]>
  • Loading branch information
3 people authored Oct 12, 2022
1 parent 94e15aa commit fbc4922
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
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 : [email protected]
*
*/

0 comments on commit fbc4922

Please sign in to comment.