diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-17 14:21:00 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-17 14:27:19 +0100 |
commit | 58db31e61e2987390e879fd1a2e31cad8563af76 (patch) | |
tree | 9b95f5329e04400f61716707ecb454d3bc119bb1 /core | |
parent | 30cca2524f26c030ba96c9c673e41fcedf8579a8 (diff) | |
download | nextcloud-server-58db31e61e2987390e879fd1a2e31cad8563af76.tar.gz nextcloud-server-58db31e61e2987390e879fd1a2e31cad8563af76.zip |
Added warning for trusted_domains after CLI upgrade
If trusted_domains is not set after a CLI upgrade, show a warning in the
output.
Backport of 1a11682 from master
Diffstat (limited to 'core')
-rw-r--r-- | core/command/upgrade.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/command/upgrade.php b/core/command/upgrade.php index 1d105b67a06..65d3e0bafa9 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -29,6 +29,12 @@ class Upgrade extends Command { ; } + /** + * Execute the upgrade command + * + * @param InputInterface $input input interface + * @param OutputInterface $output output interface + */ protected function execute(InputInterface $input, OutputInterface $output) { global $RUNTIME_NOAPPS; @@ -71,6 +77,9 @@ class Upgrade extends Command { }); $updater->upgrade(); + + $this->postUpgradeCheck($input, $output); + return self::ERROR_SUCCESS; } else if(\OC_Config::getValue('maintenance', false)) { //Possible scenario: ownCloud core is updated but an app failed @@ -86,4 +95,21 @@ class Upgrade extends Command { return self::ERROR_UP_TO_DATE; } } + + /** + * Perform a post upgrade check (specific to the command line tool) + * + * @param InputInterface $input input interface + * @param OutputInterface $output output interface + */ + protected function postUpgradeCheck(InputInterface $input, OutputInterface $output) { + $trustedDomains = \OC_Config::getValue('trusted_domains', array()); + if (empty($trustedDomains)) { + $output->write( + '<warning>The setting "trusted_domains" could not be ' . + 'set automatically by the upgrade script, ' . + 'please set it manually</warning>' + ); + } + } } |