Answers.Body: <p>A couple of thoughts.</p>
  
  <p>If you want this to be a response to an action - eg you folk send out a mailing - then you can do this via a webform - send out a link with checksum to a webform and upon submitting the webform you can trigger Drupal Rules (we usually do this by giving them a civicrm Tag) and this can also instantly log them in</p>
  
  <p>If you want to do this as a self-service then I would probably be adding a wee form for folk to say 'send me a login link', they enter their email, it sends them a checksum and then you do the above approach of another webform.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-19T10:30:27.593Z
Answers.Text: This could work, but the 'send me a login link' form would then need to verify against the web site users group. How would I do that?
Answers.UserDisplayName: somnolentsurfer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-19T18:52:57.903Z
Answers.Text: can you pls expand/clarify the above statement with some examples. are you aware of CiviCRM Group Roles sync (if you are referring to the Drupal Roles needing to be determined based on Civi Group membership)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-20T18:12:23.210Z
Answers.Text: Well, exactly the same as in the original question, really, as all this does is move the required point of authentication from when the user creates an account, to when the user requests a login link. So, if a user submits the web form asking for a login link, it shouldn't send them one unless they exist as a contact in Civi, and are a part of the 'web site users' group. I don't know about Group Roles sync. I have Access Control ticked on my Civi web site users group, but not sure how to properly use it.
Answers.UserDisplayName: somnolentsurfer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-15T19:13:41.103Z
Answers.LastActivityDate: 2019-02-15T19:13:41.103Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>I operate a similar system.</p>
  
  <p>Thing to do is either A) create the contacts in Drupal manually or B) write a code thing (scheduled task / hook etc) which, upon them being approved in some way (e.g. added to the Group) creates an account in Drupal and mails them the details.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-17T20:46:12.610Z
Answers.Text: The 'a code thing' could be the Drupal rule referred to in my answer which can all be done in the UI
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-16T12:14:51.660Z
Answers.LastActivityDate: 2019-02-16T12:14:51.660Z
Answers.UserDisplayName: JohnFF
Answers.Body: <p>I wrote a <a href="https://github.com/aydun/CiviCRM-JoomlaReg" rel="nofollow noreferrer">plugin for Joomla</a> that does this - it integrates into the Joomla account registration process and requires new accounts to match a CiviCRM record.  Probably wouldn't be hard to create a Drupal version using the same approach.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-19T10:33:57.690Z
Answers.Text: This sounds like what wanted, but this is my first project with both Drupal and CiviCRM, so I'm really looking for something I could do without having to write code myself.
Answers.UserDisplayName: somnolentsurfer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-19T15:52:39.033Z
Answers.Text: Ok, not sure you can do it without writing any code, but Pete's approach gets close.  Or you could ask someone to write the code for you.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T11:09:00.893Z
Answers.LastActivityDate: 2019-02-18T11:09:00.893Z
Answers.UserDisplayName: Aidan
Body: <p>We're building a site which will have certain content pages accessible only to logged in Drupal users.</p>
  
  <p>I'd like users to be able to create their own Drupal accounts with access to those pages, but only those who have been pre-approved, who exist as contacts in CiviCRM, and are part of a 'web site users' group.</p>
  
  <p>What's the best way to do this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-15T19:11:10.787Z
Comments.Text: Do you anticipate folk creating an account in response to something you might send them, or does it just need to be 'any time'?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-19T10:16:15.720Z
Comments.Text: We might send e-mails that contain a sign up link when people are added to the users group in CiviCRM, but it also needs to work any time. If someone tries to create a Drupal account, I want them validated against the Civi group. If they're in it, they should be allowed to proceed and create an account. If they're not, they should get a rejection message.
Comments.UserDisplayName: somnolentsurfer
Tags: <drupal><user-account>
Title: Allow only existing CiviCRM contacts to create own Drupal account
ThreadText: # Allow only existing CiviCRM contacts to create own Drupal account
  
  (Asked by: username_0 on 2019-02-15)
  
  We're building a site which will have certain content pages accessible only to logged in Drupal users.
  
  I'd like users to be able to create their own Drupal accounts with access to those pages, but only those who have been pre-approved, who exist as contacts in CiviCRM, and are part of a 'web site users' group.
  
  What's the best way to do this?
  
  **Tags:** drupal, user-account
  
  > **Comments:**
  > **username_1**: Do you anticipate folk creating an account in response to something you might send them, or does it just need to be 'any time'?  
  > **username_0**: We might send e-mails that contain a sign up link when people are added to the users group in CiviCRM, but it also needs to work any time. If someone tries to create a Drupal account, I want them validated against the Civi group. If they're in it, they should be allowed to proceed and create an account. If they're not, they should get a rejection message.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-02-15. Score: 1
  
  A couple of thoughts.
  
  If you want this to be a response to an action - eg you folk send out a mailing - then you can do this via a webform - send out a link with checksum to a webform and upon submitting the webform you can trigger Drupal Rules (we usually do this by giving them a civicrm Tag) and this can also instantly log them in
  
  If you want to do this as a self-service then I would probably be adding a wee form for folk to say 'send me a login link', they enter their email, it sends them a checksum and then you do the above approach of another webform.
  
  > **Comments:**
  > **username_0**: This could work, but the 'send me a login link' form would then need to verify against the web site users group. How would I do that?  
  > **username_1**: can you pls expand/clarify the above statement with some examples. are you aware of CiviCRM Group Roles sync (if you are referring to the Drupal Roles needing to be determined based on Civi Group membership)  
  > **username_0**: Well, exactly the same as in the original question, really, as all this does is move the required point of authentication from when the user creates an account, to when the user requests a login link. So, if a user submits the web form asking for a login link, it shouldn't send them one unless they exist as a contact in Civi, and are a part of the 'web site users' group. I don't know about Group Roles sync. I have Access Control ticked on my Civi web site users group, but not sure how to properly use it.  
  
  ---
  
  ### Answer by username_2 on 2019-02-16. Score: 1
  
  I operate a similar system.
  
  Thing to do is either A) create the contacts in Drupal manually or B) write a code thing (scheduled task / hook etc) which, upon them being approved in some way (e.g. added to the Group) creates an account in Drupal and mails them the details.
  
  > **Comments:**
  > **username_1**: The 'a code thing' could be the Drupal rule referred to in my answer which can all be done in the UI  
  
  ---
  
  ### Answer by username_3 on 2019-02-18. Score: 0
  
  I wrote a [plugin for Joomla](https://github.com/aydun/CiviCRM-JoomlaReg) that does this - it integrates into the Joomla account registration process and requires new accounts to match a CiviCRM record. Probably wouldn't be hard to create a Drupal version using the same approach.
  
  > **Comments:**
  > **username_0**: This sounds like what wanted, but this is my first project with both Drupal and CiviCRM, so I'm really looking for something I could do without having to write code myself.  
  > **username_3**: Ok, not sure you can do it without writing any code, but Pete's approach gets close.  Or you could ask someone to write the code for you.  
  
  ---
  
  