From b65a59568ed9048111dba812a51efcfad982827a Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 9 May 2019 10:39:39 +0200 Subject: [PATCH] add "askForPassword" on capabilities for sharing Signed-off-by: tobiasKaminsky --- apps/files_sharing/lib/Capabilities.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/files_sharing/lib/Capabilities.php b/apps/files_sharing/lib/Capabilities.php index a849dc4c9de60..7c0478fa7c18a 100644 --- a/apps/files_sharing/lib/Capabilities.php +++ b/apps/files_sharing/lib/Capabilities.php @@ -62,6 +62,12 @@ public function getCapabilities() { $public['password'] = []; $public['password']['enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'no') === 'yes'); + if ($public['password']['enforced']) { + $public['password']['askForOptionalPassword'] = false; + } else { + $public['password']['askForOptionalPassword'] = ($this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no') === 'yes'); + } + $public['expire_date'] = []; $public['multiple_links'] = true; $public['expire_date']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';