Thank you for this module, i found it very useful in a couple of projects.
Correct me if i'm wrong, but seems that this module does not take in account the user status.
At line 58 the user_view_access return FALSE if the account to be viewed is blocked but if this account has a role configured with this module then $access variable is set to TRUE and the profile is then visible.
Don't know if this is by design or can be considered a bug, but from my point of view is good to respect a core flag just putting an and condition at line 59: !$access && $account->status.
What do you think about?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2490934-4.patch | 530 bytes | manuel garcia |
Comments
Comment #1
Abelito commentedIn my case this is a feature.
I've found no other Drupal 7 modules that allow users to access (view) blocked user profiles.
- If you want users to see profiles of users who are blocked, the blocked users need to have a role (and this modules is needed, with permissions set correctly).
- If you want to use this module and not allow access to blocked user profiles, you can remove all roles from blocked users.
Rules can be helpful to add or remove roles in either case.
Comment #2
karens commentedGot here when I was trying to find a way to display blocked user profiles in D8. There are lots of situations where you might want to still see the users without allowing them to log in any more, like in a user directory or to see the author of old content.
In D8 this no longer works because in D8 the user status IS checked. So this feature no longer works in D8.
Comment #3
manuel garcia commented@KarenS yes that’s correct, on d8 we check if the user is active. Only way to do what you want would be to provide more granular permissions to access blocked accounts (as in add this functionality as a feature request).
This is actually a bug in 7.x and should be fixed. Here is a patch that I believe gets the job done, please test and report your findings :)
Comment #4
manuel garcia commentedOne line patch and i messed up indentation... yay!