diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-03-25 17:32:49 +0100 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-04-15 10:06:09 +0200 |
commit | af61486aea90cfc1a82301ce624dffb59ed01e07 (patch) | |
tree | 9b608272439503e0015ece40ae4b77013eabc81f /lib/private/Template | |
parent | 2650da70caa73c8bf3119edebb37e91d67f3a214 (diff) | |
download | nextcloud-server-af61486aea90cfc1a82301ce624dffb59ed01e07.tar.gz nextcloud-server-af61486aea90cfc1a82301ce624dffb59ed01e07.zip |
Separate settings for remote share expiration
Added separate settings for default and enforced expiration date for
remote shares.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/private/Template')
-rw-r--r-- | lib/private/Template/JSConfigHelper.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index cd466575601..c8f5fc63b70 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -165,6 +165,13 @@ class JSConfigHelper { $defaultInternalExpireDateEnforced = $this->config->getAppValue('core', 'shareapi_enforce_internal_expire_date', 'no') === 'yes'; } + $defaultRemoteExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_remote_expire_date', 'no') === 'yes'; + $defaultRemoteExpireDate = $defaultRemoteExpireDateEnforced = null; + if ($defaultRemoteExpireDateEnabled) { + $defaultRemoteExpireDate = (int)$this->config->getAppValue('core', 'shareapi_remote_expire_after_n_days', '7'); + $defaultRemoteExpireDateEnforced = $this->config->getAppValue('core', 'shareapi_enforce_remote_expire_date', 'no') === 'yes'; + } + $countOfDataLocation = 0; $dataLocation = str_replace(\OC::$SERVERROOT . '/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); if ($countOfDataLocation !== 1 || $uid === null || !$this->groupManager->isAdmin($uid)) { @@ -278,6 +285,9 @@ class JSConfigHelper { 'defaultInternalExpireDateEnabled' => $defaultInternalExpireDateEnabled, 'defaultInternalExpireDate' => $defaultInternalExpireDate, 'defaultInternalExpireDateEnforced' => $defaultInternalExpireDateEnforced, + 'defaultRemoteExpireDateEnabled' => $defaultRemoteExpireDateEnabled, + 'defaultRemoteExpireDate' => $defaultRemoteExpireDate, + 'defaultRemoteExpireDateEnforced' => $defaultRemoteExpireDateEnforced, ] ]), "_theme" => json_encode([ |