Firefox PHP

Module: Bulk User Add

Posted by ElliotKendall 
All files from this thread

File Name File Size   Posted by Date  
bulk-useradd-0.1.zip 4.1 KB open | download ElliotKendall 11/12/2010 Read message
Module: Bulk User Add
August 19, 2009 10:57PM
This plugin allows you to creates many users in a single operation. It can retrieves user details from an LDAP server, add the new users to specified groups, and/or make the new users Phorum administrators.

It is particularly useful in combination with my Apache LDAP plugin for Joe Curia's External Authentication module.

See the included README file for details.

Tested on 5.2.12a.
Attachments:
open | download - bulk-useradd-0.1.zip (4.1 KB)
Re: Module: Bulk User Add
September 23, 2010 02:58PM
Hi,
Is it possible to get a variant of this module that would work with any forum implementation and do not have the special requirement of LDAP server etc. i.e In short, I want a simple module that I can use to bulk add members to my forum (for example, I would like to add/move all my yahoo group members into phorum)
Regards,
Sreenadh
Re: Module: Bulk User Add
September 23, 2010 03:30PM
Use phpMyAdmin or any other database administration tool for that.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: Bulk User Add
September 23, 2010 03:59PM
This module doesn't strictly require LDAP or another external authentication source. However, it doesn't deal with passwords for the new users. If you DON'T have an external authentication source, you will need to go through and manually set passwords for all of the newly created users. Per Thomas's suggestion, doing that directly in the MySQL database might be the easiest way to go for large groups of users.
Re: Module: Bulk User Add
September 23, 2010 09:29PM
Allowing administrators to add users in Bulk is a yahoo group feature as well. Once the user is added, an automatic email with the temporary password goes to the user, intimating him that he god added to xyz group and abc is his password, and also that he needs to change the default password at the earliest. This is one of the beautiful features present in yahoo groups (among many others). I think implementing the same for Phorum as well won't be much difficult through modifying this module and and integrating a mail function. If someone does that it would be an excellent addition to the phorum capabilities making it one more step in par with the yahoo groups functionality. (With yahoo groups possible forthcoming collapse and people seeking for alternatives - such features does have a special importance)
Like Thomas Seifert advised, yes, for me for now using phpMyAdmin or so to import new users to the DB and then intimating them through mail would be the easiest option. But still I feel, if such an option was there....how good it have been....
Re: Module: Bulk User Add
September 23, 2010 09:45PM
By the way, when I does the "System sanity check" a "Modules (file name / directory name consistency)" warning is shown which reads - "Your module 'bulk-useradd' doesn't have an corresponding .php file in its directory. Each module needs a .php-file with the same name as the directory to work. Either that directory isn't for a module or the installation is broken and either the filename or the directoryname needs corrected".
But I haven't removed this module since I know that with some little modification this is one of the modules that is going to a great help for me. Whether it works for me or not, thanks a lot to ElliotKendall for presenting such an idea and writing such a module that would be useful to many. If you can modify it a bit to make it generic to be useful for me and any other phorum admin with such a requirement (without any LADAP complexity) there is nothing like it!
Regards,
Sreenadh



Edited 1 time(s). Last edit at 09/23/2010 09:46PM by Sreenadh OG.
Re: Module: Bulk User Add
September 23, 2010 09:58PM
I was thinking that adding the ability to send emails to new users with their passwords wouldn't be difficult, but there is one thing that would make it harder. Currently, the UI just asks for a list of usernames. Unless you're doing a lookup in LDAP for email address, there's no way to determine it. You could enter email addresses in the text box, but Phorum usernames are typically not the same as email address.

I suppose one way to implement this would be to take a .csv file for input, with a column for username and optional columns for email, name, password, etc. That's probably more work than I want to put into the code right now, though, given that it wouldn't address my personal use case. I would certainly encourage you to make those changes, though, if it interests you.

As for the system sanity check, that's a quirk of how the module works. Most modules have a .php file that actually DOES something, but this one is really just a settings screen. It's probably worth adding an empty bulk-useradd.php with a comment explaining the situation, just to avoid the warning, but that's probably not a big enough change to justify a new release. If I end up doing a new release for some other reason, I'll include that.
Re: Module: Bulk User Add
September 24, 2010 04:12PM
Dear ElliotKendall,
Quote

I was thinking that adding the ability to send emails to new users with their passwords wouldn't be difficult, but there is one thing that would make it harder. Currently, the UI just asks for a list of usernames. Unless you're doing a lookup in LDAP for email address, there's no way to determine it. You could enter email addresses in the text box, but Phorum usernames are typically not the same as email address.
Let the admins enter email addresses itself in the text box (one email in a line - following the yahoo group style), the part before @ present in email addresses itself can be used as usernames, and emails can be send to new users with their passwords.
If so there won't be much extra work (and the need for LDAP server or csv file etc).
Sadly I am not a coder but a user who would love to have such a feature present in phorum. :( If someone like you provides such a feature a lot of thanks to you. That will make your module many times more useful to phorum admins.

Note: In yahoo groups while adding bulk users, we simply copy-paste emails from an excel sheet, and it would be 1 email id per line.
Regards,
Sreenadh
Re: Module: Bulk User Add
September 24, 2010 04:29PM
"the part before @ present in email addresses itself can be used as usernames"

That's not really true. There can be john@doe.com and john@travolta.net on the list, which both would have "john" as the username in your scheme. A fallback mechanism should be in place to generate for example "john" and "john1" as the usernames.

A better mechanism for such input would be a CSV in which the username is explicitly listed. E.g.:
john@doe.com, john
john@travolta.net, greaseboy
This could be extended even to include the password and the full name as well:
john@doe.com, john, J0HN!, John Doe
john@travolta.net, greaseboy, L!ghtning, John Travolta

That way the admin would have a much more useful tool. Just importing email addresses is very limited and probably won't meet many admin's needs.

One extra step that could be useful, is not only adding, but synchronizing a list of users in a csv. New users can be added, old ones can be deleted, and others on the list can be left alone since they already exist.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Bulk User Add
September 26, 2010 11:08PM
Hi,
@Thomas Seifert: I am so poor in sql and phpMyAdmin that I couldn't use that suggestion.
@ElliotKendall: Thanks a lot for your module, because I have commented out everything (LDAP etc) from your code, split the email based on "@" and used the same itself as username and used your module code itself to do my work. :) It is working! Since I had to add around 3000+ users now, I may have to add a mail sending function (but I know nothing about it! But I might be able to copy-paste something from group_autoemail module into this I hope), complete my requirement. Thus even though ignorant about the phorum coding system, sql and even php I might be creating/customizing a module without even knowing how to code a module! :)
Anyway if I endup with anything useful to be shared, I would be posting it here.
@Maurice Makaay: Your approach seems to be very standard and systematic. I would love to see and use such a generic and powerful module.
Regards,
Sreenadh
Sorry, only registered users may post in this forum.

Click here to login