Giter Club home page Giter Club logo

upload_users's Introduction

upload_users

Generate new Elgg user accounts or update existing user accounts by importing a CSV file.

Features

  • Accepts CSV files in multiple character encodings
  • Allows CSV files with various field and text delimiters
  • Relies on native PHP codebase for CSV parsing
  • Header mapping to arbitrary existing and new metadata names, as well as integration with profile_manager fields
  • Integration with Roles
  • Friendly(ie) UI

Acknowledgements / Credits

Notes

  1. Elgg requires that username, name, password and email be provided at the time of user registration. It is therefore recommended that you add these fields to your CSV. If you don't, you will be able to specify username and name components from your CSV headers, i.e. the import script will attempt to parse a valid username and name from a set of details in your CSV by concatinating these strings and modifying them to match Elgg requirements. For instance, if your CSV containts First Name and Last Name headers, you can map the 'name' field as a sum of those two. If omitted, passwords will be generated using Elgg's cleartext password generator. Emails are required!

  2. If you would like to assign user roles, add a column to your CSV with the corresponding role names (that match role names defined in the Roles plugin). You will then be offered to map your CSV header to the predefined profile field that denotes roles.

  3. If you need to attach custom processing logic to a certain CSV column, hook to 'header:custom_method', 'upload_users' and return true to prevent metadata being created. The callback will receive the following parameters:

$hook_params = array(
	'header' => $header, // original CSV header
	'metadata_name' => $metadata_name, // mapped metadata name
	'value' => $value, // metadata value (CSV cell value)
	'record' => $record, // entire mapped CSV row
	'user' => $user // Created / updated Elgg user entity
);

Screenshots

alt text alt text alt text alt text

upload_users's People

Contributors

hypejunction avatar facyla avatar beck24 avatar

Stargazers

Olivier Seguin avatar  avatar  avatar

Watchers

Adam Fairhead avatar Kevin Jardine avatar  avatar Sridhar A avatar James Cloos avatar Juho Jaakkola avatar Billy Gunn avatar  avatar Paul Stewart avatar Pablo avatar  avatar  avatar

upload_users's Issues

Trigger some events when importing users

Hi everyone.
Great plugin.

I am using the lastest release of your plugin but I have some troubles.
I have written a plugin which trigger some events when user account is created. My plugin works perfectly. I trigger an event as you can see in the following line.

elgg_register_event_handler('create', 'user', 'my_function');

But when I import users through your plugin my_function is not triggered. So I dont know what's wrong.

What should I do ?

Best regard

Update?

I would really like to use this plugin as I need to add 80 users to my site. If someone would be willing to update this plying it would be really nice!

Cheers, k4deng :)

Suggestion on default settings

Hi,

I wondered if it would make sense to you to default a few import settings to other values, eg.:

  • select first or last model (of the list) instead of new one
  • email notification enabled
  • update user profile if it already exists (maybe ?)
  • correct usernames
  • generate passwords if not set

I think these are more commonly used (at least in a production context) than the current default - but of course i understand it may be different in other cases, eg. leader creating account for users, etc.

Also defaults can be easily set for a particular site by overriding the form view, so... just a suggestion ;-)

Suggestion : invite message ?

Hi,

I'm usually overriding some language strings in my themes to fit custom sites, but i think this can sometimes be a useful feature for admins rather than devs, and this was something nice with the old invite_friends plugin to be able to define one own invite our registration message.

I think this could be a potential new feature for this plugin, whether to :

  • add a custom message to the notification,
  • or even define one's own notification template.
    The first option would be already nice, and the latest is more powerful but somehow more risky and a bit more complex to set as it requires handling templates and not adding a custom insert.

Again, this is rather intended to give power to admins and reduce repetitive devs customisation work, and i consider this as a nice-but-not-essential feature ;-)

Can not download the csv example

I have nothing from the apache log, but pressing the download button for the sample csv gives me this message:" Sorry. We could not find the page that you requested."
using elgg 1.8.16

Notification title not translated

Hi,
When importing new accounts (with latest current version 1.8.2.3), the notification subject remains in English, without the sprintf substitution, eg. "Your user account for %s", while the rest of the message is properly translated.
This is caused by a small typo in the UploadUsers class, where the parameter for elgg_echo is not in an array.
I've updated the PR to include the small patch required to fix it => #13

Missing __token and/or __ts Entry

Hi,

i want to switch my old community over to a elgg system and need to import over 1k users.

Your solution is great, but not working for me. If i upload the .csv file (with username, name, email), everything seems to be "ok" - the users are shown in the form (after the upload was successfull).

Above an error is displayed (with debugging enabled): "ERROR: Vars in views must be an array: forms/upload_users/upload"

There are only "User can be created" Messages (thats the good part).

When i click "create user accounts" it displays a error again like (also without debugging enabled):

"The form misses a __token and/or __ts entry"

... and no users are created.

I run nginx 1.1.19 together with elgg 1.8.8.

edit:

found this one:

http://docs.elgg.org/wiki/Form_is_missing_token_or_ts_fields

-> URL rewriting is working correctly (the elgg installation check was ok)

Empty row in case of error

In case of an error the confirmation report just displays an empty table row where the faulty user data should be.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.