Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Adding user to LDAP when added through CMS? (Hooks/Event Handling?)

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

Page: 1
Go to End
Author Topic: 986 Views
  • Dave L
    Avatar
    Community Member
    56 Posts

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

    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
    Avatar
    Community Member
    56 Posts

    Re: Adding user to LDAP when added through CMS? (Hooks/Event Handling?) Link to this post

    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...

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Adding user to LDAP when added through CMS? (Hooks/Event Handling?) Link to this post

    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.

    986 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.