Skip to content

Commit

Permalink
Test: Fix Redirect to Login on Static
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Jan 13, 2025
1 parent 019b1c7 commit 2859210
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/ILIAS/Test/src/StaticURLHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function handle(
$additional_params = $request->getAdditionalParameters();
$context->ctrl()->setParameterByClass(\ilObjTestGUI::class, 'ref_id', $ref_id);

if (!$context->checkPermission('read', $ref_id) && !$context->isUserLoggedIn()) {
return $response_factory->can("login.php?target=tst_{$ref_id}&cmd=force_login");
}

$uri = match ($additional_params[0] ?? 'default') {
self::QUESTION_OPERATIONS => $this->buildQuestionURL($additional_params[1], $context->ctrl()),
default => $context->ctrl()->getLinkTargetByClass([\ilRepositoryGUI::class, \ilObjTestGUI::class]),
Expand Down

0 comments on commit 2859210

Please sign in to comment.