ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Authentication.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS;
22 
23 class Authentication implements Component\Component
24 {
25  public function init(
26  array | \ArrayAccess &$define,
27  array | \ArrayAccess &$implement,
28  array | \ArrayAccess &$use,
29  array | \ArrayAccess &$contribute,
30  array | \ArrayAccess &$seek,
31  array | \ArrayAccess &$provide,
32  array | \ArrayAccess &$pull,
33  array | \ArrayAccess &$internal,
34  ): void {
35  // currently this is will be a session storage because we cannot store
36  // data on the client, see https://mantis.ilias.de/view.php?id=38503.
37  // @todo: this should be implemented by some proper key-value storage (or service).
38  $implement[UI\Storage::class] = static fn() =>
39  new class () implements UI\Storage {
40  public function offsetExists(mixed $offset): bool
41  {
42  return \ilSession::has($offset);
43  }
44  public function offsetGet(mixed $offset): mixed
45  {
46  return \ilSession::get($offset);
47  }
48  public function offsetSet(mixed $offset, mixed $value): void
49  {
50  if (!is_string($offset)) {
51  throw new \InvalidArgumentException('Offset needs to be of type string.');
52  }
53  \ilSession::set($offset, $value);
54  }
55  public function offsetUnset(mixed $offset): void
56  {
57  \ilSession::clear($offset);
58  }
59  };
60 
61  $contribute[\ILIAS\Setup\Agent::class] = static fn() =>
62  new \ilAuthenticationSetupAgent(
63  $pull[\ILIAS\Refinery\Factory::class]
64  );
65 
66  $contribute[Component\Resource\PublicAsset::class] = fn() =>
67  new Component\Resource\Endpoint($this, "sessioncheck.php");
68  $contribute[Component\Resource\PublicAsset::class] = fn() =>
69  new Component\Resource\ComponentJS($this, "session_reminder.js");
70  }
71 }
Interface Observer Contains several chained tasks and infos about them.
An endpoint is a PHP file that produces output via HTTP.
Definition: Endpoint.php:28
has(string $class_name)
This is a js file provided by some component.
Definition: ComponentJS.php:26
get(string $class_name)
init(array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.