MediaWiki by default allows any user to edit, create, and manage the Wiki site. Depending on what the Wiki is designed for, the administrator may want to restrict certain functions from the users. This Article will explain how to remove the create account link, restrict viewing and editing accounts, and page creation.

Note! Changing the values to False will disable the access and True will enable the access.

Account Access

How to remove the create account link?

The default account creation link at the top of the MediaWiki site can be disabled by editing the code in the LocalSettings.php file. This section will explain how to disable the Create account link at the top of the MediaWiki site.

  1. Log into cPanel
  2. Navigate to the Files > File Manager. Select click Go. Navigate to the MediaWiki location. An example of the location would be:

    /home/userna5/public_html/mediawiki

  3. disable-create-account-mediawiki-1Select the LocalSettings.php file and click code editor.
  4. disable-create-account-mediawiki-2Add the following code to the file.
    $wgGroupPermissions['*']['createaccount'] = false;

    Click save


    disable-create-account-mediawiki-3Now the Create account link will be completely removed from the page.

How do I restrict viewing, editing, and creating accounts?

MediaWiki by default has the wiki fully accessible to any user that is registered to the site. In the case that the Wiki needs to be made private, and restricted to System Operators (Sysop) only . Code can be added to the LocalSettings.php to disable these features. This will restrict the viewing, editing, and account creation portions of the MediaWiki site. The following will explain how disable the edit, viewing, and account creation sections in MediaWiki.

  1. Log into cPanel
  2. Navigate to the Files > File Manager. Select Go. Navigate to the MediaWiki location. An example of the location would be:

    /home/userna5/public_html/mediawiki

  3. Select the LocalSettings.php file and click code editor.
  4. Add the following code to the file.

    Allows access to .css, .js functions of the user login.

    $wgWhitelistRead = array ("Special:Userlogin", "MediaWiki:Common.css", 
    "MediaWiki:Common.js", "MediaWiki:Monobook.css", "MediaWiki:Monobook.js", "-");

    Disables the edit feature for anonymous users

    $wgGroupPermissions['*']['edit'] = false;

    Disables the account creation button.

    $wgGroupPermissions['*']['createaccount'] = false;

    Click Save. The anonymous user will no longer be able to view edit or create any thin on the wiki..


Restricting users editing capabilities

When setting up MediaWiki for the first time, all uses, whether anonymous or registered, can edit pages in the Wiki. The following section will explain how to restrict users from the editing capability.

  1. Log into cPanel
  2. Navigate to the Files > File Manager. Select Go. Navigate to the MediaWiki location. An example of the location would be:

    /home/userna5/public_html/mediawiki

  3. Select the LocalSettings.php file and click code editor.
  4. Add the following code to the file.

    Restricts Anonymous editing

    $wgGroupPermissions['*']['edit'] = false;

    Restricts User editing

    $wgGroupPermissions['user']['edit'] = false;

    Allows sysop (Systems Operator)

    $wgGroupPermissions['sysop']['edit'] = True;

    Click Save. Now only Sysops will be able to edit the site..


Preventing users from creating pages

Users can create and edit pages by default. you may want to restrict users from creating pages that do not apply to the wiki and at the same time give them editing access. The following steps will explain how to restrict page creation in MediaWiki.

  1. Log into cPanel
  2. Navigate to the Files > File Manager. Select Go. Navigate to the MediaWiki location. An example of the location would be:

    /home/userna5/public_html/mediawiki

  3. Select the LocalSettings.php file and click code editor.
  4. Add the following code to the file.

    Restricts Anonymous users from creating pages

    $wgGroupPermissions['*']['createpage'] = false;

    Restricts Users from creating pages

    $wgGroupPermissions['user']['createpage'] = false;

    Click Save. Anonymous and Users cannot create pages now.


Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Write New!
Do you want to publish a tutorial to our support center?

News / Announcements

SSL Certficate Warnings
Updated 2014-04-14 11:34 am EST
Hits: 2015
Heartbleed 0-day OpenSSL security bug
Updated 2014-04-14 04:43 pm EST
Hits: 5308

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!