Generate new Elgg user accounts or update existing user accounts by importing a CSV file., (*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:, (*4)
$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 );
, (*5)