From 58db31e61e2987390e879fd1a2e31cad8563af76 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 17 Mar 2014 14:21:00 +0100 Subject: 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 --- core/command/upgrade.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core') 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( + 'The setting "trusted_domains" could not be ' . + 'set automatically by the upgrade script, ' . + 'please set it manually' + ); + } + } } -- cgit v1.2.3