From d41770a249505b84d3dd820c9343853d84c5b9be Mon Sep 17 00:00:00 2001 From: Matt Porritt Date: Sun, 19 Feb 2023 15:15:23 +1100 Subject: [PATCH] MDL-77300 Site Registration: Prompt to register site after upgrade Unregistered sites will now display registration form to admins after every core upgrade. Non core upgrades will not trigger the form. Registration form will not show for sites that are not set to public. --- lib/classes/hub/registration.php | 2 +- lib/upgradelib.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/classes/hub/registration.php b/lib/classes/hub/registration.php index b4f781c7be5..73a2378dc9e 100644 --- a/lib/classes/hub/registration.php +++ b/lib/classes/hub/registration.php @@ -578,7 +578,7 @@ class registration { } /** - * Redirect to the site registration form if it's a new install or registration needs updating + * Redirect to the site registration form if it's a new install, upgrade or registration needs updating. * * @param string|moodle_url $url */ diff --git a/lib/upgradelib.php b/lib/upgradelib.php index cb70762d4a7..46b33f5bf7d 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -1921,6 +1921,9 @@ function upgrade_core($version, $verbose) { $syscontext->mark_dirty(); core_upgrade_time::record_detail('context_system::mark_dirty'); + // Prompt admin to register site. Reminder flow handles sites already registered, so admin won't be prompted if registered. + set_config('registrationpending', true); + print_upgrade_part_end('moodle', false, $verbose); } catch (Exception $ex) { upgrade_handle_exception($ex);