diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-05-25 11:31:46 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-05-25 11:31:46 +0200 |
commit | dfd5a9759c591ed92d5e55c59ca98afbb35eed7d (patch) | |
tree | d780147760bfeac6e3ae56c8eae8753655489e07 | |
parent | 9c2a6fb551487dad29cd327a5f357f2ac28e8edd (diff) | |
download | nextcloud-server-dfd5a9759c591ed92d5e55c59ca98afbb35eed7d.tar.gz nextcloud-server-dfd5a9759c591ed92d5e55c59ca98afbb35eed7d.zip |
only enable compatible apps
-rw-r--r-- | lib/app.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/app.php b/lib/app.php index 04fc264d11a..658aba92904 100644 --- a/lib/app.php +++ b/lib/app.php @@ -189,8 +189,16 @@ class OC_App{ } } if($app!==false){ - OC_Appconfig::setValue( $app, 'enabled', 'yes' ); - return true; + // check if the app is compatible with this version of ownCloud + $info=OC_App::getAppInfo($app); + $version=OC_Util::getVersion(); + if(!isset($info['require']) or ($version[0]>$info['require'])){ + OC_Log::write('core','App can\'t be installed because it is not compatible with this version of ownCloud',OC_Log::ERROR); + return false; + }else{ + OC_Appconfig::setValue( $app, 'enabled', 'yes' ); + return true; + } }else{ return false; } |