diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-09-03 11:04:49 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-09-03 11:04:49 +0200 |
commit | 77c0adb520adcb100d2ef4fd0562330b209ee9ea (patch) | |
tree | 9bae923fa05f312c033722ad2c711cec01758ab0 /lib/private/ocsclient.php | |
parent | 50b430ee7cadd6be1520d63acdac27bc06581e09 (diff) | |
parent | fe74b397a53b8a568c15d1ccf779bc8b0425b3c5 (diff) | |
download | nextcloud-server-77c0adb520adcb100d2ef4fd0562330b209ee9ea.tar.gz nextcloud-server-77c0adb520adcb100d2ef4fd0562330b209ee9ea.zip |
Merge branch 'securityutils' of https://github.com/owncloud/core into securityutils
Diffstat (limited to 'lib/private/ocsclient.php')
-rw-r--r-- | lib/private/ocsclient.php | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php index e4cce6b2260..dc147dea0c9 100644 --- a/lib/private/ocsclient.php +++ b/lib/private/ocsclient.php @@ -29,6 +29,18 @@ class OC_OCSClient{ /** + * Returns whether the AppStore is enabled (i.e. because the AppStore is disabled for EE) + * @return bool + */ + protected static function isAppstoreEnabled() { + if(OC::$server->getConfig()->getSystemValue('appstoreenabled', true) === false OR OC_Util::getEditionString() !== '') { + return false; + } + + return true; + } + + /** * Get the url of the OCS AppStore server. * @return string of the AppStore server * @@ -36,16 +48,9 @@ class OC_OCSClient{ * to set it in the config file or it will fallback to the default */ private static function getAppStoreURL() { - if(OC_Util::getEditionString()===''){ - $default='https://api.owncloud.com/v1'; - }else{ - $default=''; - } - $url = OC_Config::getValue('appstoreurl', $default); - return($url); + return OC::$server->getConfig()->getSystemValue('appstoreurl', 'https://api.owncloud.com/v1'); } - /** * Get the content of an OCS url call. * @return string of the response @@ -64,7 +69,7 @@ class OC_OCSClient{ * This function returns a list of all the application categories on the OCS server */ public static function getCategories() { - if(OC_Config::getValue('appstoreenabled', true)==false) { + if(!self::isAppstoreEnabled()) { return null; } $url=OC_OCSClient::getAppStoreURL().'/content/categories'; @@ -100,7 +105,7 @@ class OC_OCSClient{ * @param string $filter */ public static function getApplications($categories, $page, $filter) { - if(OC_Config::getValue('appstoreenabled', true)==false) { + if(!self::isAppstoreEnabled()) { return(array()); } @@ -155,7 +160,7 @@ class OC_OCSClient{ * This function returns an applications from the OCS server */ public static function getApplication($id) { - if(OC_Config::getValue('appstoreenabled', true)==false) { + if(!self::isAppstoreEnabled()) { return null; } $url=OC_OCSClient::getAppStoreURL().'/content/data/'.urlencode($id); @@ -203,7 +208,7 @@ class OC_OCSClient{ * @param integer $item */ public static function getApplicationDownload($id, $item) { - if(OC_Config::getValue('appstoreenabled', true)==false) { + if(!self::isAppstoreEnabled()) { return null; } $url=OC_OCSClient::getAppStoreURL().'/content/download/'.urlencode($id).'/'.urlencode($item); |