Currently, when this module is installed, users that register with the website see the message "Role change has been logged." and then "A welcome message with further instructions has been sent to your e-mail address." message.
Whilst we may indeed want to write logs that a user has been created and assigned the authenticated user role (and perhaps more if you have role_assign or something setup), we probably don't want to show the message to an anonymous user, who will likely not understand the message.
So attached is a very small patch to only display the message if the user is not anonymous.
Comments
Comment #1
alexkb commentedAs attached.
Comment #2
adam_b commentedI think "Role change has been logged" is confusing for anyone who isn't an administrator, so I'd suggest that it should be deleted, or at least made optional.
The "A welcome message with further..." message is useful, but it would be nice to be able to edit the text.
Comment #3
techgirlgeek commentedI agree, that at best this should be a message that is only displayed to administrators, but probably an unnecessary and confusing message to anyone. An anonymous, or just authenticated user would not know what the message means, and could cause red-flags to go up for the site users.
Comment #4
greg.1.anderson commentedThis looks pretty good. One suggestion, though; rather than using
!user_is_anonymous(), I think it would be better to define a new permission for roles that can see Role Watchdog messages. That way, if a site was using some other module that implicitly granted roles to authenticated users, the confirmation messages could also be suppressed for non-administrators. This would be a more general-purpose solution to this problem, and it would only be a couple more lines of code.Thanks for volunteering to co-maintain this module. Since you're a co-maintainer now, I'm leaving this issue "Needs review" (instead of "Needs Work"); you may decide how the module should behave here, and commit when ready.
Comment #5
alexkb commentedI've just been testing role_watchdog 2.x-dev with a fresh install, and I can't seem to reproduce the issue yet.
The reason being is that role_watchdog already ignores notifying the user of being assigned the authenticated user role.
The problem is still possible if auto assign role is setup though, but that seems fairly edge case to me.
Comment #6
alexkb commentedIn any case, I've now added the permission and conditional check as suggested by greg: http://drupalcode.org/project/role_watchdog.git/commit/98445649738f0d6c6...
Doing some basic tests with autoassignrole, and the change seems to do the trick.
Comment #7
fernando iglesias commentedFor anyone else who may need it, here's the patch in #6 backported to D6.
Comment #8
gaurav.kapoor commentedComment #9
gaurav.kapoor commentedFixed in another commit.