User:GhostInTheMachine/Lowercase Usernames

From MediaWiki.org
Jump to: navigation, search

Hack to allow fully Lowercase usernames. (This is not nice enough to be called an extension.)

Contents

[edit] The problem

The Extension makes the MediaWiki login use the accounts created by a co-resident phpBB forum.

The wiki extension disables the native wiki login and replaces it with one which uses the phpBB account tables.

This can result in a confusion:

  1. The phpBB forum software allows usernames to be in any case and ignores case during login.
  2. The wiki extension forces the wiki to use the phpBB account as held in the phpBB database tables.
  3. When the extension meets a phpBB account for the first time, it creates a matching wiki account.
  4. The extension uppercases the first letter of the phpBB account name and lowercases the rest.
  5. The wiki username suffers by having
    1. the starting letter converted to upper case (by policy)
    2. the remaining letters converted to lower case (by error? by excess zeal?).

[edit] My solution

One solution would be to force all phpBB usernames to start with an upper case letter.

Since I already have users who have chosen an username which is fully lower case, the solution that I chose was to

  • hack the extension to preserve the case of the phpBB username (reduce the zeal of the extension)
  • hack the wiki so that it allows a username to start with a lower case letter (change wiki policy).

[edit] Extension hack

[edit] extensions/Auth_phpBB/Auth_phpBB.php

Preserve case of usernames taken from phpBB.

In

public function getCanonicalName( $username )

change line 509 from

return ucfirst($faryMySQLResult['username_clean']);

to

return $faryMySQLResult['username_clean'];

[edit] Wiki hack

Starting with MediaWiki version 1.14.0

[edit] includes/Title.php

The important one.

[edit] includes/Export.php

To be complete.

[edit] includes/specials/SpecialCategories.php

To be complete.

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox