diff --git a/appinfo/routes.php b/appinfo/routes.php index 53d6cedc0..363d2f816 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -21,7 +21,6 @@ return [ 'routes' => [ - ['name' => 'Wizard#show', 'url' => '/wizard', 'verb' => 'GET'], ['name' => 'Wizard#disable', 'url' => '/wizard', 'verb' => 'DELETE'], ], ]; diff --git a/lib/Controller/WizardController.php b/lib/Controller/WizardController.php index 42797b3be..1afac5800 100644 --- a/lib/Controller/WizardController.php +++ b/lib/Controller/WizardController.php @@ -21,48 +21,26 @@ namespace OCA\FirstRunWizard\Controller; -use OCA\FirstRunWizard\AppInfo\Application; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; -use OCP\AppFramework\Http\JSONResponse; -use OCP\Defaults; use OCP\IConfig; -use OCP\IGroupManager; use OCP\IRequest; class WizardController extends Controller { - /** @var IConfig */ - protected $config; - - /** @var string */ - protected $userId; - - /** @var Defaults */ - protected $theming; - - /** @var IGroupManager */ - protected $groupManager; - - /** @var array|false|string[] */ - protected $slides = []; - /** * @param string $appName * @param IRequest $request * @param IConfig $config * @param string $userId - * @param Defaults $theming */ - public function __construct($appName, IRequest $request, IConfig $config, $userId, Defaults $theming, IGroupManager $groupManager) { + public function __construct( + $appName, + IRequest $request, + private IConfig $config, + private string $userId, + ) { parent::__construct($appName, $request); - - $this->config = $config; - $this->userId = $userId; - $this->theming = $theming; - $this->groupManager = $groupManager; - - $this->slides = explode(',', $this->config->getAppValue(Application::APP_ID, 'slides', 'video,values,apps,clients,final')); } /** @@ -73,55 +51,4 @@ public function disable() { $this->config->setUserValue($this->userId, 'firstrunwizard', 'show', 0); return new DataResponse(); } - - /** - * @NoAdminRequired - * @return JsonResponse - */ - public function show() { - $appStore = $this->config->getSystemValue('appstoreenabled', true); - - $data = [ - 'desktop' => $this->config->getSystemValue('customclient_desktop', $this->theming->getSyncClientUrl()), - 'android' => $this->config->getSystemValue('customclient_android', $this->theming->getAndroidClientUrl()), - 'fdroid' => $this->config->getSystemValue('customclient_fdroid', $this->theming->getFDroidClientUrl()), - 'ios' => $this->config->getSystemValue('customclient_ios', $this->theming->getiOSClientUrl()), - 'appStore' => $appStore, - 'useTLS' => $this->request->getServerProtocol() === 'https', - 'macOSProfile' => \OCP\Util::linkToRemote('dav') . 'provisioning/apple-provisioning.mobileconfig', - ]; - - $slides = []; - - $slides[] = $this->staticSlide('page.values', $data); - if ($appStore && $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([ - 'hasVideo' => in_array('video', $this->slides, true), - 'slides' => array_values(array_filter($slides, function ($slide) { - return $slide !== null; - })) - ]); - } - - public function staticSlide($name, $params) { - if (!in_array(substr($name, 5), $this->slides, true)) { - return null; - } - - $template = new \OCP\Template($this->appName, $name, false); - - foreach ($params as $key => $value) { - $template->assign($key, $value); - } - - return [ - 'type' => 'inline', - 'content' => $template->fetchPage($params) - ]; - } } diff --git a/templates/personal-settings.php b/templates/personal-settings.php index 9d29a4343..c41753c7b 100644 --- a/templates/personal-settings.php +++ b/templates/personal-settings.php @@ -58,7 +58,7 @@

t('Set up sync clients using an app password. That way you can make sure you are able to revoke access in case you lose that device.', [$appPasswordUrl])); ?>

-

t('Connect other apps to %s', array($theme->getName()))); ?>

+

t('Connect other apps to %s', [$theme->getName()])); ?>

t('Besides the mobile apps and desktop client you can connect any other software that supports the WebDAV/CalDAV/CardDAV protocols to %s.', [$theme->getName()])); ?>

diff --git a/tests/AppInfo/RoutesTest.php b/tests/AppInfo/RoutesTest.php index f2c9a8bf8..6abdce6d8 100644 --- a/tests/AppInfo/RoutesTest.php +++ b/tests/AppInfo/RoutesTest.php @@ -38,7 +38,6 @@ public function testRoutes() { $this->assertArrayHasKey('routes', $routes); $this->assertIsArray($routes['routes']); $this->assertSame([ - ['name' => 'Wizard#show', 'url' => '/wizard', 'verb' => 'GET'], ['name' => 'Wizard#disable', 'url' => '/wizard', 'verb' => 'DELETE'], ], $routes['routes']); } diff --git a/tests/Controller/WizardControllerTest.php b/tests/Controller/WizardControllerTest.php index 433baaf25..5ab9ac9af 100644 --- a/tests/Controller/WizardControllerTest.php +++ b/tests/Controller/WizardControllerTest.php @@ -27,7 +27,6 @@ use OCA\FirstRunWizard\Controller\WizardController; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; -use OCP\Defaults; use OCP\IConfig; use OCP\IGroupManager; use OCP\IRequest; @@ -60,8 +59,6 @@ protected function getController($user = 'test') { $this->createMock(IRequest::class), $this->config, $user, - \OC::$server->query(Defaults::class), - $this->groupManager ); }