mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Remove usage of \OC_Util::getDefaultPageUrl() and \OC_Util::redirectToDefaultPage()
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit is contained in:
parent
aa455e71d9
commit
4d7430949a
3 changed files with 13 additions and 9 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -1021,12 +1021,10 @@ class OC {
|
|||
OC_App::loadApps();
|
||||
OC_User::setupBackends();
|
||||
OC_Util::setupFS();
|
||||
// FIXME
|
||||
// Redirect to default application
|
||||
OC_Util::redirectToDefaultPage();
|
||||
header('Location: ' . \OC::$server->getURLGenerator()->linkToDefaultPageUrl());
|
||||
} else {
|
||||
// Not handled and not logged in
|
||||
header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute('core.login.showLoginForm'));
|
||||
header('Location: ' . \OC::$server->getURLGenerator()->linkToRouteAbsolute('core.login.showLoginForm'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue