4

I was wondering if you can provide, with drupal core or any module, a double opt-in registration process.

Ideally, users who fill out a register form should receive an email with an opt-in activation link. Clicking that link, confirming their email, would it trigger the standard functionality of awaiting admin approval.

I tried LoginToBoggan but I'm pretty sure it does not provide double opt-in.

Is this implemented somewhere?

Edit: to prevent confusion: I know Drupal provides double opt-in for an "active user", but not for the registration itself. I would like users to verify that they want to register. Ideally:

  1. Visitor enters their email to register
  2. Visitor gets an email which he has to verify
  3. After the link is clicked, the user gets created

How it currently is:

  1. Visitor enters their email to register -> Blocked user gets created!
  2. Either admin approves or user has to "double opt-in"
3
  • Do you have developing knowledge that I lead you how to implement it in simple module?
    – Yuseferi
    Dec 12, 2015 at 12:37
  • @zhilevan yep :) but instead of hooking that huge process myself I wanted to ask whether there was a solution already
    – Alex
    Dec 14, 2015 at 9:28
  • :D oh yes, everybody want save times ;)
    – Yuseferi
    Dec 14, 2015 at 10:22

2 Answers 2

3
+25

If I understand you correctly, this is default Drupal functionality.

  • Go to the Account settings (admin/config/people/accounts).
  • Under Who can register accounts?, Select the option Visitors, but administrator approval is required.
  • Directly below this option, select the checkbox Require e-mail verification when a visitor creates an account.

That's all.

4
  • But I think a verification should happen before the admin has to activate the account
    – Alex
    Dec 8, 2015 at 8:36
  • I understand what you're saying but I haven't come across an easy solution for this yet. To achieve this one needs to override the core registration process manually. I dived into this once, you'll really need to write a lot of code and make sure every change is tested thoroughly. Dec 9, 2015 at 9:41
  • But this is not a solution for what he wants!!!
    – Yuseferi
    Dec 12, 2015 at 12:42
  • @zhilevan Thanks for pointing that out, but at the moment I am not able to provide a better solution. Maybe you should invest some time in coming up with a useful answer instead of posting such trivial comments. Dec 15, 2015 at 9:09
1

As far as I know, there is no such module which provides exactly what is required to do. However, I think you could still implement a work around in the following way:

  1. Follow the procedure mentioned by @Patrick Scheffer in his answer with one change, instead of Visitors, but administrator approval is required select Visitors (not going with normal admin approval required, yet).
  2. Create a new user role "unverified" on your site.
  3. The user registration could be changed in the following way:

    • A user registers to the site.
    • A welcome email with the one time login link is sent to the email for email verification.
    • User clicks on the email and logs in the site. Note: At this step the status of the user account will be changed from blocked to unblocked.
    • Using the Rules module, create a rule to assign a user role unverified to the user who uses one time login link.
    • The same rule could be used to send an email to the administrator about the creation of the new user account.
  4. Create a view of users with filter "Role=unverified". Using views bulk operations module, add a operation of removing user role from the list of the selected users. Using this view the admin could remove the "unverified" role from any user and make him/her normal authenticated user.

  5. The use of this "unverified" role could be done at various places depending on the requirements. Listing few possibilities here:

    • Using rules, you could log out the user as soon as the user tries to login if the user has "unverified" role associated with him/her. And you could display a message too in the rule saying that the account is pending approval.
    • There could be some cron process implemented, which could find the list of users which are "unverified" for a period or time (say 1 month) and delete them.
    • You could send email reminders to admin about the pending approvals.

Hence, we are tweaking the normal registration process where admin approval doesn't happen when creating the account, but after the "unverified" role has been associated with the user account. Almost all of the above could be done with no custom code and could be maintained using Features, which makes is maintainable as well :)

4
  • but then still the user did not have to verify in the first place that he wanted to register before an account was created (even if blocked)
    – Alex
    Dec 14, 2015 at 9:30
  • 1
    @Alex I Did not understand what you are trying to say? Do you want user to verify the email even before the account has been created? If that is the case, then you might have to go for a custom solution. However, it would be a big task of almost mimicking the user registration process and verification process.
    – AjitS
    Dec 14, 2015 at 9:45
  • yep, that was my intention :)
    – Alex
    Dec 15, 2015 at 16:15
  • @Alex I would highly recommend not going that route as far as possible. In my experience, the solutions built using contributed modules are far more maintainable than the custom one's.
    – AjitS
    Dec 15, 2015 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.