From ac9043090a8d655958a33d1577499be5ad1f8adc Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Fri, 14 Nov 2025 12:33:31 +0100 Subject: [PATCH 1/2] MDL-87194 message_airnotifier: Fix access key requests --- public/message/output/airnotifier/classes/manager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/message/output/airnotifier/classes/manager.php b/public/message/output/airnotifier/classes/manager.php index b382501e8c7..66d9f678849 100644 --- a/public/message/output/airnotifier/classes/manager.php +++ b/public/message/output/airnotifier/classes/manager.php @@ -135,12 +135,12 @@ class message_airnotifier_manager { $curl->setHeader($header); // Site ids are stored as secrets in md5 in the Moodle public hub. - $params = array( + $params = [ 'url' => $CFG->wwwroot, - 'siteid' => md5($CFG->siteidentifier), + 'siteid' => md5(\core\hub\registration::get_secret()), 'contact' => $USER->email, - 'description' => $CFG->wwwroot - ); + 'description' => $CFG->wwwroot, + ]; $resp = $curl->post($serverurl, $params); if ($key = json_decode($resp, true)) { From cfdea24959bd2b8fd646fdea36f83a63cdd1fc63 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Fri, 14 Nov 2025 13:34:57 +0100 Subject: [PATCH 2/2] MDL-87194 tool_mobile: Fix subscription requests --- public/admin/tool/mobile/classes/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/admin/tool/mobile/classes/api.php b/public/admin/tool/mobile/classes/api.php index 71f6e9abd39..448d6004244 100644 --- a/public/admin/tool/mobile/classes/api.php +++ b/public/admin/tool/mobile/classes/api.php @@ -817,7 +817,7 @@ class api { $credentials[] = ['type' => 'airnotifieraccesskey', 'value' => $CFG->airnotifieraccesskey]; } if (\core\hub\registration::is_registered()) { - $credentials[] = ['type' => 'siteid', 'value' => $CFG->siteidentifier]; + $credentials[] = ['type' => 'siteid', 'value' => \core\hub\registration::get_secret()]; } // Generate a hash key for validating that the request is coming from this site via WS. $key = complex_random_string(32);