lowercase usernames, namespaces mediawiki installation

Ah, between [this article on custom namespaces](http://www.mediawiki.org/wiki/Manual:Using_custom_namespaces) and [a wonderful set of hacks over here](http://www.dccwiki.com/DCCWikipedia_Authentication) and going into the languages.php file, here is what needs to be changed (beyond renaming special files and templates) in order to get an all-lower-case mediawiki installation:

* __LocalSettings.php__

# DO NOT CAPITALIZE
$wgCapitalLinks = false;

# Added namespace
$wgExtraNamespaces[100] = “school”; #note, this is where you can add extra namespaces
$wgExtraNamespaces[101] = “school-talk”;

$wgNamespacesWithSubpages[school] = true; #note, add all namespaces with subpages here

* __languages/Language.php__

/* private */ $wgNamespaceNamesEn = array(
NS_MEDIA => ‘media’,
NS_SPECIAL => ‘special’,
NS_MAIN => ”,
NS_TALK => ‘talk’,
NS_USER => ‘user’,
NS_USER_TALK => ‘user-talk’,
NS_PROJECT => $wgMetaNamespace,
NS_PROJECT_TALK => $wgMetaNamespace . ‘-talk’,
NS_IMAGE => ‘image’,
NS_IMAGE_TALK => ‘image-talk’,
NS_MEDIAWIKI => ‘mediaWiki’,
NS_MEDIAWIKI_TALK => ‘mediaWiki-talk’,
NS_TEMPLATE => ‘template’,
NS_TEMPLATE_TALK => ‘template-talk’,
NS_HELP => ‘help’,
NS_HELP_TALK => ‘help-talk’,
NS_CATEGORY => ‘category’,
NS_CATEGORY_TALK => ‘category-talk’,
);

* __includes/User.php__

function newFromName( $name, $validate = true ) {
## ADDITIONAL COMMENTING HERE FOR LOWERCASE SUPPORT
# Force usernames to capital
global $wgContLang;
## $name = $wgContLang->ucfirst( $name );

# Clean up name according to title rules
$t = Title::newFromText( $name );
## if( is_null( $t ) ) {
## return null;
## }

## ADDITIONAL COMMENTING HERE FOR LOWERCASE SUPPORT
## if( is_null( $nt ) ) {
# Illegal name
## return null;
## }

## ADDITIONAL COMMENT HERE FOR LOWERCASE SUPPORT
function isValidUserName( $name ) {
global $wgContLang, $wgMaxNameChars;

if ( $name == ”
|| User::isIP( $name )
|| strpos( $name, ‘/’ ) !== false
|| strlen( $name ) > $wgMaxNameChars ) ## added right parens here
## || $name != $wgContLang->ucfirst( $name ) )
return false;

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s