Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In order to filter LDAP entries by some date attribute (e.g.: accountExpires, lastLogon, pwdLastSet etc.) one may need to use the current date. Such a dynamic value may be nicely set with Token API.
In particular this functionality would become handy during the LDAP synchronization process in order, for instance, to block expired accounts.
Comment | File | Size | Author |
---|---|---|---|
#1 | ldap_integration-ldapsync_token_integration-2427365.patch | 2.79 KB | encelado |
Comments
Comment #1
encelado CreditAttribution: encelado commentedThis patch allows to set in the ldapsync module configuration an LDAP query like:
(&(objectClass=person)(|(accountExpires=0)(accountExpires>=[current-date])))
The
[current-date]
token will be replaced at runtime with the current timestamp in the proper format. In the shown case, the resulting filter will retrieve all persons whose account is currently active.