diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-02-09 14:26:49 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-03-11 15:02:55 +0100 |
commit | af76716775f0f16755fa3369b6336feded291f70 (patch) | |
tree | 75a85b23493f1e0f4e2d99888017a0d82ce88a75 /apps/files_sharing/lib | |
parent | 0bf1152a512d72a390da3b6ae9432066db4df1fa (diff) | |
download | nextcloud-server-af76716775f0f16755fa3369b6336feded291f70.tar.gz nextcloud-server-af76716775f0f16755fa3369b6336feded291f70.zip |
Now added enabled element
This change allows for more generic parsing for the capabilities.
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/capabilities.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php index 95ee810bc9f..21822b18503 100644 --- a/apps/files_sharing/lib/capabilities.php +++ b/apps/files_sharing/lib/capabilities.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ - + namespace OCA\Files_Sharing; use \OCP\IConfig; @@ -43,14 +43,14 @@ class Capabilities { public function getCaps() { $res = array(); - $public = false; - if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') { - $public = array(); + $public = array(); + $public['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes'; + if ($public['enabled']) { $public['password_enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'yes') === 'yes'); - $public['expire_date'] = false; - if ($this->config->getAppValue('core', 'shareapi_default_expire_date', 'yes') === 'yes') { - $public['expire_date'] = array(); + $public['expire_date'] = array(); + $public['expire_date']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'yes') === 'yes'; + if ($public['expire_date']['enabled']) { $public['expire_date']['days'] = $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); $public['expire_date']['enforce'] = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'yes') === 'yes'; } |