19declare(strict_types=1);
38 public function __construct(
string $a_authmode,
int $a_server_id)
42 $this->
logger = $DIC->logger()->auth();
68 $this->extaccount = $a_ext;
93 $this->force_creation = $a_force;
98 $this->force_read_ldap_data = $a_status;
115 $this->user_data = $a_data;
135 if (!$this->
getServer()->enabledSyncOnLogin()) {
156 if (!$this->
getServer()->enabledSyncOnLogin()) {
160 if (!$this->force_creation && $this->
getServer()->isAccountMigrationEnabled()) {
174 if ($this->force_creation) {
178 $update->setUserData(
200 if (!$this->force_read_ldap_data && strpos($this->
getAuthMode(),
'ldap') === 0) {
211 $this->
logger->error(
'LDAP bind failed with message: ' . $e->getMessage());
226 throw new UnexpectedValueException(
'No external account given.');
239 if ($this->force_creation) {
262 protected function initServer(
string $a_auth_mode,
int $a_server_id): void
264 $this->authmode = $a_auth_mode;
static hasRulesForUpdate(int $a_server_id)
Check if there is ldap attribute -> user data mapping which which is updated on login.
Update/create ILIAS user account by given LDAP attributes according to user attribute mapping setting...
const MODE_INITIALIZE_ROLES
static hasRulesForUpdate()
Check if there any rule for updates.
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
Thrown in case of failed synchronisation settings.
Synchronization of user accounts used in auth container ldap, ,...
bool $force_read_ldap_data
getInternalAccount()
Get ILIAS unique internal account name.
getServer()
Get current ldap server.
setExternalAccount(string $a_ext)
Set external account (unique for each auth mode)
performUpdate()
Update user account and role assignments.
setUserData(array $a_data)
Set user data.
initServer(string $a_auth_mode, int $a_server_id)
Init LDAP server.
isUpdateRequired()
Check if an update is required.
forceReadLdapData(bool $a_status)
handleCreation()
Handle creation of user accounts.
getExternalAccount()
Get external accocunt.
forceCreation(bool $a_force)
Force cration of user accounts (Account migration enabled)
readInternalAccount()
Read internal account of user.
sync()
Synchronize user account.
getAuthMode()
Get Auth Mode.
readUserData()
Read user data.
getUserData()
Get user data.
__construct(string $a_authmode, int $a_server_id)
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static _checkExternalAuthAccount(string $a_auth, string $a_account, bool $tryFallback=true)
check whether external account and authentication method matches with a user