Skip to content

Commit 09f8902

Browse files
Mary-Clborthagh
authored andcommitted
fix encryption bug
1 parent 7b647e2 commit 09f8902

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

centreon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
</authors>
2828
<versions>
2929
<version>
30-
<num>1.0.1</num>
30+
<num>1.0.2</num>
3131
<compatibility>~10.0.0</compatibility>
32-
<download_url>https://github.com/pluginsGLPI/centreon/releases/download/1.0.1/glpi-centreon-1.0.1.tar.bz2</download_url>
32+
<download_url>https://github.com/pluginsGLPI/centreon/releases/download/1.0.2/glpi-centreon-1.0.2.tar.bz2</download_url>
3333
</version>
3434
</versions>
3535
<langs>

hook.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ function plugin_centreon_install($version)
6363
/**Migration to 1.0.1 */
6464
if ($centreon_password !== null) {
6565
/** Check if pwd is already encrypted, if not, it returns empty string */
66+
/** It's not necessary to encrypt again, because setConfigurationValues() check
67+
* if the value is in secured_configs and if yes, and encrypt it
68+
*/
6669
$decrypted_pwd = @(new GLPIKey())->decrypt($centreon_password);
6770
if ($decrypted_pwd == '') {
6871
Config::setConfigurationValues('plugin:centreon', [
69-
'centreon-password' => (new GLPIKey())->encrypt($centreon_password),
72+
'centreon-password' => $centreon_password,
7073
]);
7174
}
7275
}

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
define('PLUGIN_CENTREON_VERSION', '1.0.1');
31+
define('PLUGIN_CENTREON_VERSION', '1.0.2');
3232

3333
// Minimal GLPI version, inclusive
3434
define('PLUGIN_CENTREON_MIN_GLPI_VERSION', '10.0.0');

0 commit comments

Comments
 (0)