diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-17 12:00:39 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-25 23:07:40 +0100 |
commit | 06742fe24becb1a67e1e94407ee92f7a65958816 (patch) | |
tree | 11497f55cbb034d9225eb97b6162f1a089ee774c /core/ajax | |
parent | bc1418156339d4e61fe81bd1474f91555432ca00 (diff) | |
download | nextcloud-server-06742fe24becb1a67e1e94407ee92f7a65958816.tar.gz nextcloud-server-06742fe24becb1a67e1e94407ee92f7a65958816.zip |
3rd-party apps are disabled on upgrade - refs #14026
Conflicts:
lib/private/app.php
Diffstat (limited to 'core/ajax')
-rw-r--r-- | core/ajax/update.php | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/core/ajax/update.php b/core/ajax/update.php index 5a9288a6381..b2ca0e3c8ec 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -11,9 +11,12 @@ if (OC::checkUpgrade(false)) { $eventSource = \OC::$server->createEventSource(); $updater = new \OC\Updater( \OC::$server->getHTTPHelper(), - \OC::$server->getAppConfig(), + \OC::$server->getConfig(), \OC_Log::$object ); + $incompatibleApps = []; + $disabledThirdPartyApps = []; + $updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource, $l) { $eventSource->send('success', (string)$l->t('Turned on maintenance mode')); }); @@ -32,13 +35,11 @@ if (OC::checkUpgrade(false)) { $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) { $eventSource->send('success', (string)$l->t('Updated "%s" to %s', array($app, $version))); }); - $updater->listen('\OC\Updater', 'disabledApps', function ($appList) use ($eventSource, $l) { - $list = array(); - foreach ($appList as $appId) { - $info = OC_App::getAppInfo($appId); - $list[] = $info['name'] . ' (' . $info['id'] . ')'; - } - $eventSource->send('success', (string)$l->t('Disabled incompatible apps: %s', implode(', ', $list))); + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) { + $incompatibleApps[]= $app; + }); + $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use (&$disabledThirdPartyApps) { + $disabledThirdPartyApps[]= $app; }); $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource) { $eventSource->send('failure', $message); @@ -48,6 +49,15 @@ if (OC::checkUpgrade(false)) { $updater->upgrade(); + if (!empty($incompatibleApps)) { + $eventSource->send('notice', + (string)$l->t('Following incompatible apps have been disabled: %s', implode(', ', $incompatibleApps))); + } + if (!empty($disabledThirdPartyApps)) { + $eventSource->send('notice', + (string)$l->t('Following 3rd party apps have been disabled: %s', implode(', ', $disabledThirdPartyApps))); + } + $eventSource->send('done', ''); $eventSource->close(); } |