diff options
author | Frank Karlitschek <karlitschek@kde.org> | 2012-01-06 19:08:35 +0100 |
---|---|---|
committer | Frank Karlitschek <karlitschek@kde.org> | 2012-01-06 19:08:35 +0100 |
commit | d485a70e7df602e85506ad94103df00f8bb3f765 (patch) | |
tree | bc8280f82e08b792d885416ab8e9725d69adf276 /lib/app.php | |
parent | f9db4249a3a7b73f6c712cfa32b029e6d09595f5 (diff) | |
download | nextcloud-server-d485a70e7df602e85506ad94103df00f8bb3f765.tar.gz nextcloud-server-d485a70e7df602e85506ad94103df00f8bb3f765.zip |
finish the application store feature so that users can download and install ownCloud apps from our website. there is still a small problem with write permissions. will look into this later
Diffstat (limited to 'lib/app.php')
-rw-r--r-- | lib/app.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/app.php b/lib/app.php index b1aa8ba354d..1873e1136cd 100644 --- a/lib/app.php +++ b/lib/app.php @@ -94,7 +94,15 @@ class OC_App{ */ public static function enable( $app ){ if(!OC_Installer::isInstalled($app)){ - OC_Installer::installShippedApp($app); + // check if app is a shipped app or not. OCS apps have an integer as id, shipped apps use a string + if(!is_numeric($app)){ + OC_Installer::installShippedApp($app); + }else{ + $download=OC_OCSClient::getApplicationDownload($app,1); + if(isset($download['downloadlink']) and $download['downloadlink']<>'') { + OC_Installer::installApp(array('source'=>'http','href'=>$download['downloadlink'])); + } + } } OC_Appconfig::setValue( $app, 'enabled', 'yes' ); } @@ -107,6 +115,7 @@ class OC_App{ * This function set an app as disabled in appconfig. */ public static function disable( $app ){ + // check if app is a shiped app or not. if not delete OC_Appconfig::setValue( $app, 'enabled', 'no' ); } |