@@ -31,71 +31,71 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | class Capabilities implements ICapability { |
| 33 | 33 | |
| 34 | - /** @var IConfig */ |
|
| 35 | - private $config; |
|
| 34 | + /** @var IConfig */ |
|
| 35 | + private $config; |
|
| 36 | 36 | |
| 37 | - public function __construct(IConfig $config) { |
|
| 38 | - $this->config = $config; |
|
| 39 | - } |
|
| 37 | + public function __construct(IConfig $config) { |
|
| 38 | + $this->config = $config; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Return this classes capabilities |
|
| 43 | - * |
|
| 44 | - * @return array |
|
| 45 | - */ |
|
| 46 | - public function getCapabilities() { |
|
| 47 | - $res = []; |
|
| 41 | + /** |
|
| 42 | + * Return this classes capabilities |
|
| 43 | + * |
|
| 44 | + * @return array |
|
| 45 | + */ |
|
| 46 | + public function getCapabilities() { |
|
| 47 | + $res = []; |
|
| 48 | 48 | |
| 49 | - if ($this->config->getAppValue('core', 'shareapi_enabled', 'yes') !== 'yes') { |
|
| 50 | - $res['api_enabled'] = false; |
|
| 51 | - $res['public'] = ['enabled' => false]; |
|
| 52 | - $res['user'] = ['send_mail' => false]; |
|
| 53 | - $res['resharing'] = false; |
|
| 54 | - } else { |
|
| 55 | - $res['api_enabled'] = true; |
|
| 49 | + if ($this->config->getAppValue('core', 'shareapi_enabled', 'yes') !== 'yes') { |
|
| 50 | + $res['api_enabled'] = false; |
|
| 51 | + $res['public'] = ['enabled' => false]; |
|
| 52 | + $res['user'] = ['send_mail' => false]; |
|
| 53 | + $res['resharing'] = false; |
|
| 54 | + } else { |
|
| 55 | + $res['api_enabled'] = true; |
|
| 56 | 56 | |
| 57 | - $public = []; |
|
| 58 | - $public['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes'; |
|
| 59 | - if ($public['enabled']) { |
|
| 60 | - $public['password'] = []; |
|
| 61 | - $public['password']['enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'no') === 'yes'); |
|
| 57 | + $public = []; |
|
| 58 | + $public['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes'; |
|
| 59 | + if ($public['enabled']) { |
|
| 60 | + $public['password'] = []; |
|
| 61 | + $public['password']['enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'no') === 'yes'); |
|
| 62 | 62 | |
| 63 | - $public['expire_date'] = []; |
|
| 64 | - $public['expire_date']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; |
|
| 65 | - if ($public['expire_date']['enabled']) { |
|
| 66 | - $public['expire_date']['days'] = $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 67 | - $public['expire_date']['enforced'] = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes'; |
|
| 68 | - } |
|
| 63 | + $public['expire_date'] = []; |
|
| 64 | + $public['expire_date']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes'; |
|
| 65 | + if ($public['expire_date']['enabled']) { |
|
| 66 | + $public['expire_date']['days'] = $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 67 | + $public['expire_date']['enforced'] = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes'; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - $public['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') === 'yes'; |
|
| 71 | - $public['upload'] = $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes'; |
|
| 72 | - $public['upload_files_drop'] = $public['upload']; |
|
| 73 | - } |
|
| 74 | - $res["public"] = $public; |
|
| 70 | + $public['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') === 'yes'; |
|
| 71 | + $public['upload'] = $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes'; |
|
| 72 | + $public['upload_files_drop'] = $public['upload']; |
|
| 73 | + } |
|
| 74 | + $res["public"] = $public; |
|
| 75 | 75 | |
| 76 | - $res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes'; |
|
| 76 | + $res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes'; |
|
| 77 | 77 | |
| 78 | - $res['user']['send_mail'] = false; |
|
| 79 | - $res['user']['expire_date']['enabled'] = true; |
|
| 78 | + $res['user']['send_mail'] = false; |
|
| 79 | + $res['user']['expire_date']['enabled'] = true; |
|
| 80 | 80 | |
| 81 | - // deprecated in favour of 'group', but we need to keep it for now |
|
| 82 | - // in order to stay compatible with older clients |
|
| 83 | - $res['group_sharing'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes'; |
|
| 81 | + // deprecated in favour of 'group', but we need to keep it for now |
|
| 82 | + // in order to stay compatible with older clients |
|
| 83 | + $res['group_sharing'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes'; |
|
| 84 | 84 | |
| 85 | - $res['group'] = []; |
|
| 86 | - $res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes'; |
|
| 87 | - $res['group']['expire_date']['enabled'] = true; |
|
| 88 | - } |
|
| 85 | + $res['group'] = []; |
|
| 86 | + $res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes'; |
|
| 87 | + $res['group']['expire_date']['enabled'] = true; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - //Federated sharing |
|
| 91 | - $res['federation'] = [ |
|
| 92 | - 'outgoing' => $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes', |
|
| 93 | - 'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes', |
|
| 94 | - 'expire_date' => ['enabled' => true] |
|
| 95 | - ]; |
|
| 90 | + //Federated sharing |
|
| 91 | + $res['federation'] = [ |
|
| 92 | + 'outgoing' => $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes', |
|
| 93 | + 'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes', |
|
| 94 | + 'expire_date' => ['enabled' => true] |
|
| 95 | + ]; |
|
| 96 | 96 | |
| 97 | - return [ |
|
| 98 | - 'files_sharing' => $res, |
|
| 99 | - ]; |
|
| 100 | - } |
|
| 97 | + return [ |
|
| 98 | + 'files_sharing' => $res, |
|
| 99 | + ]; |
|
| 100 | + } |
|
| 101 | 101 | } |
@@ -29,17 +29,17 @@ |
||
| 29 | 29 | |
| 30 | 30 | class Application extends App { |
| 31 | 31 | |
| 32 | - public function __construct(array $urlParams = array()) { |
|
| 33 | - parent::__construct('sharebymail', $urlParams); |
|
| 32 | + public function __construct(array $urlParams = array()) { |
|
| 33 | + parent::__construct('sharebymail', $urlParams); |
|
| 34 | 34 | |
| 35 | - $settings = new Settings(); |
|
| 35 | + $settings = new Settings(); |
|
| 36 | 36 | |
| 37 | - /** register capabilities */ |
|
| 38 | - $container = $this->getContainer(); |
|
| 39 | - $container->registerCapability('OCA\ShareByMail\Capabilities'); |
|
| 37 | + /** register capabilities */ |
|
| 38 | + $container = $this->getContainer(); |
|
| 39 | + $container->registerCapability('OCA\ShareByMail\Capabilities'); |
|
| 40 | 40 | |
| 41 | - /** register hooks */ |
|
| 42 | - Util::connectHook('\OCP\Config', 'js', $settings, 'announceShareProvider'); |
|
| 43 | - } |
|
| 41 | + /** register hooks */ |
|
| 42 | + Util::connectHook('\OCP\Config', 'js', $settings, 'announceShareProvider'); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | 45 | } |
@@ -27,24 +27,24 @@ |
||
| 27 | 27 | |
| 28 | 28 | class Capabilities implements ICapability { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Function an app uses to return the capabilities |
|
| 32 | - * |
|
| 33 | - * @return array Array containing the apps capabilities |
|
| 34 | - * @since 8.2.0 |
|
| 35 | - */ |
|
| 36 | - public function getCapabilities() { |
|
| 37 | - return [ |
|
| 38 | - 'files_sharing' => |
|
| 39 | - [ |
|
| 40 | - 'sharebymail' => |
|
| 41 | - [ |
|
| 42 | - 'enabled' => true, |
|
| 43 | - 'upload_files_drop' => ['enabled' => true], |
|
| 44 | - 'password' => ['enabled' => true], |
|
| 45 | - 'expire_date' => ['enabled' => true] |
|
| 46 | - ] |
|
| 47 | - ] |
|
| 48 | - ]; |
|
| 49 | - } |
|
| 30 | + /** |
|
| 31 | + * Function an app uses to return the capabilities |
|
| 32 | + * |
|
| 33 | + * @return array Array containing the apps capabilities |
|
| 34 | + * @since 8.2.0 |
|
| 35 | + */ |
|
| 36 | + public function getCapabilities() { |
|
| 37 | + return [ |
|
| 38 | + 'files_sharing' => |
|
| 39 | + [ |
|
| 40 | + 'sharebymail' => |
|
| 41 | + [ |
|
| 42 | + 'enabled' => true, |
|
| 43 | + 'upload_files_drop' => ['enabled' => true], |
|
| 44 | + 'password' => ['enabled' => true], |
|
| 45 | + 'expire_date' => ['enabled' => true] |
|
| 46 | + ] |
|
| 47 | + ] |
|
| 48 | + ]; |
|
| 49 | + } |
|
| 50 | 50 | } |