]> source.dussan.org Git - nextcloud-server.git/commitdiff
only enable compatible apps
authorFrank Karlitschek <frank@owncloud.org>
Fri, 25 May 2012 09:31:46 +0000 (11:31 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Fri, 25 May 2012 09:31:46 +0000 (11:31 +0200)
lib/app.php

index 04fc264d11a89e7d9f4d1b88b6e5dd75e7d4a455..658aba929042dc964f399685007a5b6c709f9518 100644 (file)
@@ -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;
                }