\LDAPMemberExtension
Class LDAPMemberExtension.
Adds mappings from AD attributes to SilverStripe fields.
Synopsis
class LDAPMemberExtension
extends DataExtension
{
- // members
- private static array $db = ;
- private static array $ldap_field_mappings = ;
- private static string $ldap_thumbnail_path = 'Uploads';
- private static bool $update_ldap_from_local = false;
- private static bool $create_users_in_ldap = false;
- private static bool $delete_users_in_ldap = false;
- // methods
- public void updateCMSFields()
- public void validate()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void onAfterDelete()
- public void writeWithoutSync()
- public void sync()
- public void memberLoggedIn()
Hierarchy
Extends
- DataExtension
Members
private
- $create_users_in_ldap
—
bool
If enabled, Member records with a Username field have the user created in LDAP on write. - $db — array
- $delete_users_in_ldap
—
bool
If enabled, deleting Member records mapped to LDAP deletes the LDAP user. - $ldap_field_mappings
—
array
These fields are used by {@link LDAPMemberSync} to map specific AD attributes to {@link Member} fields. - $ldap_thumbnail_path
—
string
The location (relative to /assets) where to save thumbnailphoto data. - $update_ldap_from_local
—
bool
When enabled, LDAP managed Member records (GUID flag) have their data written back to LDAP on write, and synchronise membership to groups mapped to LDAP.
Methods
public
- memberLoggedIn() — Triggered by {@link Member::logIn()} when successfully logged in, this will update the Member record from AD data.
- onAfterDelete()
- onAfterWrite()
- onBeforeWrite() — Create the user in LDAP, provided this configuration is enabled and a username was passed to a new Member record.
- sync() — Update the local data with LDAP, and ensure local membership is also set in LDAP too. This writes into LDAP, provided that feature is enabled.
- updateCMSFields()
- validate()
- writeWithoutSync() — Write DataObject without triggering this extension's hooks.