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.
Comment | File | Size | Author |
---|---|---|---|
#6 | 822098-masq-username.patch | 9.24 KB | andypost |
#4 | 822098_theme_username.patch | 3.88 KB | deviantintegral |
#1 | 822098-use-theme-username.patch | 1.98 KB | coreyp_1 |
Comments
Comment #1
coreyp_1 CreditAttribution: coreyp_1 commentedSuppose I should add the patch...
Comment #2
deekayen CreditAttribution: deekayen commentedCommitted to 6--1; needs HEAD version.
Comment #3
deekayen CreditAttribution: deekayen commentedComment #4
deviantintegral CreditAttribution: deviantintegral commentedAs 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.
Comment #5
andypostMaybe better for D7 use format_username() function?
Comment #6
andypostI'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
Comment #7
deekayen CreditAttribution: deekayen commentedHunk #4 FAILED at 508.
Hunk #6 FAILED at 733.
2 out of 8 hunks FAILED -- saving rejects to file...
Comment #8
andypostThis should be fixed before release, but no time to re-roll
Comment #9
andypost