aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Share20/Manager.php
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-04-12 09:46:31 +0200
committerGitHub <noreply@github.com>2022-04-12 09:46:31 +0200
commit483741ff36ab5ce56d37f65226b76afffb858356 (patch)
treea50478ba2112ef95d8899ce8d994c1b27a49cdf7 /lib/private/Share20/Manager.php
parent4626bfbc83c3b5779d6688c0b9357514e08799ed (diff)
parentc6a5c07041d2e5d20771409aede8b755d28372ac (diff)
downloadnextcloud-server-483741ff36ab5ce56d37f65226b76afffb858356.tar.gz
nextcloud-server-483741ff36ab5ce56d37f65226b76afffb858356.zip
Merge pull request #31220 from nextcloud/enhancement/31005/temporary-passwords
Temporary passwords for public non-anonymous protected shares (ie: files shared with an email recipient).
Diffstat (limited to 'lib/private/Share20/Manager.php')
-rw-r--r--lib/private/Share20/Manager.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 3fca9e3fe14..4e87c37fedb 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -1552,6 +1552,12 @@ class Manager implements IManager {
return false;
}
+ // Makes sure password hasn't expired
+ $expirationTime = $share->getPasswordExpirationTime();
+ if ($expirationTime !== null && $expirationTime < new \DateTime()) {
+ return false;
+ }
+
$newHash = '';
if (!$this->hasher->verify($password, $share->getPassword(), $newHash)) {
return false;