ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
StaticUrlHandler.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Authentication;
22 
29 use ilLanguage;
30 
31 class StaticUrlHandler extends BaseHandler implements Handler
32 {
33  private readonly ilLanguage $language;
34 
35  public function __construct()
36  {
37  global $DIC;
38  $this->language = $DIC->language();
40  }
41 
42  public function getNamespace(): string
43  {
44  return 'auth';
45  }
46 
47  public function handle(Request $request, Context $context, Factory $response_factory): Response
48  {
49  $additional_params = implode('/', $request->getAdditionalParameters() ?? []);
50 
51  return match ($additional_params) {
52  'login' => $response_factory->can('login.php?' . http_build_query([
53  'cmd' => 'force_login',
54  'lang' => $this->language->getLangKey(),
55  ])),
56  };
57  }
58 }
$context
Definition: webdav.php:31
global $DIC
Definition: shib_login.php:26
Builds data types.
Definition: Factory.php:35
__construct(Container $dic, ilPlugin $plugin)
handle(Request $request, Context $context, Factory $response_factory)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41