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

github.com/nextcloud/firstrunwizard.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-03-25 17:23:29 +0300
committerJulius Härtl <jus@bitgrid.net>2019-03-25 17:23:29 +0300
commitf6f1538851b9537fdd728e05449bff58584111c9 (patch)
treecd359ff6ffe6e281da0678f90d4133d4498a485a /lib
parent18d22c2c6c734ff0bd8c8ec2570c92176567dc91 (diff)
Only load apps page for admins
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/WizardController.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/Controller/WizardController.php b/lib/Controller/WizardController.php
index d232e8bf..2213bb49 100644
--- a/lib/Controller/WizardController.php
+++ b/lib/Controller/WizardController.php
@@ -25,9 +25,9 @@ namespace OCA\FirstRunWizard\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\JSONResponse;
-use OCP\AppFramework\Http\TemplateResponse;
use OCP\Defaults;
use OCP\IConfig;
+use OCP\IGroupManager;
use OCP\IRequest;
class WizardController extends Controller {
@@ -41,6 +41,9 @@ class WizardController extends Controller {
/** @var Defaults */
protected $theming;
+ /** @var IGroupManager */
+ protected $groupManager;
+
/**
* @param string $appName
* @param IRequest $request
@@ -48,12 +51,13 @@ class WizardController extends Controller {
* @param string $userId
* @param Defaults $theming
*/
- public function __construct($appName, IRequest $request, IConfig $config, $userId, Defaults $theming) {
+ public function __construct($appName, IRequest $request, IConfig $config, $userId, Defaults $theming, IGroupManager $groupManager) {
parent::__construct($appName, $request);
$this->config = $config;
$this->userId = $userId;
$this->theming = $theming;
+ $this->groupManager = $groupManager;
}
/**
@@ -81,11 +85,14 @@ class WizardController extends Controller {
$slides = [
$this->staticSlide('page.intro', $data),
- $this->staticSlide('page.values', $data),
- $this->staticSlide('page.apps', $data),
- $this->staticSlide('page.clients', $data),
- $this->staticSlide('page.final', $data)
+ $this->staticSlide('page.values', $data)
];
+ if ($this->groupManager->isAdmin($this->userId)) {
+ $slides[] = $this->staticSlide('page.apps', $data);
+ }
+ $slides[] = $this->staticSlide('page.clients', $data);
+ $slides[] = $this->staticSlide('page.final', $data);
+
return new JSONResponse($slides);
}