-
Notifications
You must be signed in to change notification settings - Fork 0
API UserManager
Christophe SAUVEUR edited this page Sep 29, 2024
·
1 revision
final class UserManager implements Services\IAuthenticationService
User management class
Since 2.0
public function __construct(Services\IConfigService $configService, Services\IDatabaseService $databaseService, Services\ISessionService $sessionService)
Constructor
Since 2.0
Name | Type | Description |
---|---|---|
$configService |
IConfigService |
Config service instance |
$databaseService |
IDatabaseService |
Database service instance |
$sessionService |
ISessionService |
Session service instance |
public function getCurrentAuthenticatedUser(): ?User
Gets the current user reference
Since 2.0
User
public function getIdField(): string
Retrieves users management identifier field name
Since 2.0
string
Exception | Reason |
---|---|
MFXException |
If the provided value is not a string or contains invalid characters (only underscores and alphanumeric characters are accepted) |
public function getTableName(): string
Retrieves users management table name
Since 2.0
string
Exception | Reason |
---|---|
MFXException |
If the provided value is not a string or contains invalid characters (only underscores and alphanumeric characters are accepted) |
public function hasAuthenticatedUser(): bool
Tells if an authenticated user currently exists
Since 2.0
bool
public function invalidate()
Invalidates user session. Logs out the current valid user if existing
Since 2.0
public function isEnabled(): bool
Tells if user management is enabled
Since 2.0
bool
public function validateWithFields(array $fields): bool
Validates a user session using database fields
Since 2.0
Name | Type | Description |
---|---|---|
$fields |
array |
Key-value pairs for database validation |
boolean
true if the session has been validated, false either
Getting Started | Framework Reference | API Reference | MFX is released under the MIT license