Merge branch 'MDL-87194-501' of https://github.com/albertgasset/moodle into MOODLE_501_STABLE

This commit is contained in:
Huong Nguyen
2025-11-25 10:39:55 +07:00
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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);
@@ -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)) {