]> source.dussan.org Git - nextcloud-server.git/commitdiff
Updated sharing capabilities
authorRoeland Jago Douma <roeland@famdouma.nl>
Fri, 6 Feb 2015 09:33:08 +0000 (10:33 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Fri, 6 Feb 2015 09:33:08 +0000 (10:33 +0100)
Moved to files_sharing
Added more capabilities.
Tried to order to capabilities more OO style

apps/files_sharing/lib/capabilities.php

index 6e14a60921bfbc3f128ff8b718246cc696c195ac..50db775e3ed7e8d9f27638b921bb588efcefeb27 100644 (file)
@@ -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
                                ),
                        ));
        }