FIX BLOCKEDLOG_HMAC_KEY can not be the same by entity (#39067)
* FIX BLOCKEDLOG_HMAC_KEY can not be the same by entity * FIX migrate for all entities
This commit is contained in:
parent
a727b8ecbb
commit
0194d44266
2 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017-2025 Laurent Destailleur <eldy@users.sourcefore.net>
|
||||
/* Copyright (C) 2017-2025 Laurent Destailleur <eldy@users.sourcefore.net>
|
||||
* Copyright (C) 2026 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -194,7 +195,7 @@ class modBlockedLog extends DolibarrModules
|
|||
// Add key
|
||||
$hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars
|
||||
|
||||
$result = dolibarr_set_const($this->db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0); // Will encrypt the value using dolCrypt and store it.
|
||||
$result = dolibarr_set_const($this->db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', $conf->entity); // Will encrypt the value using dolCrypt and store it.
|
||||
|
||||
if ($result < 0) {
|
||||
dol_print_error($this->db);
|
||||
|
|
|
|||
|
|
@ -5632,7 +5632,7 @@ function migrate_blockedlog_add_hmac_key()
|
|||
// Add key
|
||||
$hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars
|
||||
|
||||
$result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0); // Will encrypt the value using dolCrypt and store it.
|
||||
$result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', $conf->entity); // Will encrypt the value using dolCrypt and store it.
|
||||
|
||||
if ($result < 0) {
|
||||
dol_print_error($db);
|
||||
|
|
|
|||
Loading…
Reference in a new issue