From fe205ae0aec7bf8aa7502fd615dd3da8466d3475 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Jun 2026 00:11:35 +0200 Subject: [PATCH] Doc --- htdocs/blockedlog/admin/blockedlog_list.php | 19 +++++++++++++++++++ htdocs/blockedlog/class/blockedlog.class.php | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 4be8dae3391..83985ecdbcd 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -312,6 +312,25 @@ if ($withtab) { $param .= '&withtab='.((int) $withtab); } + +// Make some tests on config validity. +$hmac_encoded_secret_key = $block_static->getEncodedHMACSecretKey(); +if (empty($hmac_encoded_secret_key)) { + print '
'; + print 'Error: BLOCKEDLOG_HMAC_KEY was not found. It should have been initialized to a value "BLOCKEDLOG_HMAC_...." during initialization of module BlockedLog or during migration of an old version.'; + print '
'; +} +// Here we have the obfuscated value of BLOCKEDLOG_HMAC_KEY in $hmac_encoded_secret_key. We need to unobfuscate it. +$hmac_secret_key = ''; +try { + $hmac_secret_key = $block_static->getClearHMACSecretKey($hmac_encoded_secret_key); // Note: On network trouble, an Exception is thrown to the caller +} catch (Exception $e) { + print '
'; + print $e->getMessage(); + print '
'; +} + + print '
'; if ($optioncss != '') { diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index e6287c7f6f5..2f3bcf9fd83 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -1610,7 +1610,7 @@ class BlockedLog */ private function buildFinalSignatureHash($clearstring, $format = '') { - global $conf, $mysoc; + global $mysoc; if (empty($format)) { $format = $this->object_format;