}
}
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' );
}
}
}
+
+ // 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 );
+ }
+
+
+
+ }
+
+
+
}
/**
if(active){
$.post(OC.filePath('settings','ajax','disableapp.php'),{appid:app},function(result){
if(!result || result.status!='success'){
- OC.dialogs.alert('Error','Error while disabling app');
+ OC.dialogs.alert('Error while disabling app','Error');
}
else {
element.data('active',false);
}else{
$.post(OC.filePath('settings','ajax','enableapp.php'),{appid:app},function(result){
if(!result || result.status!='success'){
- OC.dialogs.alert('Error','Error while enabling app');
+ OC.dialogs.alert('Error while enabling app','Error');
}
else {
element.data('active',true);