MediaWiki User Management

   MediaWiki User Management

This page contains info about restricting users from viewing and/or editing a Wiki.

About User Management

 * mediawiki.org Help: Configuration Settings List
 * mediawiki.org Manual: Preventing Access
 * mediawiki.org Manual: Group Permissions

Edit Settings File
In order the restrict viewing and editing of pages you have to set the User Management variables in  located in the root folder. Open this file and add the additional settings to the bottom of the file: $insert code here...
 * 1) Custom Settings by Dan Salmon
 * 2) Last update Sat 14 Jul 07

Never edit, just copy appropriate lines to   instead and amend them as appropriate.

Restrict account creation
$wgGroupPermissions['*']['createaccount'] = false;
 * 1) Prevent new user registrations except by sysops

New can be created by sysops, in the following manner:
 * 1) Go to   when logged in as a sysop. Special:Userlogin
 * 2) Click on "Create an account" to get to the account creation form.
 * 3) Enter a username and an email address, and click the "by email" button.
 * 4) The account will be created with a random password which is then emailed to the given address.

Restrict editing of all pages
$wgGroupPermissions['*']['edit'] = false;
 * 1) Disable anonymous editing

$wgGroupPermissions['*']['edit'] = $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['sysop']['edit'] = true;
 * 1) Disable editing by all non-sysop users

$wgGroupPermissions['*']['edit'] = $wgGroupPermissions['user']['edit'] = $wgGroupPermissions['sysop']['edit'] = false;
 * 1) Disable editing by absolutely everyone

Restrict editing of an entire namespace
$wgNamespaceProtection[NS_PROJECT] = array( 'autoconfirmed' );
 * 1) Only allow autoconfirmed users to edit Project namespace

$wgNamespaceProtection[NS_MAIN]    = $wgNamespaceProtection[NS_USER]  = $wgNamespaceProtection[NS_PROJECT] = $wgNamespaceProtection[NS_IMAGE] = $wgNamespaceProtection[NS_TEMPLATE] = $wgNamespaceProtection[NS_HELP] = $wgNamespaceProtection[NS_CATEGORY] = array( 'emailconfirmed' );
 * 1) Don't allow anyone to edit non-talk pages until they've confirmed their
 * 2) e-mail address (assuming we have no custom namespaces and allow edits
 * 3) from non-emailconfirmed users to start with)

$wgGroupPermissions['sysop']['editpolicy'] = true; $wgNamespaceProtection[NS_POLICY] = array( 'editpolicy' );
 * 1) Only allow sysops to edit "Policy" namespace

Note that in the last case it's assumed that a custom namespace exists and that  is a defined constant equal to the namespace number.

Restrict page creation
$wgGroupPermissions['*']['createpage'] = false;
 * 1) Anonymous users can't create pages

$wgGroupPermissions['*'           ]['createpage'] = $wgGroupPermissions['user'        ]['createpage'] = false; $wgGroupPermissions['autoconfirmed']['createpage'] = true; $wgAutoConfirmAge|$wgAutoConfirmAge = 86400 * 4; # Four days times 86400 seconds/day
 * 1) Only users with accounts four days old or older can create pages
 * 2) (like Wikipedia!).  Requires MW 1.6 or higher.

Restrict viewing of all pages
$wgGroupPermissions['*']['read'] = false;
 * 1) Disable reading by anonymous users

$wgWhitelistRead = array( ":Main Page", "Special:Userlogin", "-", "MediaWiki:Monobook.css" );
 * 1) But allow them to read the Main Page, login page, and JS/CSS pages

The  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 "_".