1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-01 11:50:28 +02:00

v2.2.0 Finish license, fix minor errors and wordings

This commit is contained in:
trendschau
2024-02-15 15:06:35 +01:00
parent 3e3d98a7a8
commit 0913e4fbb4
7 changed files with 50 additions and 31 deletions

View File

@@ -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);

View File

@@ -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;
}
*/
}

View File

@@ -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)

View File

@@ -8,14 +8,22 @@ const app = Vue.createApp({
</div>
<div class="flex flex-wrap justify-between">
<div class="w-2/5 text-white bg-teal-500 border-2 border-stone-200 my-8 flex flex-col">
<div class="p-8">
<h2 class="text-2xl font-bold mb-3">BUSINESS License</h2>
<p class="py-2 text-lg"><strong>122 €</strong> + VAT per year. Perfect for companies.</p>
<div v-if="licenseData.plan == 'MAKER'" class="p-8">
<h2 class="text-2xl font-bold mb-3">MAKER License</h2>
<p class="py-2 text-lg"><strong>22 €</strong> + VAT/Year. Ideal for personal projects and side hustles.</p>
<ul class="py-2 pl-4 list-check">
<li class="pl-2">Use all MAKER and BUSINESS products.</li>
<li class="pl-2">For one domain.</li>
<li class="pl-2">For one year.</li>
<li class="pl-2">Until you cancel.</li>
<li class="pl-2">Access to all MAKER-level products.</li>
<li class="pl-2">Valid for one domain.</li>
<li class="pl-2">Annual subscription, cancel anytime.</li>
</ul>
</div>
<div v-if="licenseData.plan == 'BUSINESS'" class="p-8">
<h2 class="text-2xl font-bold mb-3">BUSINESS License</h2>
<p class="py-2 text-lg"><strong>122 €</strong> + VAT/Year. Designed for small to medium businesses.</p>
<ul class="py-2 pl-4 list-check">
<li class="pl-2">Includes all MAKER benefits plus BUSINESS-exclusive products.</li>
<li class="pl-2">Valid for one domain.</li>
<li class="pl-2">Annual subscription, cancel anytime.</li>
</ul>
</div>
</div>
@@ -37,7 +45,7 @@ const app = Vue.createApp({
<div>
<p>Activate your Typemill-License below and enjoy a flatrate-subscription for plugins, themes, and services.</p>
<p>You do not have a License yet? Read all about it <a href="https://typemill.net/license">here</a>.</p>
<p>You do not have a License yet? Read all about it on the <a class="text-teal-500" href="https://typemill.net/license">Typemill website</a>.</p>
</div>
<div v-for="(fieldDefinition, fieldname) in formDefinitions">
@@ -65,9 +73,8 @@ const app = Vue.createApp({
</div>
<div class="my-5">
<div :class="messageClass" class="block w-full h-8 px-3 py-1 my-1 text-white transition duration-100">{{ message }}</div>
<input type="submit" @click.prevent="save()" value="save" class="w-full p-3 my-1 bg-stone-700 hover:bg-stone-900 text-white cursor-pointer transition duration-100">
<input type="submit" :disabled="disabled" @click.prevent="save()" value="save" class="w-full p-3 my-1 bg-stone-700 hover:bg-stone-900 text-white cursor-pointer transition duration-100 disabled:cursor-not-allowed disabled:bg-stone-200 disabled:text-stone-900">
</div>
</form>
</Transition>`,
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;
}
},
})

View File

@@ -29,7 +29,7 @@ const app = Vue.createApp({
<span>{{ $filters.translate('Configure') }}</span>
<span :class="(current == pluginname) ? 'border-b-8 border-b-white' : 'border-t-8 border-t-white'" class="h-0 w-0 border-x-8 border-x-transparent"></span>
</button>
<a v-if="!checkLicense(license, plugin.license)" href="https://typemill.net/buy" target="_blank" class="flex-1 ml-3 p-3 py-4 text-center bg-teal-500 hover:bg-teal-600 text-white cursor-pointer transition duration-100">Buy a license</a>
<a v-if="!checkLicense(license, plugin.license)" href="https://typemill.net/license/buy" target="_blank" class="flex-1 ml-3 p-3 py-4 text-center bg-teal-500 hover:bg-teal-600 text-white cursor-pointer transition duration-100">{{ $filters.translate('Buy a license') }}</a>
<a v-else-if="plugin.paypal" :href="plugin.paypal" target="_blank" class="flex-1 ml-3 p-3 py-4 text-center bg-teal-500 hover:bg-teal-600 text-white cursor-pointer transition duration-100">Donate {{plugin.amount}},-</a>
</div>
</div>
@@ -61,7 +61,7 @@ const app = Vue.createApp({
<div :class="messageClass" class="block w-full h-8 px-3 py-1 my-1 text-white transition duration-100">{{ message }}</div>
<div class="w-full mt-6 flex justify-between">
<button type="submit" @click.prevent="save()" class="flex-1 p-3 bg-stone-700 dark:bg-stone-600 hover:bg-stone-900 hover:dark:bg-stone-900 text-white cursor-pointer transition duration-100">{{ $filters.translate('Save') }}</button>
<a v-if="!checkLicense(license, plugin.license)" href="https://typemill.net/buy" target="_blank" class="flex-1 ml-3 p-3 py-4 text-center bg-teal-500 hover:bg-teal-600 text-white cursor-pointer transition duration-100">{{ $filters.translate('Buy a license') }}</a>
<a v-if="!checkLicense(license, plugin.license)" href="https://typemill.net/license/buy" target="_blank" class="flex-1 ml-3 p-3 py-4 text-center bg-teal-500 hover:bg-teal-600 text-white cursor-pointer transition duration-100">{{ $filters.translate('Buy a license') }}</a>
<a v-else-if="plugin.paypal" :href="plugin.paypal" target="_blank" class="flex-1 ml-3 p-3 py-4 text-center bg-teal-500 hover:bg-teal-600 text-white cursor-pointer transition duration-100">{{ $filters.translate('Donate') }} {{plugin.amount}},-</a>
</div>
</div>
@@ -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;

View File

@@ -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'

View File

@@ -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'])