CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Making Drupal users based on Contact Data.
Pages: [1]

Author Topic: Making Drupal users based on Contact Data.  (Read 1168 times)

Krist

  • Guest
Making Drupal users based on Contact Data.
July 30, 2009, 09:59:23 pm
Hello All,

On our society aspiring members usually first go to one of the public events. They then sign up, and only then do they get access to the "members only" part of our website. I am now rebuilding our website using Drupal and CiviCRM, and I'm aiming for the following:
- Interested person visits the public part of our site (as anonymous user from the point of view of Drupal) and signs up for a public event. We collect some data, this becomes a contact in CiviCRM.
- When this person decides to become a member our secretary updates the membership status in the contact from "aspiring" to "full", enters some more info about the member, and automagically the following should happen:
    - A Drupal user is generate for this person, the uid is automatically generated from the first and last name.
    - A first password is generated and sent out.
    - A bill is sent out.

It's especially this creating a drupal user automatically that I am looking for. How do I this?



Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Making Drupal users based on Contact Data.
July 31, 2009, 11:20:34 am
This might get you part-way there....

If your membership secretary uses the Drupal Administer >> Add User form and enters the same email address as the existing "aspiring" contact - then Drupal will create the user record (and can email their user info to them). AND CiviCRM will link the new user to the existing contact record.

Not a complete solution - but playing with that might give you more ideas. If you're looking for something more automated and have some PHP skills you could look at using the CiviCRM post hook to check for updates to your membership status field - and then use the drupal api to create the user record etc.
Protect your investment in CiviCRM by  becoming a Member!

Krist

  • Guest
Re: Making Drupal users based on Contact Data.
August 03, 2009, 02:25:08 am
Quote from: Dave Greenberg on July 31, 2009, 11:20:34 am
This might get you part-way there....

If your membership secretary uses the Drupal Administer >> Add User form and enters the same email address as the existing "aspiring" contact - then Drupal will create the user record (and can email their user info to them). AND CiviCRM will link the new user to the existing contact record.

So the CiviCRM contact data is linked to the Drupal users database on the email address field? That's interesting.
i was myself thinking more along the lines of soem kind of batch that just manipulates the mysql tables.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Making Drupal users based on Contact Data.
August 03, 2009, 09:53:02 am
The actual foreign key linkages are stored in civicrm_uf_match table. However we use the Drupal email address mapped to the CiviCRM contact's email address to identify the records to link.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Making Drupal users based on Contact Data.

This forum was archived on 2017-11-26.