Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>tags/v23.0.0beta1
@@ -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')); | |||
} | |||
} | |||