From 5aea4d98cb989143161cf9b0612e147d6ffc65e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Wed, 26 Feb 2020 10:56:05 +0100 Subject: [PATCH] MDL-68060 registration: Improve the sites directory location check This allows to define the custom HUB_MOODLEORGHUBURL with HTTP Basic Auth credentials so that the registration features can be tested against our staging site. --- admin/registration/confirmregistration.php | 2 +- admin/registration/renewregistration.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/registration/confirmregistration.php b/admin/registration/confirmregistration.php index ff99680ac8b..6a1ed49da52 100644 --- a/admin/registration/confirmregistration.php +++ b/admin/registration/confirmregistration.php @@ -45,7 +45,7 @@ $error = optional_param('error', '', PARAM_ALPHANUM); admin_externalpage_setup('registrationmoodleorg'); -if ($url !== HUB_MOODLEORGHUBURL) { +if (parse_url($url, PHP_URL_HOST) !== parse_url(HUB_MOODLEORGHUBURL, PHP_URL_HOST)) { // Allow other plugins to confirm registration on custom hubs. Plugins implementing this // callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration . $callbacks = get_plugins_with_function('hub_registration'); diff --git a/admin/registration/renewregistration.php b/admin/registration/renewregistration.php index bc05da60ffe..99a27647e8f 100644 --- a/admin/registration/renewregistration.php +++ b/admin/registration/renewregistration.php @@ -39,7 +39,7 @@ $token = optional_param('token', '', PARAM_TEXT); admin_externalpage_setup('registrationmoodleorg'); -if ($url !== HUB_MOODLEORGHUBURL) { +if (parse_url($url, PHP_URL_HOST) !== parse_url(HUB_MOODLEORGHUBURL, PHP_URL_HOST)) { // Allow other plugins to renew registration on custom hubs. Plugins implementing this // callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration . $callbacks = get_plugins_with_function('hub_registration');