3

I am using LoginToboggan Module and I want to create to create a "pre-authenticated" user role that users get assigned to upon registration. After they have verified their email address they will be promoted to "authenticated" users. Obviously, pre-authenticated users should have restricted permissions.

If "Set password" is selected, users will be able to login before their e-mail address has been authenticated. Therefore, you must choose a role for new non-authenticated users -- you may wish to add a new role for this purpose. Users will be removed from this role and assigned to the "authenticated user" role once they follow the link in their welcome e-mail.

I created a new role "pre-authenticated" and gave it weight 1 and "authenticated" weight 2 ("anonymous" has weight 0 and "administrator" has weight 4). However, whenever I give "authenticated" users the permission to do something, "pre-authenticated" users inherit this permission. It seems like Drupal treats all custom roles as being extra roles for users that already are authenticated. I already cleared my cache and ran cron.

  • 2
    if you give a user "pre-authenticated" role then the user is already an "authenticated" user. – Aboodred1 Jun 21 '13 at 19:13
  • 1
    ^this. You'd be better off using the autheticated user role as the pre-authnticated role, and then setting up another role for "authorised" members – Chapabu Jun 21 '13 at 19:15
  • 1
    Aboodred: 60740 people are using the module. I'm pretty sure that I'm getting something wrong and that there is a way to do as suggestes by the module (see citation). Chapabu: I know, that'd be much nicer. But upon email validation, LoginToboggan automatically removes the non-authenticated role and assigns "authenticated". If I set up "authenticated" as non-authenticated, then all users will remain non-authenticated after email verification. – deinqwertz Jun 21 '13 at 19:18
  • @yaelsho's answer below actually gives you the functionality you're looking for. You should mark it as the accepted answer. – reor Nov 2 '16 at 16:43
3

This doesn't appear to be documented in the LoginToboggan interface anywhere but the default behaviour actually does what you want it to do.

You need to create new role like you mentioned, a pre-authenticated user. After creating the new role go to LoginToboggan config page and select this new role as your Non-authenticated role and save. Now when you go back to the permission config page you'll see this new role is excluded from the authenticated user permissions, just like the anonymous user.

0

You may try with Rules

The rules module allows site administrators to define conditionally
executed  actions based on occurring events

You can create a rule that sets pre-authenticated role on registration and one rule that set another role after the user has confirmed it.

EDIT --------------

LoginToboggan has an option :

Non-authenticated role

If "Set password" is selected, users will be able to login before their e-mail address has been authenticated. Therefore, you must choose a role for new non-authenticated users -- you may wish to add a new role for this purpose. Users will be removed from this role and assigned to the "authenticated user" role once they follow the link in their welcome e-mail. WARNING: changing this setting after initial site setup can cause undesirable results, including unintended deletion of users -- change with extreme caution!

Have you set your pre-authenticated role here?

  • Thanks for your suggestion but I would like to use the functionality that LoginToboggan provides. – deinqwertz Jun 21 '13 at 19:20
  • You can find some information here drupal.org/project/registration_toboggan . This module does not seem stable. If Login Toboggan does not provide this functionality you should use Rules. – Tyler Durden Jun 21 '13 at 19:22
  • This module advices me to do the same thing: To use Registration Toboggan you are required to setup a pre-authorized roles within Logintoboggan to keep users with no password set and an un-verified email separate from normal users. Permissions associated with this role of user also must be super low pre-verification. – deinqwertz Jun 21 '13 at 19:24
  • But it seems like there is no way to set up a role that has less permissions than "normal" users. – deinqwertz Jun 21 '13 at 19:25
  • I've updated my answer – Tyler Durden Jun 21 '13 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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