TransWikia.com

How to integrate external user tables with WP?

WordPress Development Asked by STing on January 18, 2021

I have about 10K+ users that I get from a company feed (LDAP). I can authenticate WP via SSO based on someone’s username matching on the WP user table. I would like to take the user table I have and combine it with the wp-user table so that I can set permissions, change display name and things like that. Is there a best way to do this?

Also we have about 15 WP installs and will probably have 30 by mid next year. How can I manage these users in one table given that some may have admin rights on one site yet not admin rights on another site?

One Answer

This seems pretty tricky and it depends very much on your needs. You could either alter the WP database on each install or make 1 3rd party database along with a script that registers them on the WP install and sets their permissions. The 2nd solutions seems better for me.

Create a database where you add each user with a row for each WP install where you specify their permissions.

Let's say you have the following permissions: subscriber, contributor, author, editor, admin. Make a database for each user and set their permission. Make a 3rd party script which registers them to the WP installs and sets their permissions. When you change a permission, query the WP installs and update it there.

You will need mostly the WP Database description and wp_update_user function.

Answered by Alex Dumitru on January 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP