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 »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CiviCRM Contact record/Drupal Role Sync adjustments
Pages: [1]

Author Topic: CiviCRM Contact record/Drupal Role Sync adjustments  (Read 1898 times)

Andrew Godfrey

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
    • Alpha International
CiviCRM Contact record/Drupal Role Sync adjustments
August 06, 2009, 09:07:28 am
Hello everyone,

As part of an international organisation we are trying to implement a website that caters for all of our National Offices around the world, allowing them to store and maintain contact records. Currently the website has a sub domain for each country. e.g.

fr.alpha.org for France
uk.alpha.org for United Kingdom

The website has one code base for drupal and CiviCRM, but has a diffferent CiviCRM database for each subdomain. The reason that we are using a seperate databases and not the domain ID solution for each country is data protection, so that no one country can access anothers data. We would like a system where a generic user that registers through a user record in drupal, on fr.alpha.org is only added as a contact record in the french civicrm database. Currently CiviCRM Role Sync will create a new record in every database where there isn't one already.


A potential solution would be......

1) Identify the users country of origin at registration and store against their profile using a field in drupal. This field will be hidden in the registration form and populated from the first portion of the URL...

Field: profile_default_country
Values: 0,uk,fr (to match URLs)
Type: multi select drop down

This could be an array so that a user could access more than one database if necessary...for example admin users.

- a form alter hook in a custom module can be used to automatically populate the field at registration and then an admin could add to the array to provide access to other countries CiviCRM databases.

2) Update the synchronize function to check the users default_country against the current domain and only sync the user if they match

- this function lives in civicrm/CRM/Core/BAO/UFMatch.php

3) Civi profile data will only be accessible on the users native site - to ensure users only edit their profile on their native site, we need to remove the edit link on their profile if they are accessing from another version.
 - a hook_user in a custom module can be used to implement this.

4) CMS admins would be able to assign a user to 2 or more default languages by editing their profile and selecting multiple default countries.

Does anyone have anymore potential ideas or know of any reasons why this wouldn't work?

Thank you very much for your time!!


« Last Edit: August 06, 2009, 09:10:59 am by andrewgodfrey »

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: CiviCRM Contact record/Drupal Role Sync adjustments
August 08, 2009, 09:17:15 pm
Your requirements sounds like, could be a good use case for multisite project - http://wiki.civicrm.org/confluence/display/CRM/Multiple+Drupals+with+single+CiviCRM, which is already out as 3.0.alpha1.

Documentation on how/where to start on it is here- http://wiki.civicrm.org/confluence/display/CRMUPCOMING/Multi+Site+Installation
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • CiviCRM Contact record/Drupal Role Sync adjustments

This forum was archived on 2017-11-26.