diff options
author | Daniel Rudolf <github.com@daniel-rudolf.de> | 2021-08-04 20:02:57 +0300 |
---|---|---|
committer | Daniel Rudolf <github.com@daniel-rudolf.de> | 2021-08-04 20:02:57 +0300 |
commit | 4d7430949a5e6f6beba18a9b309dbc9d0d0a9a42 (patch) | |
tree | 6183a4495e5c3b38fee2457595309057f2129d7e /core/Controller | |
parent | aa455e71d95c877b0dc758bc5c873d9278e6e112 (diff) |
Remove usage of \OC_Util::getDefaultPageUrl() and \OC_Util::redirectToDefaultPage()
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/RecommendedAppsController.php | 8 | ||||
-rw-r--r-- | core/Controller/SetupController.php | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/core/Controller/RecommendedAppsController.php b/core/Controller/RecommendedAppsController.php index 1b6650ed902..b38aaa31fca 100644 --- a/core/Controller/RecommendedAppsController.php +++ b/core/Controller/RecommendedAppsController.php @@ -30,15 +30,20 @@ use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\StandaloneTemplateResponse; use OCP\IInitialStateService; use OCP\IRequest; +use OCP\IURLGenerator; class RecommendedAppsController extends Controller { + /** @var IURLGenerator */ + public $urlGenerator; /** @var IInitialStateService */ private $initialStateService; public function __construct(IRequest $request, + IURLGenerator $urlGenerator, IInitialStateService $initialStateService) { parent::__construct('core', $request); + $this->urlGenerator = $urlGenerator; $this->initialStateService = $initialStateService; } @@ -47,7 +52,8 @@ class RecommendedAppsController extends Controller { * @return Response */ public function index(): Response { - $this->initialStateService->provideInitialState('core', 'defaultPageUrl', \OC_Util::getDefaultPageUrl()); + $defaultPageUrl = $this->urlGenerator->linkToDefaultPageUrl(); + $this->initialStateService->provideInitialState('core', 'defaultPageUrl', $defaultPageUrl); return new StandaloneTemplateResponse($this->appName, 'recommendedapps', [], 'guest'); } } diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index 704a2507b5a..c89709012d1 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -119,12 +119,12 @@ class SetupController { } if ($installRecommended) { - $urlGenerator = \OC::$server->getURLGenerator(); - $location = $urlGenerator->getAbsoluteURL('index.php/core/apps/recommended'); - header('Location: ' . $location); + header('Location: ' . \OC::$server->getURLGenerator()->getAbsoluteURL('index.php/core/apps/recommended')); + exit(); + } else { + header('Location: ' . \OC::$server->getURLGenerator()->linkToDefaultPageUrl()); exit(); } - \OC_Util::redirectToDefaultPage(); } public function loadAutoConfig($post) { |