5 include_once
"Services/Cron/classes/class.ilCronJob.php";
6 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
7 include_once(
'Services/LDAP/classes/class.ilLDAPQuery.php');
8 include_once(
'Services/LDAP/classes/class.ilLDAPAttributeToUser.php');
33 $lng->loadLanguageModule(
'ldap');
34 return $lng->txt(
'ldap_user_sync_cron');
41 $lng->loadLanguageModule(
"ldap");
42 return $lng->txt(
"ldap_user_sync_cron_info");
47 return self::SCHEDULE_TYPE_DAILY;
77 $this->current_server->doConnectionCheck();
78 $ilLog->write(
"LDAP: starting user synchronization for ".$this->current_server->getName());
80 $this->ldap_query =
new ilLDAPQuery($this->current_server);
83 if(is_array($users = $this->ldap_query->fetchUsers()))
91 include_once
'./Services/User/classes/class.ilUserCreationContext.php';
96 while($user_sliced = array_slice($users, $offset, $limit,
true))
98 $ilLog->write(
"LDAP: Starting update/creation of users ...");
99 $ilLog->write(
"LDAP: Offset: " . $offset);
101 $this->ldap_to_ilias->setNewUserAuthMode($this->current_server->getAuthenticationMappingKey());
102 $this->ldap_to_ilias->setUserData($user_sliced);
103 $this->ldap_to_ilias->refresh();
104 $ilLog->write(
"LDAP: Finished update/creation");
114 $ilLog->write(
"LDAP: No users for update/create. Aborting.");
119 $mess = $exc->getMessage();
120 $ilLog->write($mess);
146 include_once
'./Services/User/classes/class.ilObjUser.php';
150 if(!array_key_exists($external_account,$a_ldap_users))
152 $inactive[] = $usr_id;
158 $ilLog->write(
'LDAP: Found '.count($inactive).
' inactive users.');
164 $ilLog->write(
'LDAP: No inactive users found');
175 $a_fields[
"ldap_user_sync_cron"] = $a_is_active ?
176 $lng->txt(
"enabled") :
177 $lng->txt(
"disabled");
getDefaultScheduleValue()
static getInstance()
Get instance.
Cron job application base class.
const IL_LDAP_BIND_DEFAULT
static _getExternalAccountsByAuthMode($a_auth_mode, $a_read_auth_default=false)
Get list of external account by authentication method Note: If login == ext_account for two user with...
static _toggleActiveStatusOfUsers($a_usr_ids, $a_status)
Toggle active status of users.
addToExternalSettingsForm($a_form_id, array &$a_fields, $a_is_active)
deactivateUsers(ilLDAPServer $server, $a_ldap_users)
Deactivate users that are disabled in LDAP.
static _getCronServerIds()
Get list of acticve servers with option 'SyncCron'.
Create styles array
The data for the language used.
static ping($a_job_id)
Keep cron job alive.
getAuthenticationMappingKey()
Get authentication mapping key Default is ldap.
Update/create ILIAS user account by given LDAP attributes according to user attribute mapping setting...
Cron job result data container.