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

alexkb’s picture

StatusFileSize
new812 bytes

As attached.

adam_b’s picture

I 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.

techgirlgeek’s picture

I 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.

greg.1.anderson’s picture

Issue summary: View changes

This 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.

alexkb’s picture

I'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.

alexkb’s picture

In 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.

fernando iglesias’s picture

For anyone else who may need it, here's the patch in #6 backported to D6.

gaurav.kapoor’s picture

Status: Needs review » Fixed
gaurav.kapoor’s picture

Fixed in another commit.

Status: Fixed » Closed (fixed)

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