Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New license registration code #5937

Merged
merged 65 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
4d0dfe2
New license dialog
bastianallgeier Nov 7, 2023
c3e8f8e
Make hub address configurable
bastianallgeier Nov 7, 2023
d2f900d
New license class and first steps to integrate it
bastianallgeier Nov 8, 2023
19f0d5e
`LicenseStatus` enum
distantnative Nov 11, 2023
b7e947c
A few fixes after the new status enum
bastianallgeier Nov 13, 2023
66ba9ee
Small improvements and lab example
bastianallgeier Nov 13, 2023
b803ecb
New button group and lab example setup
bastianallgeier Nov 14, 2023
541e0ff
New LicenseStatus definitions and dialogs
bastianallgeier Nov 14, 2023
81d93c4
Fix cs issues
bastianallgeier Nov 14, 2023
dcfbf5e
Add first set of unit tests for the license class
bastianallgeier Nov 15, 2023
3779579
Licenses: change status wording
distantnative Nov 14, 2023
197a5f3
Fix date issue and color
bastianallgeier Nov 15, 2023
eb7af57
New license type enum and unit tests
bastianallgeier Nov 15, 2023
dfaed36
Add API license model and fix more unit tests
bastianallgeier Nov 15, 2023
9087314
Try to fix CS issues manually
bastianallgeier Nov 15, 2023
11f2159
Fix dialog label
bastianallgeier Nov 15, 2023
668f86f
Renamed methods and fixed license verification
bastianallgeier Nov 15, 2023
593e6db
New License::update method and better renewal logic
bastianallgeier Nov 15, 2023
eae88e9
New license dialog
bastianallgeier Nov 7, 2023
b6e2aa2
Make hub address configurable
bastianallgeier Nov 7, 2023
0ffc660
New license class and first steps to integrate it
bastianallgeier Nov 8, 2023
754ca64
`LicenseStatus` enum
distantnative Nov 11, 2023
788c8c5
A few fixes after the new status enum
bastianallgeier Nov 13, 2023
5af81c4
Small improvements and lab example
bastianallgeier Nov 13, 2023
eb8aec8
New button group and lab example setup
bastianallgeier Nov 14, 2023
098ef2f
New LicenseStatus definitions and dialogs
bastianallgeier Nov 14, 2023
7410b32
Fix cs issues
bastianallgeier Nov 14, 2023
49a56ac
Add first set of unit tests for the license class
bastianallgeier Nov 15, 2023
fd671af
Licenses: change status wording
distantnative Nov 14, 2023
84133ab
Fix date issue and color
bastianallgeier Nov 15, 2023
ee59b98
New license type enum and unit tests
bastianallgeier Nov 15, 2023
029aa87
Add API license model and fix more unit tests
bastianallgeier Nov 15, 2023
7bf39f8
Try to fix CS issues manually
bastianallgeier Nov 15, 2023
023fe20
Fix dialog label
bastianallgeier Nov 15, 2023
ce22b68
Renamed methods and fixed license verification
bastianallgeier Nov 15, 2023
22a195b
New License::update method and better renewal logic
bastianallgeier Nov 15, 2023
32d10e8
Change translation strings
bastianallgeier Nov 20, 2023
115caf5
Merge branch 'v4/enhancement/licenses' of https://github.com/getkirby…
bastianallgeier Nov 20, 2023
ce3ff18
Remove license type after introduction of global type string
bastianallgeier Nov 20, 2023
1a27e75
Merge branch 'v4/develop' into v4/enhancement/licenses
bastianallgeier Nov 21, 2023
60af17c
Remove unnecessary section from license dialog
bastianallgeier Nov 23, 2023
e6d9a97
Adjust upgrade flow
bastianallgeier Nov 23, 2023
2153815
Use error messages from the hub
bastianallgeier Nov 23, 2023
e0030ef
Merge branch 'v4/develop' into v4/enhancement/licenses
bastianallgeier Nov 23, 2023
c9cbb92
Fix cs
distantnative Nov 23, 2023
af72185
Fix js unit tests
distantnative Nov 23, 2023
6c9db1b
Change theme for `LicenseStatus::Legacy`
distantnative Nov 24, 2023
f98e03a
Add some more unit tests
distantnative Nov 24, 2023
a08a227
Merge branch 'v4/develop' into v4/enhancement/licenses
bastianallgeier Nov 24, 2023
6e4335b
New LicenseStatus::Demo
bastianallgeier Nov 24, 2023
ba36a46
Use normalize instead of sanitize
bastianallgeier Nov 25, 2023
588856c
Add more checks to isComplete
bastianallgeier Nov 25, 2023
abedd0e
Code style fix
bastianallgeier Nov 25, 2023
fa52a27
Remove outdated translation string
bastianallgeier Nov 25, 2023
3f812e4
Better code comment
bastianallgeier Nov 25, 2023
5a275da
Better translation consistency
bastianallgeier Nov 25, 2023
1acfe09
Translate demo state
bastianallgeier Nov 25, 2023
5e62e65
Fix unit test
bastianallgeier Nov 25, 2023
68cfc8d
Merge branch 'v4/develop' into v4/enhancement/licenses
bastianallgeier Nov 25, 2023
22fb0aa
Fix unit tests
bastianallgeier Nov 25, 2023
8b24ce7
Fix unit test class position
bastianallgeier Nov 25, 2023
4d00ab5
Fix coding style
lukasbestle Nov 25, 2023
1e9f119
Merge branch 'v4/develop' into v4/enhancement/licenses
bastianallgeier Nov 27, 2023
0041eba
Ignore parts that communicate with the hub
bastianallgeier Nov 27, 2023
8d41b8e
Fix cs issues
bastianallgeier Nov 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix cs issues
  • Loading branch information
