/** * Deactivate users that are disabled in LDAP * * @access private * */ private function deactivateUsers(ilLDAPServer $server, $a_ldap_users) { include_once './Services/User/classes/class.ilObjUser.php'; foreach ($ext = ilObjUser::_getExternalAccountsByAuthMode($server->getAuthenticationMappingKey(), true) as $usr_id => $external_account) { if (!array_key_exists($external_account, $a_ldap_users)) { $inactive[] = $usr_id; } } if (count($inactive)) { ilObjUser::_toggleActiveStatusOfUsers($inactive, false); $this->log->write('LDAP: Found ' . count($inactive) . ' inactive users.'); } else { $this->log->write('LDAP: No inactive users found'); } }