Skip to content

Commit

Permalink
fix(license-ui-and-integration)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonvandebroek committed Jan 17, 2024
1 parent 6b2c2bf commit 4e5b5e6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 32 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,12 @@

## 2.0.4 - 2023-08-22
### Fix
- Fixes issue where upon updating the snippet-settings are reset.
- Fixes issue where upon updating the snippet-settings are reset.

## 3.0.0 - 2024-01-16
### Features
- More insight into your subscription information for the configured license key(s)
- View product- and productlevel that are supported within your subscription
- Enhanced status display for your subscription
- App no longer requires entering a new licensekey when your subscription renewes. The latest licensekey is automatically fetched based on the initial licensekey that is configured.
- Support for the upcoming new Sendent products
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Sendent</name>
<summary lang="en">Sendent allows you to securely exchange files and emails</summary>
<description lang="en">Sendent now securely exchanges files and emails, integrating with both Microsoft Outlook and Microsoft Teams. This enhanced capability allows users to seamlessly conduct their work, not only within their preferred email environment but also within the collaborative framework of Microsoft Teams. Whether sharing privacy-sensitive documents, content, or handling attachments that exceed standard email size constraints, Sendent ensures a streamlined and secure communication experience. All files are directed to your Nextcloud instance, empowering you to control and manage access permissions effectively.</description>
<version>2.0.7</version>
<version>3.0.0</version>
<licence>agplv3</licence>
<author mail="[email protected]" homepage="https://www.sendent.nl">Sendent B.V.</author>
<namespace>Sendent</namespace>
Expand All @@ -22,7 +22,7 @@
<screenshot>https://download.sendent.nl/serverapp/1.0.0/publicsharedate.png</screenshot>

<dependencies>
<nextcloud min-version="25" max-version="27"/>
<nextcloud min-version="25" max-version="28"/>
</dependencies>

