The "Non-authenticated role" selection hides the selected role from the user profile form (My account - Edit) even when the "Set password" option of LoginToboggan is unchecked. It should not hide the role because unchecking "Set password" essentially turns off the non-authenticated role feature of LoginToboggan. Here's a patch to disable this behavior.

--- logintoboggan.module	2009-10-16 07:30:15.000000000 -0700
+++ logintoboggan.module	2010-04-08 12:40:38.000000000 -0700
@@ -168,7 +168,7 @@ function logintoboggan_form_alter(&$form
         }
         // User is no longer in the pre-auth role, so remove the option to add
         // them back.
-        else {
+        else if (!variable_get('user_email_verification', TRUE)) {
           unset($form['account']['roles']['#options'][$id]);
         }
       }
CommentFileSizeAuthor
#3 lt_pre_auth_hide.patch2.07 KBhunmonk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hunmonk’s picture

Status: Needs review » Postponed (maintainer needs more info)

that role is hidden because it ideally needs to be managed by LT if it's set at all. IMO if you need to recover that role for regular usage, you should remove it from the pre-auth setting on the LT settings page first.

can you give me another use case that would necessitate a different approach?

nonzero’s picture

I used the non-authenticated role feature once and later decided to disable it because spam-bots were getting through. I thought simply unchecking "Set password" would do it, so I did that. Months later, I found out I couldn't assign that "non-authenticated role" to new (or old) users. I had completely forgotten about the LT setting by this time and spent 2 hours on Eclipse's debugger to discover that LT was removing the role from the user edit form.

An alternative solution would be to have an item in the dropdown called "disabled". I found out the hard way that selecting "authenticated user" was essentially a disable. Or provide a bit more help text near the dropdown along the lines of, "To disable this feature, select 'authenticated user'," but this is a bit counterintuitive.

hunmonk’s picture

Status: Postponed (maintainer needs more info) » Fixed
FileSize
2.07 KB

it was a real pain to fix this, as the fix was different in every active branch, but it's done ;)

attached is the patch that was used on the 6.x branch. the fix means that if either the 'Set password' checkbox is unchecked, or the pre-auth role is set to the auth user, then LT's automatic disabling of the pre-auth role checkbox is skipped. i've also addressed this in the user administration screen.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.