ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ilCtrlInterface;
30 use ilLanguage;
31 
32 class StaticUrlHandler extends BaseHandler implements Handler
33 {
34  private readonly ilCtrlInterface $ctrl;
35  private readonly ilLanguage $language;
36 
37  public function __construct()
38  {
39  global $DIC;
40  $this->ctrl = $DIC->ctrl();
41  $this->language = $DIC->language();
42  }
43 
44  public function getNamespace(): string
45  {
46  return 'auth';
47  }
48 
49  public function handle(Request $request, Context $context, Factory $response_factory): Response
50  {
51  $additional_params = implode('/', $request->getAdditionalParameters() ?? []);
52 
53  return match ($additional_params) {
54  'login' => $response_factory->can('login.php?' . http_build_query([
55  'cmd' => 'force_login',
56  'lang' => $this->language->getLangKey(),
57  ])),
58  };
59  }
60 }
$context
Definition: webdav.php:31
global $DIC
Definition: shib_login.php:22
Builds data types.
Definition: Factory.php:35
handle(Request $request, Context $context, Factory $response_factory)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41