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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

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

Go to End

3 Posts   1331 Views

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() :/

Dave L

Community Member, 60 Posts

8 October 2009 at 2:55pm

Looks like I can do this by using

function onAfterWrite() {
(do stuff)

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


Community Member, 904 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.