From b85b6f2439d78dc3c762b0b1297cdfa5bb677406 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 27 Mar 2017 15:11:13 +0200 Subject: [PATCH] feature endorse password for share links works like "enforce password protection", but let the user optionally remove the password protection after the password is set. by Timo Benk Signed-off-by: Bjoern Schiessle --- lib/private/Settings/Admin/Sharing.php | 1 + lib/private/Template/JSConfigHelper.php | 4 ++++ settings/templates/admin/sharing.php | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php index 9b17efa8028..8f57f77b20a 100644 --- a/lib/private/Settings/Admin/Sharing.php +++ b/lib/private/Settings/Admin/Sharing.php @@ -64,6 +64,7 @@ class Sharing implements ISettings { 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false, 'shareExcludedGroupsList' => $excludeGroupsList, 'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null), + 'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'), ]; return new TemplateResponse('settings', 'admin/sharing', $parameters, ''); diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index ca45bbee9c6..4fc21680211 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -112,6 +112,9 @@ class JSConfigHelper { $apps_paths[$app] = \OC_App::getAppWebPath($app); } + + $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'); + $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false; $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; $defaultExpireDate = $enforceDefaultExpireDate = null; if ($defaultExpireDateEnabled) { @@ -217,6 +220,7 @@ class JSConfigHelper { 'defaultExpireDate' => $defaultExpireDate, 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), + 'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault, 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, diff --git a/settings/templates/admin/sharing.php b/settings/templates/admin/sharing.php index db025c8f205..9de71c58990 100644 --- a/settings/templates/admin/sharing.php +++ b/settings/templates/admin/sharing.php @@ -46,7 +46,9 @@ />
- + /> +
/>
-- 2.39.5