diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-01-25 15:26:16 +0100 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-04-15 10:02:00 +0200 |
commit | 8680bafc5c791153488dd32108f4a7d0969edb8c (patch) | |
tree | a5479cf174400bd1ba9f51423357b3517c308cb2 /lib/private/Share20 | |
parent | 8ef920fdf90bc54d6f17134ebd80a71db2f9d8ea (diff) | |
download | nextcloud-server-8680bafc5c791153488dd32108f4a7d0969edb8c.tar.gz nextcloud-server-8680bafc5c791153488dd32108f4a7d0969edb8c.zip |
Implement expiration date for federated shares
Add expiration date field in UI.
Save expiration date when creating or updating federated share.
Read expiration date from DB in federated share provider.
Applies to both federated user and group shares.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r-- | lib/private/Share20/Manager.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 49a716e3216..f7e7f371b51 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -751,6 +751,9 @@ class Manager implements IManager { // Verify the expiration date $share = $this->validateExpirationDateInternal($share); + } elseif ($share->getShareType() === IShare::TYPE_REMOTE || $share->getShareType() === IShare::TYPE_REMOTE_GROUP) { + //Verify the expiration date + $share = $this->validateExpirationDateInternal($share); } elseif ($share->getShareType() === IShare::TYPE_LINK || $share->getShareType() === IShare::TYPE_EMAIL) { $this->linkCreateChecks($share); @@ -999,7 +1002,7 @@ class Manager implements IManager { if (empty($plainTextPassword) && $share->getSendPasswordByTalk()) { throw new \InvalidArgumentException('Can’t enable sending the password by Talk with an empty password'); } - + /** * If we're in a mail share, we need to force a password change * as either the user is not aware of the password or is already (received by mail) @@ -1019,6 +1022,12 @@ class Manager implements IManager { $this->validateExpirationDateLink($share); $expirationDateUpdated = true; } + } elseif ($share->getShareType() === IShare::TYPE_REMOTE || $share->getShareType() === IShare::TYPE_REMOTE_GROUP) { + if ($share->getExpirationDate() != $originalShare->getExpirationDate()) { + //Verify the expiration date + $this->validateExpirationDateInternal($share); + $expirationDateUpdated = true; + } } $this->pathCreateChecks($share->getNode()); |