This documentation refers to CiviCRM 3.2, current stable version. Please introduce all the documentation changes here.

Creating a Drupal user for every CiviCRM contact


This page refers to CiviCRM 3.2.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!
Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Creating a Drupal User for CiviCRM Contacts

Note!
Tested on CiviCRM 1.2 / CivicSpace 0.8.2.

Concept

In CiviCRM, there is an administration function that allows the synchronisation of Drupal Users with CiviCRM contacts. However, the reverse function - to sychronise CiviCRM contacts with Drupal Users - is not a default service.

To register a new account, a Drupal User is required to enter only three pieces of information: a) an arbitrary username, b) a password and c) a valid email.

If a Drupal User registers before her details have been entered into CiviCRM, a new CiviCRM contact profile is created and matched with the Drupal User profile. If a Drupal User registers after her details have been entered in CiviCRM, the information in her CiviCRM contact is automatically associated with her Drupal User Profile. This is done through the primary email address.

An administrator can take information from CiviCRM and use it to create users in bulk.

Why would I want to do this?

  • To enable all your CiviCRM contacts to be able to maintain their own details
  • To give all your CiviCRM contacts access to Drupal's services, such as lists, forums and collaborative working environments.

What do I need to do this?

  • You will need administration level access rights to Drupal, and not just CiviCRM.
  • The Drupal User Import Module (http://drupal.org/node/31940) must be installed and enabled on your CiviCRM for Drupal or you can import users also using the more simple http://drupal.org/project/node_import that from 12 december can imort also uses generating password and can apply the email on the username too.

How do I go about it?

Warning
Please do a test run with some dummy data! To quickly create test data, use a Gmail account in the following way: yourusername+test_X@gmail.com (x being ascending numbers for each test contact)
  1. Import your contacts into CiviCRM. Let's assume you have an email address, and first and last names in each CiviCRM contact. You can find more about importing contacts here.
  2. Set up a CiviCRM profile that enables authenticated Drupal Users to edit at least the first and second names of their CiviCRM profile by using the "My Account" window. You can find more about setting up a profile here.
  3. Go into CiviCRM and select the contacts for whom you wish to create a Drupal User.
  4. In the "more actions" pull-down box, select "Export Contacts". A new dialogue will appear: select "Export PRIMARY Contact Fields", and hit "Continue". You will be prompted to save a Comma Separated Values (CSV) file labelled "CiviCRM_Contact_Search.csv". Do so.
  5. Head to the User Import Module: administer » Settings » users import.
  6. Upload the CSV you just exported from CiviCRM.
  7. The User Import is relatively intuitive, and has helpful explanatory notes throughout. Make sure you check the "Ignore First Line" box. You also have the option to send an email to the new Drupal User informing them of their registration details. Remember that you can customise the registration message (administer -> users -> configure: "Body of welcome e-mail")
  8. The dialogue will then ask you to associate one field with "email" and another with "password" . Select the field you wish to associate with the new Drupal User's email. Don't bother associating a field with password, since one will be generated randomly. You can create a username by associating particular fields with the Username pulldown box. Remember that Drupal Users can change username, email and password once their account is created. This means if User Import creates a rather incomprehensible username, the Drupal User isn't stuck with it.
  9. Once done, click the "import" button at the bottom of the screen.
  10. To test whether the import has been successful, log in as one of the test Drupal Users and modify one of the CiviCRM contact fields (which you have made accessible through a CiviCRM profile) in the My Account screen.
  11. Finally, navigate to that contact record via CiviCRM and verify that the user update has been performed.

Link to Email Discussion about this topic

http://lists.caltha.pl/pipermail/crm-dev/2006-January/002425.html

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.