When telling the user that they are masquerading as someone, we should use theme('username', $account) for consistency and cross-compatibility.

For example, I use Realname to control the display of my user's name throughout the site, but I also have a complex setup of parents being able to masquerade as their own children. When they masquerade, then the parents need to see "you are masquerading as joe", and not "you are masquerading as megatron_13".

using the theme function allows for consistent display across the site.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

coreyp_1’s picture

Suppose I should add the patch...

deekayen’s picture

Status: Active » Patch (to be ported)

Committed to 6--1; needs HEAD version.

deekayen’s picture

Version: 6.x-1.3 » 7.x-1.x-dev
deviantintegral’s picture

FileSize
3.88 KB

As part of some other work I noticed that the patch doesn't apply to links and so on. This patch uses theme_username() anywhere the username is displayed, except for watchdog() calls.

It will be committed to DRUPAL-6--1 but still need to be ported to HEAD.

andypost’s picture

Maybe better for D7 use format_username() function?

andypost’s picture

Status: Patch (to be ported) » Needs review
FileSize
9.24 KB

I've changed to format_username() because it uses drupal_alter('username' to allow other modules a-la realname to work properly

Also optimized masquerade_block_1() load all users with one query

EDIT: I think we should rework a bit the strings because in watchdog() seems better to have a links for usernames, but this is a different issue

deekayen’s picture

Status: Needs review » Needs work

Hunk #4 FAILED at 508.
Hunk #6 FAILED at 733.
2 out of 8 hunks FAILED -- saving rejects to file...

andypost’s picture

This should be fixed before release, but no time to re-roll

andypost’s picture

Issue summary: View changes
Issue tags: +Needs reroll