Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-02-17 14:00:39 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-02-26 01:07:40 +0300
commit06742fe24becb1a67e1e94407ee92f7a65958816 (patch)
tree11497f55cbb034d9225eb97b6162f1a089ee774c /core
parentbc1418156339d4e61fe81bd1474f91555432ca00 (diff)
3rd-party apps are disabled on upgrade - refs #14026
Conflicts: lib/private/app.php
Diffstat (limited to 'core')
-rw-r--r--core/ajax/update.php26
-rw-r--r--core/command/upgrade.php10
-rw-r--r--core/js/update.js3
3 files changed, 28 insertions, 11 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();
}
diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index 6e5ac1c5c9a..9f938cdf6d1 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -84,7 +84,8 @@ class Upgrade extends Command {
if(\OC::checkUpgrade(false)) {
$self = $this;
- $updater = new Updater(\OC::$server->getHTTPHelper(), \OC::$server->getAppConfig());
+ $updater = new Updater(\OC::$server->getHTTPHelper(),
+ \OC::$server->getConfig());
$updater->setSimulateStepEnabled($simulateStepEnabled);
$updater->setUpdateStepEnabled($updateStepEnabled);
@@ -106,8 +107,11 @@ class Upgrade extends Command {
$updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($output) {
$output->writeln('<info>Checked database schema update</info>');
});
- $updater->listen('\OC\Updater', 'disabledApps', function ($appList) use($output) {
- $output->writeln('<info>Disabled incompatible apps: ' . implode(', ', $appList) . '</info>');
+ $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) {
+ $output->writeln('<info>Disabled incompatible app: ' . $app . '</info>');
+ });
+ $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use($output) {
+ $output->writeln('<info>Disabled 3rd-party app: ' . $app . '</info>');
});
$updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) {
diff --git a/core/js/update.js b/core/js/update.js
index f63808f65be..60f04832935 100644
--- a/core/js/update.js
+++ b/core/js/update.js
@@ -38,6 +38,9 @@
updateEventSource.listen('success', function(message) {
$('<span>').append(message).append('<br />').appendTo($el);
});
+ updateEventSource.listen('notice', function(message) {
+ $('<span>').addClass('error').append(message).append('<br />').appendTo($el);
+ });
updateEventSource.listen('error', function(message) {
$('<span>').addClass('error').append(message).append('<br />').appendTo($el);
message = t('core', 'Please reload the page.');