CiviCRM

Option to Create a Drupal User from a Profile

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed/Completed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.8
  • Component/s: Core CiviCRM
  • Labels:
    None

Description

this issue is as per discussion on civicrm-dev list
http://www.nabble.com/Option-to-Create-a-Drupal-User-from-a-Profile---Contribution-Page-tf3256510s15986.html

1. Add new setting for Profiles : "Create CMS User"

2. If this is enabled, the Profile form fieldset is "enhanced" as
follows when the form is displayed AND the visitor is NOT logged in to
Drupal:
   * Add checkbox: "Create an account?"
   * If checked, display fields for entering Username, Password,
Confirm Password

(The profile must include an Email Address, or this feature is suppressed)

3. When the profile is submitted, we would invoke the same Drupal API
used when a new user registers "normally". This should mean that "post
user creation processes" configured for a given site would be
triggered (e.g. sending welcome emails, etc.)

check drupal api: http://api.drupal.org/api/HEAD/function/drupal_execute

4. Error Handling -
* We need to handle the case where a User with this Username and/or
Email already exists. We could either return an error message and not
submit the profile form (tell them to login, etc.). Or, we could
bypass creating the account. If we bypass creating the account, we
mIght need to tell them that a new user account was NOT created
because an account already exists...and to use their existing login...

Activity

Hide
Swati Vaidya added a comment -
As per chat assigning this issue to lobo.
Show
Swati Vaidya added a comment - As per chat assigning this issue to lobo.
Hide
David Greenberg added a comment -
Found a few issues in testing:

1. We need to figure out how to trap/handle duplicate User Name situation. Currently, if you submit a profile with a User Name that already exists in Drupal, it throws an untrapped error:

user warning: Duplicate entry 'Jasmine' for key 2 query: INSERT INTO users (name, mail, pass, init, status, uid, created) VALUES ('Jasmine', 'dggreenberg+jas2@gmail.com', 'e82e70f17c655ee0e1f17f6957200e60', 'dggreenberg+jas2@gmail.com', 1, 10, 1181923456) in /Users/dgg/htdocs/drupal-5.1/includes/database.mysql.inc on line 172.

2. You can create a profile w/ a Primary Email field - but make the field NOT REQUIRED (hence user can skip the field and cause problems). We should add "email field in profile must be required" to the tests for $emailPresent = true.

NOTE: I'm not getting my new user emails from drupal. I assume this is a config issue on my site - but don't know where smtp server is set for drupal ???
Show
David Greenberg added a comment - Found a few issues in testing: 1. We need to figure out how to trap/handle duplicate User Name situation. Currently, if you submit a profile with a User Name that already exists in Drupal, it throws an untrapped error: user warning: Duplicate entry 'Jasmine' for key 2 query: INSERT INTO users (name, mail, pass, init, status, uid, created) VALUES ('Jasmine', 'dggreenberg+jas2@gmail.com', 'e82e70f17c655ee0e1f17f6957200e60', 'dggreenberg+jas2@gmail.com', 1, 10, 1181923456) in /Users/dgg/htdocs/drupal-5.1/includes/database.mysql.inc on line 172. 2. You can create a profile w/ a Primary Email field - but make the field NOT REQUIRED (hence user can skip the field and cause problems). We should add "email field in profile must be required" to the tests for $emailPresent = true. NOTE: I'm not getting my new user emails from drupal. I assume this is a config issue on my site - but don't know where smtp server is set for drupal ???
Hide
Donald A. Lobo added a comment -

1. fixed. drupal api sucks. its not really an API but more like our form postProcess and we cannot validate a few things via the valdation functons in user.module. replicated the stuff in our code

2. if the user skips the field but wants a cms account created, we trap and throw an error
Show
Donald A. Lobo added a comment - 1. fixed. drupal api sucks. its not really an API but more like our form postProcess and we cannot validate a few things via the valdation functons in user.module. replicated the stuff in our code 2. if the user skips the field but wants a cms account created, we trap and throw an error
Hide
Donald A. Lobo added a comment -

We should add similar capability to Joomla and potentially rework this in 2.0. Filing a separate issue for this
Show
Donald A. Lobo added a comment - We should add similar capability to Joomla and potentially rework this in 2.0. Filing a separate issue for this
Hide
Manish Zope added a comment -
Verify for 2.0
Show
Manish Zope added a comment - Verify for 2.0
Hide
Kiran Jagtap added a comment -
Verified and Tested for 2.0 ( r - 12810 )
Show
Kiran Jagtap added a comment - Verified and Tested for 2.0 ( r - 12810 )

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: