From c2cf4967023e61b65bf3e2a57497c1e952cd94cd Mon Sep 17 00:00:00 2001 From: tuntoja <58987095+tuntoja@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:37:35 +0200 Subject: [PATCH] chore(release): merge hotfix-mon-15384 in 21.04.x (#11980) * enh(auth): autologin enhancement (#11958) Refs: MON-15384 * update version to 21.04.20 Co-authored-by: Kevin Duret --- www/class/centreonAuth.class.php | 8 ++++++++ www/install/insertBaseConf.sql | 2 +- www/install/php/Update-21.04.20.php | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 www/install/php/Update-21.04.20.php diff --git a/www/class/centreonAuth.class.php b/www/class/centreonAuth.class.php index db9d0cca170..89b4bf88e37 100644 --- a/www/class/centreonAuth.class.php +++ b/www/class/centreonAuth.class.php @@ -230,6 +230,14 @@ protected function checkPassword($password, $token = "", $autoImport = false) || $this->userInfos["contact_auth_type"] == "local" || $this->autologin ) { + if ( + array_key_exists('contact_oreon', $this->userInfos) + && $this->userInfos['contact_oreon'] !== '1' + ) { + $this->passwdOk = 0; + return; + } + if ($this->autologin && $this->userInfos["contact_autologin_key"] && $this->userInfos["contact_autologin_key"] === $token diff --git a/www/install/insertBaseConf.sql b/www/install/insertBaseConf.sql index 401de4e056f..ffd78e0cc12 100644 --- a/www/install/insertBaseConf.sql +++ b/www/install/insertBaseConf.sql @@ -2,7 +2,7 @@ -- Insert version -- -INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '21.04.19'); +INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '21.04.20'); -- -- Contenu de la table `contact` diff --git a/www/install/php/Update-21.04.20.php b/www/install/php/Update-21.04.20.php new file mode 100644 index 00000000000..8572f2a05df --- /dev/null +++ b/www/install/php/Update-21.04.20.php @@ -0,0 +1,20 @@ +