From c8000fdf9024d9ba232eaaf192b717cfdae55b53 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 14 Feb 2020 15:21:56 +0100 Subject: [PATCH] Fix the features selection --- src/appstore.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/appstore.js b/src/appstore.js index 80585cc9f..f473fd6a6 100644 --- a/src/appstore.js +++ b/src/appstore.js @@ -75,27 +75,27 @@ function getFeatures() { function updateFeatures(subscriptionInfo) { assert.strictEqual(typeof subscriptionInfo, 'object'); - // FIXME adjust the time - if (moment(subscriptionInfo.cloudronCreatedAt).isBefore('2020-02-10')) { + if (subscriptionInfo.plan.id === '2020-03_personal') { + gFeatures.userMaxCount = 5; + gFeatures.externalLdap = false; + gFeatures.eventLog = false; + gFeatures.privateDockerRegistry = false; + gFeatures.branding = false; + } else if (subscriptionInfo.plan.id === '2020-03_business' || subscriptionInfo.plan.id === 'education' || subscriptionInfo.plan.id === 'contributor') { gFeatures.userMaxCount = null; // unlimited gFeatures.externalLdap = true; gFeatures.eventLog = true; gFeatures.privateDockerRegistry = true; - gFeatures.branding = false; + gFeatures.branding = true; } else { - if (subscriptionInfo.plan.id === '2020-03_personal') { - gFeatures.userMaxCount = 5; - gFeatures.externalLdap = false; - gFeatures.eventLog = false; - gFeatures.privateDockerRegistry = false; - gFeatures.branding = false; - } else if (subscriptionInfo.plan.id === '2020-03_business' || subscriptionInfo.plan.id === 'education' || subscriptionInfo.plan.id === 'contributor') { + // FIXME adjust the time + if (moment(subscriptionInfo.cloudronCreatedAt).isBefore('2020-02-10')) { // previously we only had app restrictions gFeatures.userMaxCount = null; // unlimited gFeatures.externalLdap = true; gFeatures.eventLog = true; gFeatures.privateDockerRegistry = true; gFeatures.branding = true; - } else { + } else { // this is the 2020 free tier gFeatures.userMaxCount = 3; gFeatures.externalLdap = false; gFeatures.eventLog = false;