Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk user creation for every account in LDAP #107

Open
bhotrock opened this issue May 13, 2016 · 2 comments
Open

Bulk user creation for every account in LDAP #107

bhotrock opened this issue May 13, 2016 · 2 comments

Comments

@bhotrock
Copy link

bhotrock commented May 13, 2016

I didn't see this mentioned in any of the documentation, but was wondering if there is a function to automatically create WordPress accounts for every user in LDAP. I understand that the normal behavior is to create the WordPress account (and update it) whenever a user logs in.

However, I would like to be able to force account creation (or account updating) in a single process. This process could be either a button to force the "sync", or could be setup as a cron job.

My use case for this is that I want to use a WordPress "newsletter" plugin for sending email notifications to various LDAP user groups. The plugin allows sending to WordPress members according to "Role". And authLdap allows to map LDAP Group Membership to WordPress Roles. So I think this would allow me to automatically turn LDAP Groups into separate email subscriber lists.

However, I need to make sure that the WordPress user accounts are complete and up to date before sending the email. In my case, I'm looking at about 1000-2000 user accounts, with users belonging to 1-6 groups each. I can't expect that every user will have logged into WordPress, but I need their account to exist in WordPress whether they have logged in or not.

It would not be necessary to cache the password during this process since I don't need the password data. But I would need to "sync" things like uid, group membership, and a display name.

Does this ability already exist in authLdap? Or would it be possible to add it?
Thank you for the information and consideration!

@heiglandreas
Copy link
Owner

Hi @bhotrock.

That's a great idea! But as far as I see it it's outside the scope of this plugin. This plugin handles authentication and authorization of users.

But I think there is a place for a different plugin that handles syncronization of users between LDAP and Wordpress. But that's not something that will be finished tomorrow! I will have to think through how it's possible to fetch all users from LDAP according to what criteria. Currently it's easy as I check whether the logging in user exists in the LDAP and is allowed to log in. For the sync I need to check for ALL users that are member of one of the allowed groups and fetch their information en block. That takes a bit thinking ;)

@bhotrock
Copy link
Author

Thanks @heiglandreas for the quick response. I can understand how it might be outside the scope of this plugin. I just wanted to make sure I wasn't missing something that already existed.

By the way, I'd like to complement you on your emphasis on keeping the scope of the plugin limited. I think it's better to "do one thing, and do it well" as opposed to trying to be everything to all people.

Let me know if I can provide any more information or do testing for you. I'm not in a rush for this as I'm just in the design phase right now. Thanks for your awesome plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants