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) »
  • Joomla registrations restricted to Civi contacts
Pages: [1]

Author Topic: Joomla registrations restricted to Civi contacts  (Read 1363 times)

rogerco

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 5
Joomla registrations restricted to Civi contacts
July 24, 2008, 02:40:48 am
I have membership and other contact records all imported into CiviCRM as contacts

Henry Bennet has created a Joomla plugin that restricts logins to only people with valid memberships in CiviMember - this will be very useful once I can figure out how to expose and edit CiviMember details on the front-end (eg through profile forms) - currently I am using custom fields instead of CiviMember.

The next problem is to replace the standard Joomla register form with one which checks whether the person registering is an existing contact (and optionally a member of a specified group) before allowing them to register. (in the future this could be extended to check CiviMember status as Henry has done, but for now all contacts who are members are in a group called 'all members' so I just check whether the match is a member of that group). If no matching member is found in Civi it tells them to go away and join.

I have this working as a J1.5 component extension com_civiuser. The last step I am having trouble with is creating a new entry in civicrm_uf_match and any other links necessary. I don't want to create a new contact which seems to be the action of  the functions in UFMatch.php.
I have already found the contact matching firstname,lastname and email and have the contact_id, and I have just created the Joomla user and so have the Joomla user id.

Is it simply a question of inserting a new row in civicrm_uf_match with the two id's and the email address in uf_name (which seems to be what is in the existing entries)?

Why is email address stored here (civicrm_uf_match) as well as in the contact details (and the Joomla user details)?

Should the domain_id field ever be anything other than 1?

Secondary question - since I am replacing the standard Joomla user details editing form it would be relatively easy to automatically update the CiviCRM contact record if they change their email address using api civicrm_contact_add passing in the civi contact id.

Will this function also update the email address in the civicrm_uf_match table as well - and if not what are the implications of having a non-matching email address in that table?

RogerCO

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: Joomla registrations restricted to Civi contacts
July 24, 2008, 12:17:54 pm
Quote from: rogerco on July 24, 2008, 02:40:48 am
Is it simply a question of inserting a new row in civicrm_uf_match with the two id's and the email address in uf_name (which seems to be what is in the existing entries)?

yes

Quote from: rogerco on July 24, 2008, 02:40:48 am
Why is email address stored here (civicrm_uf_match) as well as in the contact details (and the Joomla user details)?

since we use this field to match between civicrm and the CMS (joomla), we figured storing the value what we matched on earlier is a good thing. allows us to check and propagate the corresponding changes if either side changes. We can eliminate it and replace it with a slightly more complex email query on the civicrm side

Quote from: rogerco on July 24, 2008, 02:40:48 am
Should the domain_id field ever be anything other than 1?

domain_id is obsoleted in 2.1. so for 2.0 and under 1 is the recommended value :)

Quote from: rogerco on July 24, 2008, 02:40:48 am
Secondary question - since I am replacing the standard Joomla user details editing form it would be relatively easy to automatically update the CiviCRM contact record if they change their email address using api civicrm_contact_add passing in the civi contact id.

yes

Quote from: rogerco on July 24, 2008, 02:40:48 am
Will this function also update the email address in the civicrm_uf_match table as well - and if not what are the implications of having a non-matching email address in that table?

if the user is logged in, it will update the corresponding uf_match record (and also the corresponding email address in jos_users)

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) »
  • Joomla registrations restricted to Civi contacts

This forum was archived on 2017-11-26.