aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Controller
diff options
context:
space:
mode:
authorIscle <albertiscle9@gmail.com>2020-09-23 23:57:57 +0200
committerIscle <albertiscle9@gmail.com>2020-09-24 01:27:33 +0200
commitebd734dc86f8b8e821b2a99539e38516e2876a86 (patch)
tree3ec234487723d6cbe566b7515a421809d779db7d /apps/dav/lib/Controller
parent804ec58011df221a66bfb4b2beb91f9df9a1d1bf (diff)
downloadnextcloud-server-ebd734dc86f8b8e821b2a99539e38516e2876a86.tar.gz
nextcloud-server-ebd734dc86f8b8e821b2a99539e38516e2876a86.zip
DirectController: Let users choose the expiration time
Signed-off-by: Iscle <albertiscle9@gmail.com>
Diffstat (limited to 'apps/dav/lib/Controller')
-rw-r--r--apps/dav/lib/Controller/DirectController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/dav/lib/Controller/DirectController.php b/apps/dav/lib/Controller/DirectController.php
index 4db71df7627..ff7c96ddef1 100644
--- a/apps/dav/lib/Controller/DirectController.php
+++ b/apps/dav/lib/Controller/DirectController.php
@@ -81,7 +81,7 @@ class DirectController extends OCSController {
/**
* @NoAdminRequired
*/
- public function getUrl(int $fileId): DataResponse {
+ public function getUrl(int $fileId, int $expirationTime = 60 * 60 * 8): DataResponse {
$userFolder = $this->rootFolder->getUserFolder($this->userId);
$files = $userFolder->getById($fileId);
@@ -102,7 +102,7 @@ class DirectController extends OCSController {
$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
$direct->setToken($token);
- $direct->setExpiration($this->timeFactory->getTime() + 60 * 60 * 8);
+ $direct->setExpiration($this->timeFactory->getTime() + $expirationTime);
$this->mapper->insert($direct);