Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Adding user to LDAP when added through CMS? (Hooks/Event Handling?)


Reply


3 Posts   1040 Views

Avatar
Dave L

Community Member, 60 Posts

8 October 2009 at 2:35pm

Edited: 08/10/2009 2:36pm

I want to add a new user to LDAP when they are added in the Admin interface. This could be done using triggers but I'd rather not go down that path. Any ideas how to implement this?

Ideally I'd just listen/subscribe to Member::onBeforeWrite() :/

Avatar
Dave L

Community Member, 60 Posts

8 October 2009 at 2:55pm

Looks like I can do this by using

function onAfterWrite() {
(do stuff)
parent::onAfterWrite();
}

on my Member's DataObjectDecorator. Still need to check have access to all the data tho...

Avatar
banal

Community Member, 901 Posts

8 October 2009 at 8:20pm

Yes, that's exactly how you would do it. Alternatively you could also remove the SilverStripe Security section and directly check member credentials via LDAP. That would only be useful if you already have a way to create your users on the LDAP Server though. With this approach you would prevent duplicate users (in SilverStripe DB and LDAP) and reduce synchronization issues.