MediaWiki User Management
From Fishcakes Wiki
This page contains info about restricting users from viewing and/or editing a Wiki.
Contents |
About User Management
- mediawiki.org Help: Configuration Settings List
- mediawiki.org Manual: Preventing Access
- mediawiki.org Manual: Group Permissions
Restrict User Access
Edit Settings File
In order the restrict viewing and editing of pages you have to set the User Management variables in LocalSettings.php located in the root folder. Open this file and add the additional settings to the bottom of the file:
# Custom Settings by Dan Salmon # Last update Sat 14 Jul 07 $insert code here...
Never edit includes/DefaultSettings.php, just copy appropriate lines to LocalSettings.php instead and amend them as appropriate.
Restrict account creation
# Prevent new user registrations except by sysops $wgGroupPermissions['*']['createaccount'] = false;
New can be created by sysops, in the following manner:
- Go to
[[Special:Userlogin]]when logged in as a sysop. Special:Userlogin - Click on "Create an account" to get to the account creation form.
- Enter a username and an email address, and click the "by email" button.
- The account will be created with a random password which is then emailed to the given address.
Restrict editing of all pages
# Disable anonymous editing $wgGroupPermissions['*']['edit'] = false;
# Disable editing by all non-sysop users $wgGroupPermissions['*']['edit'] = $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['sysop']['edit'] = true;
# Disable editing by absolutely everyone $wgGroupPermissions['*']['edit'] = $wgGroupPermissions['user']['edit'] = $wgGroupPermissions['sysop']['edit'] = false;
Restrict editing of an entire namespace
# Only allow autoconfirmed users to edit Project namespace $wgNamespaceProtection[NS_PROJECT] = array( 'autoconfirmed' );
# Don't allow anyone to edit non-talk pages until they've confirmed their # e-mail address (assuming we have no custom namespaces and allow edits # from non-emailconfirmed users to start with) $wgNamespaceProtection[NS_MAIN] = $wgNamespaceProtection[NS_USER] = $wgNamespaceProtection[NS_PROJECT] = $wgNamespaceProtection[NS_IMAGE] = $wgNamespaceProtection[NS_TEMPLATE] = $wgNamespaceProtection[NS_HELP] = $wgNamespaceProtection[NS_CATEGORY] = array( 'emailconfirmed' );
# Only allow sysops to edit "Policy" namespace $wgGroupPermissions['sysop']['editpolicy'] = true; $wgNamespaceProtection[NS_POLICY] = array( 'editpolicy' );
Note that in the last case it's assumed that a custom namespace exists and that NS_POLICY is a defined constant equal to the namespace number.
Restrict page creation
# Anonymous users can't create pages $wgGroupPermissions['*']['createpage'] = false;
# Only users with accounts four days old or older can create pages # (like Wikipedia!). Requires MW 1.6 or higher. $wgGroupPermissions['*' ]['createpage'] = $wgGroupPermissions['user' ]['createpage'] = false; $wgGroupPermissions['autoconfirmed']['createpage'] = true; $wgAutoConfirmAge|$wgAutoConfirmAge = 86400 * 4; # Four days times 86400 seconds/day
Restrict viewing of all pages
# Disable reading by anonymous users $wgGroupPermissions['*']['read'] = false;
# But allow them to read the Main Page, login page, and JS/CSS pages $wgWhitelistRead = array( ":Main Page", "Special:Userlogin", "-", "MediaWiki:Monobook.css" );
The $wgWhitelistRead setting allows users to view the main page and log in. Without this line, no one can log in. If page names have more than one word, use a space " " between them, not an underscore "_".
MediaWiki Resources
Official MediaWiki Resources
- mediawiki.org — official MediaWiki website.
- mediawiki.org Manual — contents page.
- mediawiki.org Help — contents page.
- mediawiki.org Help: FAQ — good place for quick answers.
- meta.wikimedia.org Help — User Guide
- wikimedia.org Mailing List — sign up for email updates.
Unofficial MediaWiki Resources
- askdrwiki.com Ask Dr Wiki — helpful advice about all things wiki.
- lifehacker.com How to Guide — excellent first start guide with Video Tutorial by Gina Trapani.
- mikeswikidev Mediawiki Dev Blog — by Mike Baynton.
- mwusers.com Media Wiki Users — forum and mailing lists for users and administrators.
- wikibooks.org Administrators Handbook — excellent admin guide.
- wikibooks.org How to Start a Wiki — excellent guide including a list of free and paid Wiki hosts.
- wikieducator.org Wiki Educator — community site with guides for education projects linked with the development of free content.
Media Wiki Tools
- HTML to Wiki Converter for HTML Tables — excellent tool which converts HTML table tags into their wiki equivalents.

