diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-02-06 10:33:08 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-02-06 10:33:08 +0100 |
commit | d4e361db44e50787d5f660d5947aeeef82c38bf4 (patch) | |
tree | 239a17b750f13177a9ffa8850a0d4d2ccebf62af /apps | |
parent | bcae79a85a5cc266c0874e8894b383309dd46388 (diff) | |
download | nextcloud-server-d4e361db44e50787d5f660d5947aeeef82c38bf4.tar.gz nextcloud-server-d4e361db44e50787d5f660d5947aeeef82c38bf4.zip |
Updated sharing capabilities
Moved to files_sharing
Added more capabilities.
Tried to order to capabilities more OO style
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/capabilities.php | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php index 6e14a60921b..50db775e3ed 100644 --- a/apps/files_sharing/lib/capabilities.php +++ b/apps/files_sharing/lib/capabilities.php @@ -40,23 +40,29 @@ class Capabilities { */ public function getCaps() { $res = array(); - if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') { - $res['allow_links'] = true; - if ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'yes') === 'yes') { - $res['enforce_links_password'] = true; - } + $public = array(); + if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') { + $public['password_enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'yes') === 'yes'); - if ($this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes') { - $res['allow_public_upload'] = true; + $public['expire_date'] = array(); + if ($this->config->getAppValue('core', 'shareapi_default_expire_date', 'yes') === 'yes') { + $public['expire_date']['days'] = $this->config->getAppValue('core', 'shareapi_expire_after_n_days', false); + $public['expire_date']['enforce'] = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'yes') === 'yes'; } - $res = array('sharing' => $res); + $public['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'yes') === 'yes'; } + $res["public"] = $public; + + $res['user']['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_mail_notification', 'yes') === 'yes'; + + $res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes'; + return new \OC_OCS_Result(array( 'capabilities' => array( - 'files' => $res + 'files_sharing' => $res ), )); } |