-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(fixes-for-new-licensing-with-product-summary)
- Loading branch information
1 parent
8bc98d2
commit e26b7c0
Showing
14 changed files
with
294 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
<id>sendent</id> | ||
<name>Sendent</name> | ||
<summary lang="en">Sendent allows you to securely exchange files and emails</summary> | ||
<description lang="en">Sendent allows you to securely exchange files and emails. Sendent is linked to Microsoft Outlook, so you can continue to work from your trusted email program while you mail more easily and securely. Very useful, for example, to share privacy-sensitive documents or content or to send attachments that are normally too large to email. All files are uploaded to your personal Nextcloud environment from which you determine who has access to them.</description> | ||
<version>2.0.6</version> | ||
<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> | ||
<licence>agplv3</licence> | ||
<author mail="[email protected]" homepage="https://www.sendent.nl">Sendent B.V.</author> | ||
<namespace>Sendent</namespace> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,6 +197,7 @@ public function showForNCGroup(string $ncgroup = ''): DataResponse { | |
$dateLastCheck = $result[0]->getDatelastchecked(); | ||
$level = $result[0]->getLevel(); | ||
$group = $result[0]->getNcgroup(); | ||
$product = $result[0]->getProduct(); | ||
$statusKind = ""; | ||
$status = ""; | ||
|
||
|
@@ -212,6 +213,12 @@ public function showForNCGroup(string $ncgroup = ''): DataResponse { | |
$status = $this->l->t("Revalidation of your license is required"); | ||
$statusKind = "check"; | ||
} | ||
elseif (!$result[0]->isCheckNeeded() && !$result[0]->isLicenseExpired() && !$result[0]->isSupportedProduct()) { | ||
$status = $this->l->t("Current license is not intended to be used with Sendent MS Office products. It is only intended to be used for configuring: " . $product) . | ||
"</br>" . | ||
$this->l->t('%1$sContact support%2$s if you experience issues with configuring your license key.', ["<a href='mailto:[email protected]' style='color:blue'>", "</a>"]); | ||
$statusKind = "expired"; | ||
} | ||
elseif ($result[0]->isLicenseRenewedOrSwitched()) { | ||
$status = $this->l->t("Current license has been changed.") . | ||
"</br>" . | ||
|
@@ -328,6 +335,8 @@ public function showForNCGroupInternal(string $ncgroup = ''): DataResponse { | |
$dateLastCheck = $result[0]->getDatelastchecked(); | ||
$level = $result[0]->getLevel(); | ||
$group = $result[0]->getNcgroup(); | ||
$product = $result[0]->getProduct(); | ||
$istrial = $result[0]->getIstrial(); | ||
$statusKind = ""; | ||
$status = ""; | ||
|
||
|
@@ -343,6 +352,12 @@ public function showForNCGroupInternal(string $ncgroup = ''): DataResponse { | |
$status = $this->l->t("Revalidation of your license is required"); | ||
$statusKind = "check"; | ||
} | ||
elseif (!$result[0]->isCheckNeeded() && !$result[0]->isLicenseExpired() && !$result[0]->isSupportedProduct()) { | ||
$status = $this->l->t("Current license is not intended to be used with the Sendent app. <br/>Please install/configure Sendent Synchroniser because this license is only intended to be used for configuring: " . $product) . | ||
"</br>" . | ||
$this->l->t('%1$sContact support%2$s if you experience issues with configuring your license key.', ["<a href='mailto:[email protected]' style='color:blue'>", "</a>"]); | ||
$statusKind = "expired"; | ||
} | ||
elseif ($result[0]->isLicenseRenewedOrSwitched()) { | ||
$status = $this->l->t("Current license has been changed.") . | ||
"</br>" . | ||
|
@@ -367,10 +382,14 @@ public function showForNCGroupInternal(string $ncgroup = ''): DataResponse { | |
$this->l->t('%1$sContact support%2$s if you experience issues with configuring your license key.', ["<a href='mailto:[email protected]' style='color:blue'>", "</a>"]); | ||
$statusKind = "expired"; | ||
} | ||
elseif (!$result[0]->isCheckNeeded() && !$result[0]->isLicenseExpired()) { | ||
elseif (!$result[0]->isCheckNeeded() && !$result[0]->isLicenseExpired() && $result[0]->isSupportedProduct()) { | ||
$status = $this->l->t("Current license is valid"); | ||
$statusKind = "valid"; | ||
} | ||
elseif (!$result[0]->isCheckNeeded() && !$result[0]->isLicenseExpired()) { | ||
$status = $this->l->t("Current license is valid but there could be an issue for the supported products: " . $product); | ||
$statusKind = "valid"; | ||
} | ||
elseif (!$this->licensemanager->isWithinUserCount($result[0]) && $this->licensemanager->isWithinGraceUserCount($result[0])) { | ||
$status = $this->l->t("Current amount of active users exceeds licensed amount. Some users might not be able to use Sendent."); | ||
$statusKind = "userlimit"; | ||
|
@@ -379,14 +398,16 @@ public function showForNCGroupInternal(string $ncgroup = ''): DataResponse { | |
$status = $this->l->t("Current amount of active users exceeds licensed amount. Additional users trying to use Sendent will be prevented from doing so."); | ||
$statusKind = "userlimit"; | ||
} | ||
return new DataResponse(new LicenseStatus($status, $statusKind, $level,$licensekey, $dateExpiration, $dateLastCheck, $email, $group)); | ||
return new DataResponse(new LicenseStatus($status, $statusKind, $level,$licensekey, $dateExpiration, $dateLastCheck, $email, $product, $istrial, $group)); | ||
} | ||
elseif (count($result) > 0 && $result[0]->getLevel() == "Error_incomplete") { | ||
$email = $result[0]->getEmail(); | ||
$licensekey = $result[0]->getLicensekey(); | ||
$group = $result[0]->getNcgroup(); | ||
$product = $result[0]->getProduct(); | ||
$istrial = $result[0]->getIstrial(); | ||
$status = $this->l->t('Missing (or incorrect) email address or license key. %1$sContact support%2$s to get your correct license information.', ["<a href='mailto:[email protected]' style='color:blue'>", "</a>"]); | ||
return new DataResponse(new LicenseStatus($status, "error_incomplete" ,"-", $licensekey, "-", "-", $email, $group)); | ||
return new DataResponse(new LicenseStatus($status, "error_incomplete" ,"-", $licensekey, "-", "-", $email, "-", "-", $group)); | ||
} | ||
elseif (count($result) > 0 && $result[0]->getLevel() == License::ERROR_VALIDATING) { | ||
$email = $result[0]->getEmail(); | ||
|
@@ -396,14 +417,16 @@ public function showForNCGroupInternal(string $ncgroup = ''): DataResponse { | |
$dateLastCheck = $result[0]->getDatelastchecked(); | ||
$level = $result[0]->getLevel(); | ||
$group = $result[0]->getNcgroup(); | ||
return new DataResponse(new LicenseStatus($this->l->t("Cannot verify your license. Please make sure your licensekey and email address are correct before you try to 'Activate license'."), "error_validating",$level, $licensekey, $dateExpiration, $dateLastCheck, $email, $group)); | ||
$product = $result[0]->getProduct(); | ||
$istrial = $result[0]->getIstrial(); | ||
return new DataResponse(new LicenseStatus($this->l->t("Cannot verify your license. Please make sure your licensekey and email address are correct before you try to 'Activate license'."), "error_validating",$level, $licensekey, $dateExpiration, $dateLastCheck, $email, $product, $istrial, $group)); | ||
} | ||
else { | ||
return new DataResponse(new LicenseStatus($this->l->t("No license configured"), "nolicense" ,"-", "-", "-", "-", "-")); | ||
return new DataResponse(new LicenseStatus($this->l->t("No license configured"), "nolicense" ,"-", "-", "-", "-", "-", "-", "-")); | ||
} | ||
} | ||
else { | ||
return new DataResponse(new LicenseStatus($this->l->t("No license configured"), "nolicense" ,"-", "-", "-", "-", "-")); | ||
return new DataResponse(new LicenseStatus($this->l->t("No license configured"), "nolicense" ,"-", "-", "-", "-", "-", "-", "-")); | ||
} | ||
} catch (Exception $e) { | ||
$this->logger->error('Cannot verify license'); | ||
|
@@ -414,7 +437,9 @@ public function showForNCGroupInternal(string $ncgroup = ''): DataResponse { | |
$dateLastCheck = $result[0]->getDatelastchecked(); | ||
$level = $result[0]->getLevel(); | ||
$group = $result[0]->getNcgroup(); | ||
return new DataResponse(new LicenseStatus($this->l->t("Cannot verify your license. Please make sure your licensekey and email address are correct before you try to 'Activate license'."), "fatal" ,$level, $licensekey, $dateExpiration, $dateLastCheck, $email, $group)); | ||
$product = $result[0]->getProduct(); | ||
$istrial = $result[0]->getIstrial(); | ||
return new DataResponse(new LicenseStatus($this->l->t("Cannot verify your license. Please make sure your licensekey and email address are correct before you try to 'Activate license'."), "fatal" ,$level, $licensekey, $dateExpiration, $dateLastCheck, $email, $product, $istrial, $group)); | ||
} | ||
} | ||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2022 Your name <[email protected]> | ||
* | ||
* @author Your name <[email protected]> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
namespace OCA\Sendent\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\IDBConnection; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version000020Date20231209100000 extends SimpleMigrationStep { | ||
|
||
/** @var IDBConnection */ | ||
private $db; | ||
|
||
public function __construct(IDBConnection $db) { | ||
$this->db = $db; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
*/ | ||
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
|
||
if ($schema->hasTable('sndnt_license')) { | ||
// Adds a column to store the license used by a connected user | ||
$table = $schema->getTable('sndnt_license'); | ||
|
||
$table->addColumn('product', \OCP\DB\Types::STRING, [ | ||
'notnull' => false, | ||
'default' => 'undetermined' | ||
]); | ||
$table->addColumn('technicallevel', \OCP\DB\Types::STRING, [ | ||
'notnull' => false, | ||
'default' => 'undetermined' | ||
]); | ||
$table->addColumn('istrial', \OCP\DB\Types::INTEGER, [ | ||
'notnull' => false, | ||
'default' => -1 | ||
]); | ||
|
||
} | ||
|
||
|
||
return $schema; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
*/ | ||
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { | ||
|
||
} | ||
} |
Oops, something went wrong.