summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-26 20:37:10 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-26 20:37:10 +0200
commit982cde0bb1a9230b793f7341eba5d8117c48ca0b (patch)
treec19b364087bf00a6f91ba372d17ece48b42faa99 /lib
parenta945fa10a639cdee9e5e712cd48e8c911a8d9821 (diff)
downloadnextcloud-server-982cde0bb1a9230b793f7341eba5d8117c48ca0b.tar.gz
nextcloud-server-982cde0bb1a9230b793f7341eba5d8117c48ca0b.zip
check during ownCloud upgrade if all the installed apps are compatible with the new ownCloud version. Disable them if not
Diffstat (limited to 'lib')
-rwxr-xr-x[-rw-r--r--]lib/app.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/app.php b/lib/app.php
index c639d2c4a5b..78de0fa21b6 100644..100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -189,11 +189,11 @@ class OC_App{
}
}
if($app!==false){
- // check if the app is compatible with this version of ownCloud
+ // 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);
+ OC_Log::write('core','App "'.$info['name'].'" 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' );
@@ -525,6 +525,26 @@ class OC_App{
}
}
}
+
+ // check if the current enabled apps are compatible with the current ownCloud version. disable them if not.
+ // this is important if you upgrade ownCloud and have non ported 3rd party apps installed
+ $apps =OC_App::getEnabledApps();
+ $version=OC_Util::getVersion();
+ foreach($apps as $app) {
+
+ // check if the app is compatible with this version of ownCloud
+ $info=OC_App::getAppInfo($app);
+ if(!isset($info['require']) or ($version[0]>$info['require'])){
+ OC_Log::write('core','App "'.$info['name'].'" can\'t be used because it is not compatible with this version of ownCloud',OC_Log::ERROR);
+ OC_App::disable( $app );
+ }
+
+
+
+ }
+
+
+
}
/**