diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-14 10:48:07 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-14 11:16:45 +0100 |
commit | 1a116828cf00b434c5d3f5a3948393a714899df9 (patch) | |
tree | d5820b2fd59493ac53fc6a87986864debb430669 /core/command/upgrade.php | |
parent | b92be2ef1cb59f251a6d48953f4cb8d5e0eb734f (diff) | |
download | nextcloud-server-1a116828cf00b434c5d3f5a3948393a714899df9.tar.gz nextcloud-server-1a116828cf00b434c5d3f5a3948393a714899df9.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.
Diffstat (limited to 'core/command/upgrade.php')
-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 128d27aa3db..6e5681b26df 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -27,6 +27,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; @@ -69,6 +75,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 @@ -84,4 +93,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>' + ); + } + } } |