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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1410 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
bummzack

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.