From a8f2e6914d15e778889c65a4bff6441ead04ee13 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 26 Nov 2019 18:15:10 +0100 Subject: Add checkbox to install recommended apps during setup Signed-off-by: Christoph Wurst Signed-off-by: npmbuildbot[bot] --- core/Controller/SetupController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core/Controller') 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(); } -- cgit v1.2.3