Avoid fetch ocs info if the appstore is disabled

This commit is contained in:
Brice Maron 2012-06-22 16:06:46 +02:00
parent 06e20fe4b8
commit 2d2366bb57
1 changed files with 29 additions and 20 deletions

View File

@ -57,6 +57,9 @@ 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){
return NULL;
}
$url=OC_OCSClient::getAppStoreURL().'/content/categories';
$xml=@file_get_contents($url);
@ -130,6 +133,9 @@ class OC_OCSClient{
* This function returns an applications from the OCS server
*/
public static function getApplication($id){
if(OC_Config::getValue('appstoreenabled', true)==false){
return NULL;
}
$url=OC_OCSClient::getAppStoreURL().'/content/data/'.urlencode($id);
$xml=@file_get_contents($url);
@ -164,6 +170,9 @@ class OC_OCSClient{
* This function returns an download url for an applications from the OCS server
*/
public static function getApplicationDownload($id,$item){
if(OC_Config::getValue('appstoreenabled', true)==false){
return NULL;
}
$url=OC_OCSClient::getAppStoreURL().'/content/download/'.urlencode($id).'/'.urlencode($item);
$xml=@file_get_contents($url);