views:

40

answers:

2

In MediaWiki, I want to change the user names in the history and recent changes to the "real name" as entered in the user's preferences. For example, in the recent changes I see this:

(diff) (hist) . . Somepage‎; 11:03 . . (+285) . . Coolguy123 (Talk | contribs | block)

But I want to see this:

(diff) (hist) . . Somepage‎; 11:03 . . (+285) . . Billy Bob (Talk | contribs | block)

However, I don't have access to the backend so I can't hack the PHP. Is this possible just using Javascript and CSS? (I can edit MediaWiki:Common.js and MediaWiki:Common.css)

A: 

If you can edit the MediaWiki namespace you have admin rights, yes? You could take a look at Extension:ShowRealUsernames. Ideally persuade the backend people to install it or see if you can incorporate it into the Common pages you mention.

Note: even though you may import real names from some location, every user can override those names using MY PREFERENCES.

Mark Robinson
A: 

You would really want to change every user's username to his real name. Depending on the number of users you have, it might take a while, and users would have to log in under their real names from then on (old usernames would no longer work). It would also not be possible for you to do yourself unless Extension:Renameuser was installed by your system administrator and you were given "bureaucrat" rights.

For the page history, it's possible to AJAX-request the same page using ?action=credits to get all the username-real name pairs (attempting to "parse" the HTML), although an additional HTTP request would be needed for such a heavily used feature. I would have the client-side JavaScript only request and show the real names when the user clicks a button. That way, just using the history to quickly identify wiki vandalism is hopefully not impacted by the performance loss.

Extension:PageHistoryRealnames would be what the server administrator could install and not rename the users (not sure about the recent changes part). However, the performance impact would be one reason he might refuse to do so. While MediaWiki stores, in addition to the user ID number, a separate copy of the user's username with the revision information, the real name is not (partly because it is changeable in the user's preferences). (That's why when a large contributor to Wikipedia asks for a username change, it can take a while because every history entry would need to be updated.) This means that a SQL "LEFT JOIN" must be used, which would cause a slowdown.

idealmachine