Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-11-26 20:15:10 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2019-12-04 16:14:38 +0300
commita8f2e6914d15e778889c65a4bff6441ead04ee13 (patch)
treeaf6a9c80381a81e7cd941fc2ec8f093566ad3010 /core/Controller
parent293585ec12b5fcfd028d5e9835cfc144b98dcaf3 (diff)
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.php11
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();
}