I'm using the 'Set password & Immediate login' setting
I want to let pre-authorized users know that they have a limited access until fully authorized so i'm setting a warning message each time they log in. I'm doing this with the code below:
function preauthenticated_user($op, &$edit, &$user_edit, $category = NULL) {
global $user;
if ($op == 'login') {
// the new role i've set for pre authenticated users is 'preauthenticated', this is rid 5
if ($user->roles[5] == 'preauthenticated'){
$message .= 'the message here';
drupal_set_message(t($message));
}
}
}
This works fine and every time you log in without authenticating your email by clicking on the emailed link you get the above message. When you click on the link you get the 'You have successfully validated your e-mail address.' message, but also get the above message. All future logins are back to normal as an authenticated user and you don't get my custom message anymore.
It seems that as logintoboggan fires the 'You have successfully validated your e-mail address.' message it has not yet updated the user's role, so my custom message is also being set. Is there a way in which i can change my detection of pre-authenticated users so that it isn't set on the validation successful page.
Comment | File | Size | Author |
---|---|---|---|
#3 | lt_unset_pre_auth.patch | 1.53 KB | hunmonk |
#1 | lt_unset_pre_auth.patch | 1.31 KB | hunmonk |
Comments
Comment #1
hunmonk CreditAttribution: hunmonk commentedtry the attached patch and see if that fixes things up. if so i'll look into getting it committed to the module.
Comment #2
amcc CreditAttribution: amcc commentedI've not patched the module yet - its a bit tricky as i've hacked a few things already, but i'll get round to doing it manually sometime. I did find a workaround though:
As the confirmation link takes you to yoursite.com/user/validate, i don't fire the message on the validate page - you get instantly redirected from the validate page to where ever you asked the logintoboggan module to take you.
But cheers for the patch, as i'm sure there may be other issues that get affected by this
Comment #3
hunmonk CreditAttribution: hunmonk commentedattached has been committed to 5.x-1.x and 6.x-1.x, and should fix the problem described.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.