bastianallgeier authored and distantnative committed Nov 20, 2023
commit 7410b32b2eb2fa3e0ef3bbb4236e917f2c5f81c4
2 changes: 0 additions & 2 deletions config/areas/system/dialogs.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php

use Kirby\Cms\App;
use Kirby\Http\Response;
use Kirby\Panel\Field;
use Kirby\Panel\Panel;
use Kirby\Toolkit\I18n;

return [
Expand Down
10 changes: 5 additions & 5 deletions src/Cms/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function checkout(): string
public function code(bool $obfuscated = false): string|null
{
if ($this->code !== null && $obfuscated === true) {
return Str::substr($this->code, 0, 10) . str_repeat('X', 22);
return Str::substr($this->code, 0, 10) . str_repeat('X', 22);
}

return $this->code;
Expand Down Expand Up @@ -153,7 +153,7 @@ public function isLegacy(): bool

/**
* Runs multiple checks to find out if the license is
* installed and verifiable
* installed and verifiable
*/
public function isMissing(): bool
{
Expand Down Expand Up @@ -278,7 +278,7 @@ public static function read(): static
try {
$license = Json::read(App::instance()->root('license'));
} catch (Throwable) {
return new static;
return new static();
}

return new static(...static::polyfill($license));
Expand Down Expand Up @@ -337,8 +337,8 @@ public function signature(): string|null

/**
* Returns the license status as string
* This is used to build the proper UI elements
* for the license activation
* This is used to build the proper UI elements
* for the license activation
*/
public function status(): LicenseStatus
{
Expand Down
8 changes: 4 additions & 4 deletions src/Cms/LicenseStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ enum LicenseStatus: string

/**
* The free feature period of
bastianallgeier marked this conversation as resolved.
Show resolved Hide resolved
* the license is over.
* the license is over.
*/
case Inactive = 'inactive';

/**
* The installation has an old
* license (v1, v2, v3)
* license (v1, v2, v3)
*/
case Legacy = 'legacy';

/**
* The installation has no license or
* the license cannot be validated
* The installation has no license or
* the license cannot be validated
*/
case Missing = 'missing';

Expand Down
2 changes: 1 addition & 1 deletion src/Cms/PluginAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function ($asset) {

// collect all path segments
// (e.g. foo/, foo/bar/, foo/bar/baz.css) for the asset
for ($i=1, $max = count($parts); $i <= $max; $i++) {
for ($i = 1, $max = count($parts); $i <= $max; $i++) {
$paths[] = implode('/', array_slice($parts, 0, $i));

// TODO: remove when media hash is enforced as mandatory
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function columnTypes(): array
* Combines an identifier (table and column)
*
* @param $values bool Whether the identifier is going to be used for a VALUES clause;
* only relevant for SQLite
* only relevant for SQLite
*/
public function combineIdentifier(string $table, string $column, bool $values = false): string
{
Expand Down