Skip to content

Commit

Permalink
MDL-68060 registration: Improve the sites directory location check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Feb 26, 2020
1 parent 199ff6c commit 5aea4d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/registration/confirmregistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

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');
Expand Down
2 changes: 1 addition & 1 deletion admin/registration/renewregistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

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');
Expand Down

0 comments on commit 5aea4d9

Please sign in to comment.