summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-01-29 09:17:58 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2015-02-04 14:56:31 +0100
commit0452fde212e45645503c4bc1cd4a1c8d7f911ec5 (patch)
tree8267003a0d89afd36558417c079312b07e8a940d /apps/files_sharing
parent4801d9c02a01999aea0d637d257e57b9b2f05bc4 (diff)
downloadnextcloud-server-0452fde212e45645503c4bc1cd4a1c8d7f911ec5.tar.gz
nextcloud-server-0452fde212e45645503c4bc1cd4a1c8d7f911ec5.zip
Converted getCapabilities to non static function
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/capabilities.php31
1 files changed, 24 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php
index f6228e3ec7a..6e14a60921b 100644
--- a/apps/files_sharing/lib/capabilities.php
+++ b/apps/files_sharing/lib/capabilities.php
@@ -16,27 +16,44 @@ namespace OCA\Files_Sharing;
*/
class Capabilities {
- /**
- * @return \OC_OCS_Result
+ private $config;
+
+ /*
+ * @codeCoverageIgnore
+ */
+ public function __construct($config) {
+ $this->config = $config;
+ }
+
+ /*
+ * @codeCoverageIgnore
*/
public static function getCapabilities() {
$config = \OC::$server->getConfig();
+ $cap = new Capabilities($config);
+ return $cap->getCaps();
+ }
+
+ /**
+ * @return \OC_OCS_Result
+ */
+ public function getCaps() {
$res = array();
- if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
+ if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
$res['allow_links'] = true;
- if ($config->getAppValue('core', 'shareapi_enforce_links_password', 'yes') === 'yes') {
+ if ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'yes') === 'yes') {
$res['enforce_links_password'] = true;
}
- if ($config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes') {
+ if ($this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes') {
$res['allow_public_upload'] = true;
}
$res = array('sharing' => $res);
- }
-
+ }
+
return new \OC_OCS_Result(array(
'capabilities' => array(
'files' => $res