diff --git a/system/typemill/Models/License.php b/system/typemill/Models/License.php index b8f2cd7..3b1d8ee 100644 --- a/system/typemill/Models/License.php +++ b/system/typemill/Models/License.php @@ -55,8 +55,6 @@ class License $domain = $this->checkLicenseDomain($licensedata['domain'], $urlinfo); $date = $this->checkLicenseDate($licensedata['payed_until']); -# $domain = true; - if($domain && $date) { return $this->plans[$licensedata['plan']]['scope']; @@ -67,9 +65,18 @@ class License public function refreshLicense() { - + # same as update } + private function updateLicence() + { + # if license not valid anymore, check server for update + } + + private function controlLicence() + { + # regularly check license on server each month. + } public function getLicenseFields() { @@ -143,7 +150,7 @@ class License $verified = openssl_verify($data, $binary_signature, $public_key_pem, OPENSSL_ALGO_SHA256); if ($verified == 1) - { + { return true; } elseif ($verified == 0) @@ -227,11 +234,6 @@ class License return true; } - private function updateLicence() - { - # todo - } - private function checkLicenseDomain(string $licensedomain, array $urlinfo) { $licensehost = parse_url($licensedomain, PHP_URL_HOST); diff --git a/system/typemill/Static/License.php b/system/typemill/Static/License.php index 8058c6c..65e678f 100644 --- a/system/typemill/Static/License.php +++ b/system/typemill/Static/License.php @@ -6,6 +6,7 @@ use Typemill\Static\Translations; class License { + /* public static function getLicenseData() { # returns data for settings page @@ -103,4 +104,5 @@ class License return false; } + */ } \ No newline at end of file diff --git a/system/typemill/Static/Plugins.php b/system/typemill/Static/Plugins.php index fd12ac9..182b8f0 100644 --- a/system/typemill/Static/Plugins.php +++ b/system/typemill/Static/Plugins.php @@ -75,7 +75,7 @@ class Plugins return $middleware; } - public static function getPremiumLicence($className) + public static function getPremiumLicense($className) { $premiumlist = [ '\Plugins\html\html' => 'MAKER' @@ -86,14 +86,14 @@ class Plugins return $premiumList['className']; } - $licenceType = false; + $licenseType = false; - if(method_exists($className, 'setPremiumLicence')) + if(method_exists($className, 'setPremiumLicense')) { - $licenceType = $className::setPremiumLicence(); + $licenseType = $className::setPremiumLicense(); } - return $licenceType; + return $licenseType; } private static function checkRouteArray($routes,$route) diff --git a/system/typemill/author/js/vue-license.js b/system/typemill/author/js/vue-license.js index c6172b2..1aedd07 100644 --- a/system/typemill/author/js/vue-license.js +++ b/system/typemill/author/js/vue-license.js @@ -8,14 +8,22 @@ const app = Vue.createApp({
-
-

BUSINESS License

-

122 € + VAT per year. Perfect for companies.

+
+

MAKER License

+

22 € + VAT/Year. Ideal for personal projects and side hustles.

    -
  • Use all MAKER and BUSINESS products.
  • -
  • For one domain.
  • -
  • For one year.
  • -
  • Until you cancel.
  • +
  • Access to all MAKER-level products.
  • +
  • Valid for one domain.
  • +
  • Annual subscription, cancel anytime.
  • +
+
+
+

BUSINESS License

+

122 € + VAT/Year. Designed for small to medium businesses.

+
    +
  • Includes all MAKER benefits plus BUSINESS-exclusive products.
  • +
  • Valid for one domain.
  • +
  • Annual subscription, cancel anytime.
@@ -37,7 +45,7 @@ const app = Vue.createApp({

Activate your Typemill-License below and enjoy a flatrate-subscription for plugins, themes, and services.

-

You do not have a License yet? Read all about it here.

+

You do not have a License yet? Read all about it on the Typemill website.

@@ -65,9 +73,8 @@ const app = Vue.createApp({
{{ message }}
- +
- `, data() { @@ -78,6 +85,7 @@ const app = Vue.createApp({ message: '', messageClass: '', errors: {}, + disabled: false, src: data.urlinfo.baseurl + "/system/typemill/author/img/typemill-icon.png" } }, @@ -94,6 +102,7 @@ const app = Vue.createApp({ save: function() { this.reset(); + this.disabled = true; var self = this; tmaxios.post('/api/v1/license',{ @@ -101,6 +110,7 @@ const app = Vue.createApp({ }) .then(function (response) { + self.disabled = false; self.messageClass = 'bg-teal-500'; self.message = response.data.message; self.licenseData = response.data.licensedata; @@ -109,6 +119,7 @@ const app = Vue.createApp({ { if(error.response) { + self.disabled = false; self.message = handleErrorMessage(error); self.messageClass = 'bg-rose-500'; if(error.response.data.errors !== undefined) @@ -122,7 +133,8 @@ const app = Vue.createApp({ { this.errors = {}; this.message = ''; - this.messageClass = ''; + this.messageClass = ''; + this.disabled = false; } }, }) \ No newline at end of file diff --git a/system/typemill/author/js/vue-plugins.js b/system/typemill/author/js/vue-plugins.js index 7be8f2f..5f302d8 100644 --- a/system/typemill/author/js/vue-plugins.js +++ b/system/typemill/author/js/vue-plugins.js @@ -29,7 +29,7 @@ const app = Vue.createApp({ {{ $filters.translate('Configure') }} - Buy a license + {{ $filters.translate('Buy a license') }} Donate {{plugin.amount}},-
@@ -61,7 +61,7 @@ const app = Vue.createApp({
{{ message }}
- {{ $filters.translate('Buy a license') }} + {{ $filters.translate('Buy a license') }} {{ $filters.translate('Donate') }} {{plugin.amount}},-
@@ -98,6 +98,9 @@ const app = Vue.createApp({ versions: false, } }, + components: { + 'modal': modal + }, mounted() { eventBus.$on('forminput', formdata => { this.formData[this.current][formdata.name] = formdata.value; diff --git a/system/typemill/author/translations/en.yaml b/system/typemill/author/translations/en.yaml index 5ad0826..4f7dc26 100644 --- a/system/typemill/author/translations/en.yaml +++ b/system/typemill/author/translations/en.yaml @@ -57,7 +57,7 @@ CENTER: 'Center' CHANGE_SLUG: 'Change slug' CHECK: 'Check' CHECK_YOUR_INBOX: 'Check your inbox.' -CHECK_YOUR_LICENSE: 'Check your license.' +CHECK_YOUR_LICENSE: 'Check your license' CLASS: 'Class' CLEAR: 'Clear' CLOSE: 'Close' diff --git a/system/typemill/system.php b/system/typemill/system.php index 4dac56f..1e56a05 100644 --- a/system/typemill/system.php +++ b/system/typemill/system.php @@ -175,10 +175,10 @@ foreach($plugins as $plugin) } # licence check - $PluginLicence = Plugins::getPremiumLicence($className); - if($PluginLicence) + $PluginLicense = Plugins::getPremiumLicense($className); + if($PluginLicense) { - if(!$settings['license'] OR !isset($settings['license'][$PluginLicence])) + if(!$settings['license'] OR !isset($settings['license'][$PluginLicense])) { # \Typemill\Static\Helpers\addLogEntry('No License: ' . $pluginName); if($pluginSettings[$pluginName]['active'])