mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-60887 registration: allow plugins to register on custom hubs
This commit is contained in:
parent
5bde2c2b62
commit
12a67a4266
@ -46,6 +46,14 @@ $error = optional_param('error', '', PARAM_ALPHANUM);
|
||||
admin_externalpage_setup('registrationmoodleorg');
|
||||
|
||||
if ($url !== HUB_MOODLEORGHUBURL) {
|
||||
// Allow other plugins to confirm registration on hubs other than moodle.net . Plugins implementing this
|
||||
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
|
||||
$callbacks = get_plugins_with_function('hub_registration');
|
||||
foreach ($callbacks as $plugintype => $plugins) {
|
||||
foreach ($plugins as $plugin => $callback) {
|
||||
$callback('confirm');
|
||||
}
|
||||
}
|
||||
throw new moodle_exception('errorotherhubsnotsupported', 'hub');
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,14 @@ $token = optional_param('token', '', PARAM_TEXT);
|
||||
admin_externalpage_setup('registrationmoodleorg');
|
||||
|
||||
if ($url !== HUB_MOODLEORGHUBURL) {
|
||||
// Allow other plugins to renew registration on hubs other than moodle.net . Plugins implementing this
|
||||
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
|
||||
$callbacks = get_plugins_with_function('hub_registration');
|
||||
foreach ($callbacks as $plugintype => $plugins) {
|
||||
foreach ($plugins as $plugin => $callback) {
|
||||
$callback('renew');
|
||||
}
|
||||
}
|
||||
throw new moodle_exception('errorotherhubsnotsupported', 'hub');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user