after deleting users from LDAP AD in WP I have still old users

Sergei Zibarov
Sergei Zibarov used Ask the Experts™
on
Hi everyone, I added LDAP AD to WP with the help of plugin and membership plugin added the users to the site in that amount that I had on that moment.  

What if I want to check the status or what if the user will be deleted from AD (in this case would still have an access to the Wordpress sete).  How can I synchronize this processes or check the user status, delete that users automatically from WP by any plugin?

I have WPMU Ldap Authentication plugin,
Simple WordPress Membership plugin,
Active Directory Integration for Intranet sites plugin.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Commented:
You'll likely have to write some code to do this.

Because what you're asking... well... LDAP + WordPress just don't work this way.

Take LDAP. If you use LDAP for all user control, then all user data lives in LDAP, so if you change a password or delete a user via LDAP, then changes actually effect the user.

WordPress is similar. All user profile data is stored in the WordPress database.

So both LDAP + WordPress store user profile data.

To get them to sync up exactly... Likely you'll have to write some simple code which aware of exactly what you mean by each LDAP action.

Take the delete user action you describe. From the WordPress view, you will have to...

1) Take any content (pages/posts) associated with user being deleted + associate with a new user.

2) Determine if any user history, should be archived or deleted. Most of this type data lives in custom tables outside normal WordPress tables, so this will be implemented by code which understands these custom tables.

3) Payments history. Must be either archived or deleted. Also in custom tables requiring custom code.

4) Subscription management. If a user is deleted with active membership subscriptions, then some tie to the payment processor, like PayPal or Stripe or Authorize.net, must be made to shutdown all payments.

These are just a few user deletion complications you'll have to handle trying to do LDAP user deletion... as LDAP has no clue about WordPress data structures.

Suggestion: All this is very feasible. This process is best designed by someone how understands all these issues.

Note: Also keep in mind, even after you get this working. Each new plugin you install or old plugin you remove or also many plugin updates, may require large chucks of your LDAP to WordPress bridge code to be rewritten. This means you'll have to consider all plugin changes carefully, to determine how they effect your bridge code.

Author

Commented:
Thank you for explaining and navigating me. I really appreciating you for help. Have a nice day:)
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You're welcome!

Good luck!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial