Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

RealUsernames

RealUsernames is a mediawiki extension that shows user real names (almost) everywhere within a wiki site.

Installation

  • Current version requires MediaWiki >=1.39. Use release v0.99.35 for MediaWiki MediaWiki >=1.31 <1.36.
  • Download and unzip it (or clone this git repo).
  • Copy the folder as RealUsernames within the extensionsdirectory of your mediawiki site.

Usage

Enable the extension

Edit LocalSettings.php and add the following, configuring the settings to suit your needs.

wfLoadExtension('RealUsernames'); // Load me!

// Enable link texts to be replaced by real user names.
$wgRealUsernames_linktext = true;

// Enable link refs to be replaced by real user names.
$wgRealUsernames_linkref = true;

// Show the username together with the real user name.
// (useful for some pages like the "block" one)
$wgRealUsernames_append_username = true;

// Enable separate debug for the extension.
// $wgDebugLogGroups['RealUsernames'] = '/tmp/RealUsernames.log';

Other settings

For a better production experience when using real names, it's recommended to, also, configure the following settings. Play with them!

// Disable some preferences.
$wgHiddenPrefs[] = 'nickname';
$wgHiddenPrefs[] = 'realname';

// Use real name in notifications.
$wgEnotifUseRealName = true; 

Suggested hack

As of current version, if you want to get user signatures (and their links to user page and user talk page) also using real names, this hack is needed in core.

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 5b75287603..b59d5b400f 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -4592,7 +4592,7 @@ class Parser {
         * @return string
         */
        public function getUserSig( User $user, $nickname = false, $fancySig = null ) {
-               $username = $user->getName();
+               $username = $user->getRealName(); // RealUsernames hack!
 
                # If not given, retrieve from the user object.
                if ( $nickname === false ) {

Note the modification above has been used since Mediawiki 1.17 without problems for sites having the real user names enabled and it has worked perfectly, so far.

Also, with v0.99.39 and up, it's recommended to suppress the output, via CSS/Skin hack of the mw-userpage-userdoesnotexist message warning (towards a better experience for users setting up their real-username pages).

Of course, for anybody eager to render the hack not needed anymore and to provide a solution implementing it within the extension, the next chapter may be of interest. ;-)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License and copyright

BSD 3-Clause - Copyright (c) 2013 onwards, Eloy Lafuente (stronk7).

About

Replace mediawiki usernames by real usernames (almost) everywhere

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages