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) »
  • at Sign-up: Add Role/Group based on gender(civicrm field)
Pages: [1]

Author Topic: at Sign-up: Add Role/Group based on gender(civicrm field)  (Read 970 times)

Aahar

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 3
  • CiviCRM version: 3.4 and 4.0
  • CMS version: Drupal 6.17, 6.x and Drupal 7.x
  • PHP version: 5.2
at Sign-up: Add Role/Group based on gender(civicrm field)
December 12, 2012, 04:09:17 pm
When a user registers on the Drupal6 site, I use a CiviCRM Profile for 'User Registration' with a civicrm gender field.
Based on the Gender the user selects I want to put them in a Drupal Role and CiviCRM Groups.
How to do that?

Here is what I tried:
I have tried using Drupal Rules module as follows:
1) When using Rules for CiviCRM account creation, the Rule does not get invoked.
2) When using Rules for Drupal account creation, I dont know what would be my PHP code using $user to query civicrm gender, so that I can create a condition. If this condition can evaluate to true for a say Male, then I can add all male to a Drupal Role.
« Last Edit: December 13, 2012, 12:48:51 am by Aahar »

Aahar

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 3
  • CiviCRM version: 3.4 and 4.0
  • CMS version: Drupal 6.17, 6.x and Drupal 7.x
  • PHP version: 5.2
Re: at Sign-up: Add Role/Group based on gender(civicrm field)
December 13, 2012, 11:00:50 pm
Updating it for records:
I asked it on IRC and lobo said:
"<dlobo> Aahar: can u just do this by implementing hook_user_insert
[23:34] <dlobo> and check the $_POST value?"

I shall try and update this topic

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • at Sign-up: Add Role/Group based on gender(civicrm field)

This forum was archived on 2017-11-26.