<settings>
Expand Down
3 changes: 3 additions & 0 deletions lib/Db/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public function isTrial() : bool{
}
public function isSupportedProduct() : bool{
return str_contains($this->product, 'Outlook') || str_contains($this->product, 'outlook')
|| str_contains($this->product, 'Basic') || str_contains($this->product, 'basic')
|| str_contains($this->product, 'Professional') || str_contains($this->product, 'professional')
|| str_contains($this->product, 'Premium') || str_contains($this->product, 'premium')
|| str_contains($this->product, 'Teams') || str_contains($this->product, 'teams')
|| str_contains($this->level, 'Teams') || str_contains($this->product, 'teams');
}
Expand Down
11 changes: 6 additions & 5 deletions lib/Service/LicenseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ public function create(string $license, string $licenseKeyToken, string $subscri
$licenseobj = new License();

$value = $this->FileStorageManager->writeLicenseTxt($license, $ncgroup);
$licenseobj->setLicensekey($value);
$currentlyActiveValue = $this->FileStorageManager->writeCurrentlyActiveLicenseTxt($licenseKeyToken, $ncgroup);
$licenseProductValue = $this->FileStorageManager->writeLicenseProductsTxt($product, $ncgroup);

$licenseobj->setLicensekey($value);
$licenseobj->setLicensekeytoken($currentlyActiveValue);
$licenseobj->setProduct($licenseProductValue);

$licenseobj->setSubscriptionstatus($subscriptionStatus);
$licenseobj->setEmail($email);
$licenseobj->setLevel($level);
Expand All @@ -235,7 +236,6 @@ public function create(string $license, string $licenseKeyToken, string $subscri
$licenseobj->setDatelicenseend(date_format($datelicenseend, "Y-m-d"));
$licenseobj->setDatelastchecked(date_format($datelastchecked, "Y-m-d"));
$licenseobj->setTechnicallevel($technicalLevel);
$licenseobj->setProduct($licenseProductValue);
$licenseobj->setIstrial($isTrial);
$licenseobj->setNcgroup($ncgroup);

Expand Down Expand Up @@ -299,7 +299,9 @@ public function update(int $id,string $license, string $licenseKeyToken, string


$licenseobj->setLicensekey($value);
$licenseobj->setLicensekeytoken($currentlyActiveValue);
$licenseobj->setLicensekeytoken($currentlyActiveValue);
$licenseobj->setProduct($licenseProductValue);

$licenseobj->setSubscriptionstatus($subscriptionStatus);
$licenseobj->setId($id);
$licenseobj->setEmail($email);
Expand All @@ -310,7 +312,6 @@ public function update(int $id,string $license, string $licenseKeyToken, string
$licenseobj->setDatelicenseend(date_format($datelicenseend, "Y-m-d"));
$licenseobj->setDatelastchecked(date_format($datelastchecked, "Y-m-d"));
$licenseobj->setTechnicallevel($technicalLevel);
$licenseobj->setProduct($licenseProductValue);
$licenseobj->setIstrial($isTrial);
$licenseobj->setNcgroup($ncgroup);

Expand Down
4 changes: 2 additions & 2 deletions src/imports/LicenseHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class LicenseHandler {
let statusdateLastCheckDateString = statusdateLastCheckDate.toLocaleDateString('nl-NL', { timeZone: 'UTC' });
let statusdateExpirationDate = new Date(status.dateExpiration);
let statusdateExpirationDateString = statusdateExpirationDate.toLocaleDateString('nl-NL', { timeZone: 'UTC' });
let statusSubscriptionType = status.istrial == 1 ? "Trial" : status.istrial == 0 ? "Payed subscription" : "Subscrptiontype cannot be determined";
let statusSubscriptionType = status.istrial == 1 ? "Trial" : status.istrial == 0 ? "Payed subscription" : "Subscriptiontype cannot be determined";
let statusSubscriptionLevel = status.level == '0' || status.level == ''|| status.level == null ? status.product : status.level;


Expand All @@ -114,7 +114,7 @@ export default class LicenseHandler {
document.getElementById("latestVSTOVersionDownload")?.setAttribute("href", appStatus.LatestVSTOAddinVersion.UrlBinary);
document.getElementById("latestVSTOVersionReleaseNotes")?.setAttribute("href", appStatus.LatestVSTOAddinVersion.UrlReleaseNotes);
}
if(statusSubscriptionLevel == '' || statusSubscriptionLevel == status.product)
if(statusSubscriptionLevel == '' || statusSubscriptionLevel == status.product || status.product.toLowerCase().includes(statusSubscriptionLevel.toLowerCase()))
{
$("#licenselevelcontainer").removeClass("shown").addClass("hidden");
$("#defaultlicenselevelcontainer").removeClass("shown").addClass("hidden");
Expand Down
8 changes: 4 additions & 4 deletions templates/sections/defaultLicenseStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('Supported products')); ?></span>
</label>
<span class="statuskeyvalueinput statusitem" id="defaultlicenselevel"></span>
<span class="statuskeyvalueinput statusitem" id="defaultlicenseproducts"></span>
</div>
</div>
<div class="license-settings-setting-box" id="defaultlicenselevelcontainer">
Expand All @@ -35,7 +35,7 @@
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License status')); ?></span>
<?php p($l->t('Subscription status')); ?></span>
</label>
<span class="statuskeyvalueinput statusitem" id="defaultlicensestatus"><?php p($_['defaultLicenseStatus']); ?></span>
</div>
Expand All @@ -45,7 +45,7 @@
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License expiration date')); ?></span>
<?php p($l->t('Subscription expiration date')); ?></span>
</label>
<span class="statuskeyvalueinput statusitem" id="defaultlicenseexpires"><?php p($_['defaultLicenseExpirationDate']); ?></span>
</div>
Expand All @@ -54,7 +54,7 @@
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License last check')); ?></span>
<?php p($l->t('License last checked')); ?></span>
</label>
<span class="statuskeyvalueinput statusitem" id="defaultlicenselastcheck"><?php p($_['defaultLicenseLastCheck']); ?></span>
</div>
Expand Down
37 changes: 19 additions & 18 deletions templates/sections/license.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@
<input type="hidden" name="settingkeyid" value="900">
</div>
</div>
<div class="license-settings-setting-box">
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License last checked')); ?></span>
</label>
<div class="status-error icon-error error hidden"></div>
<div class="status-ok icon-checkmark ok hidden"></div>
<span style="font-style:italic;color:black !important;" class="licensekeyvalueinput licenseitem" name="licensekeyvalueinput" id="licenselastcheck"></span>
<input type="hidden" name="settingkeyname" value="licenselastcheck">
<input type="hidden" name="settingkeykey" value="904">
<input type="hidden" name="settingkeyid" value="904">
</div>
</div>
<br><br>
<div class="license-settings-setting-box">
<div class="settingkeyvalue">
<label class="licenselabel">
Expand All @@ -103,7 +118,7 @@
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('Supported products')); ?></span>
<?php p($l->t('Supported product(s)')); ?></span>
</label>
<div class="status-error icon-error error hidden"></div>
<div class="status-ok icon-checkmark ok hidden"></div>
Expand Down Expand Up @@ -132,7 +147,7 @@
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License status')); ?></span>
<?php p($l->t('Subscription status')); ?></span>
</label>
<div class="status-error icon-error error hidden"></div>
<div class="status-ok icon-checkmark ok hidden"></div>
Expand All @@ -147,7 +162,7 @@
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License expiration date')); ?></span>
<?php p($l->t('Subscription expiration date')); ?></span>
</label>
<div class="status-error icon-error error hidden"></div>
<div class="status-ok icon-checkmark ok hidden"></div>
Expand All @@ -157,22 +172,8 @@
<input type="hidden" name="settingkeyid" value="905">
</div>
</div>
<div class="license-settings-setting-box">
<div class="settingkeyvalue">
<label class="licenselabel">
<span class="templatesettingkeyname licenseitem">
<?php p($l->t('License last check')); ?></span>
</label>
<div class="status-error icon-error error hidden"></div>
<div class="status-ok icon-checkmark ok hidden"></div>
<span class="licensekeyvalueinput licenseitem" name="licensekeyvalueinput" id="licenselastcheck"></span>
<input type="hidden" name="settingkeyname" value="licenselastcheck">
<input type="hidden" name="settingkeykey" value="904">
<input type="hidden" name="settingkeyid" value="904">
</div>
</div>
<br><br>

<br><br>
<div class="licensesection test" id="licensesection">
</div>

Expand Down

0 comments on commit 4e5b5e6

Please sign in to comment.