59 $http = $this->context->http();
61 $request = $this->request_builder->buildRequest(
63 $this->context->refinery(),
66 if (!$request instanceof
Request) {
67 throw new \RuntimeException(
'No request could be built');
70 $handler = $this->handlers[$request->getNamespace()] ??
null;
72 throw new \InvalidArgumentException(
'No handler found for namespace ' . $request->getNamespace());
75 if (!$response->targetCanBeReached()) {
76 throw new \RuntimeException(
77 'Handler ' .
$handler->getNamespace() .
' did not return a URI' 81 $uri_builder =
new StandardURIBuilder(ILIAS_HTTP_PATH,
false);
84 case $response instanceof MaybeCanHandlerAfterLogin:
85 $target = $uri_builder->buildTarget(
86 $request->getNamespace(),
87 $request->getReferenceId(),
88 $request->getAdditionalParameters()
90 $full_uri = $base_uri .
"/login.php?target=";
91 $full_uri .= str_replace(
'/',
'_', rtrim($target,
'/'));
92 if (!$this->context->isUserLoggedIn()) {
93 $full_uri .=
'&cmd=force_login&lang=' . $this->context->getUserLanguage();
97 case $response instanceof CannotReach:
98 $this->context->mainTemplate()->setOnScreenMessage(
100 $this->context->lng()->txt(
'permission_denied'),
103 $full_uri = $base_uri .
'/index.php';
107 $uri_path = $response->getURIPath() ??
'';
108 $base_path = $base_uri->getPath() ??
'';
109 if ($base_path !==
'' && $base_path !==
'/') {
110 $uri_path = str_replace(rtrim($base_path,
'/') .
'/',
'', $uri_path);
112 $full_uri = $base_uri .
'/' . trim((
string) $uri_path,
'/');
117 $http->response()->withAddedHeader(
'Location', $full_uri)
119 $http->sendResponse();
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
appendUnknownParameters(Context $context, string $full_uri)