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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to (synch) deleting contact when delete Drupal user
Pages: [1]

Author Topic: Best way to (synch) deleting contact when delete Drupal user  (Read 747 times)

DaisyK

  • Guest
Best way to (synch) deleting contact when delete Drupal user
November 03, 2009, 09:42:47 am
Have read a few code snippets & suggestions to write a hook in Drupal to do this?

What's the best way & has anyone done it?

Also want to synch when a Drupal user updates email address.

// Get the user's CiviCRM id based on their Drupal ID
Add to delete Drupal user:

$idSQL = "SELECT uf_match.contact_id FROM DATABASE.civicrm_uf_match uf_match
        WHERE uf_match.uf_id = '{$user_id}'";

//Then use a Civi function or directly in civi tables?


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Best way to (synch) deleting contact when delete Drupal user
November 03, 2009, 11:20:53 am

you can use:

civicrm_contact_delete

from api/v2/Contact.php

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to (synch) deleting contact when delete Drupal user

This forum was archived on 2017-11-26.