ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
SessionAuthenticatedUser.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Authentication\Infrastructure
;
22
23
use
ILIAS\Authentication\Domain\AuthenticatedUser
;
24
use
ILIAS\Data\Result
;
25
use
ILIAS\Data\Result\Error
;
26
use
ILIAS\Data\Result\Ok
;
27
31
final
readonly
class
SessionAuthenticatedUser
implements
AuthenticatedUser
32
{
33
public
function
__construct
(
private
\
ilAuthSession
$auth_session)
34
{
35
}
36
37
public
function
id
():
Result
38
{
39
if
($this->auth_session->isFullyAuthenticated()) {
40
return
new
Ok
($this->auth_session->getUserId());
41
}
42
43
if
($this->auth_session->isAnonymouslyAuthenticated()) {
44
return
new
Error
(
'Anonymous session actor is not an authenticated user.'
);
45
}
46
47
return
new
Error
(
'No authenticated user in session.'
);
48
}
49
}
ILIAS\Authentication\Infrastructure\SessionAuthenticatedUser
Answers the query from the legacy session authentication.
Definition:
SessionAuthenticatedUser.php:32
ILIAS\Authentication\Infrastructure\SessionAuthenticatedUser\id
id()
Definition:
SessionAuthenticatedUser.php:37
ILIAS\Authentication\Infrastructure\SessionAuthenticatedUser\__construct
__construct(private \ilAuthSession $auth_session)
Definition:
SessionAuthenticatedUser.php:33
ILIAS\Data\Result\Ok
A result encapsulates a value or an error and simplifies the handling of those.
Definition:
Ok.php:31
ilAuthSession
Definition:
class.ilAuthSession.php:25
ILIAS\Authentication\Domain\AuthenticatedUser
Query port for a fully authenticated ILIAS user in the current request.
Definition:
AuthenticatedUser.php:32
ILIAS\Data\Result
A result encapsulates a value or an error and simplifies the handling of those.
Definition:
Result.php:29
ILIAS\Authentication\Infrastructure
Definition:
CookieSessionId.php:21
ILIAS\Data\Result
Definition:
Error.php:21
ILIAS\MetaData\OERExposer\OAIPMH\Responses\Error
Error
Definition:
Error.php:24
components
ILIAS
Authentication
src
Infrastructure
SessionAuthenticatedUser.php
Generated on Wed Nov 11 2026 23:05:36 for ILIAS by
1.9.4 (using
Doxyfile
)