diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-11-26 18:15:10 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-04 14:14:38 +0100 |
commit | a8f2e6914d15e778889c65a4bff6441ead04ee13 (patch) | |
tree | af6a9c80381a81e7cd941fc2ec8f093566ad3010 /core/Controller | |
parent | 293585ec12b5fcfd028d5e9835cfc144b98dcaf3 (diff) | |
download | nextcloud-server-a8f2e6914d15e778889c65a4bff6441ead04ee13.tar.gz nextcloud-server-a8f2e6914d15e778889c65a4bff6441ead04ee13.zip |
Add checkbox to install recommended apps during setup
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/SetupController.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index 3dd02fc31dc..fd0a6895471 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -31,6 +31,7 @@ namespace OC\Core\Controller; use OC\Setup; use OCP\ILogger; +use function urlencode; class SetupController { /** @var Setup */ @@ -76,7 +77,7 @@ class SetupController { $options = array_merge($opts, $post, $errors); $this->display($options); } else { - $this->finishSetup(); + $this->finishSetup(isset($post['install-recommended-apps'])); } } else { $options = array_merge($opts, $post); @@ -105,7 +106,7 @@ class SetupController { \OC_Template::printGuestPage('', 'installation', $parameters); } - public function finishSetup() { + private function finishSetup(bool $installRecommended) { if( file_exists( $this->autoConfigFile )) { unlink($this->autoConfigFile); } @@ -117,6 +118,12 @@ class SetupController { } } + if ($installRecommended) { + $urlGenerator = \OC::$server->getURLGenerator(); + $location = $urlGenerator->getAbsoluteURL('/index.php/settings/apps/recommended?download&returnTo=' . urlencode(\OC_Util::getDefaultPageUrl())); + header('Location: ' . $location); + exit(); + } \OC_Util::redirectToDefaultPage(); } |