Skip to content

Commit

Permalink
Show license dialog after legacy activation
Browse files Browse the repository at this point in the history
Allows the user to directly renew the just activated legacy license
  • Loading branch information
lukasbestle committed Dec 23, 2023
1 parent 4de9916 commit 50b1c42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions config/areas/system/dialogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
return [
// license key
'license' => [
'load' => function () {
'load' => $licenseDialog = function () {
$kirby = App::instance();
$license = $kirby->system()->license();
$obfuscated = $kirby->user()->isAdmin() === false;
Expand Down Expand Up @@ -95,14 +95,18 @@
]
];
},
'submit' => function () {
'submit' => function () use ($licenseDialog) {
// @codeCoverageIgnoreStart
$kirby = App::instance();
$kirby->system()->register(
$kirby->request()->get('license'),
$kirby->request()->get('email')
);

if ($kirby->system()->license()->isLegacy() === true) {
return $licenseDialog();
}

return [
'event' => 'system.register',
'message' => I18n::translate('license.success')
Expand Down

0 comments on commit 50b1c42

Please sign in to comment.