MediaWikiExtension Password Reset

From SaruWiki
Jump to navigation Jump to search

Mediawiki Extension: Password Reset

Sometimes you as a Mediawiki administrator might feel the need to reset a user's password manually. Unfortunately, there is no such function in the MediaWiki software. Bogus! But fortunately, there now exists an extension that adds this functionality. Most excellent!

Adding the extension

First, download the five files that make up the Password Reset extension from here: Mediawiki Extension:Password Reset. These five files are to be placed in the extension directory of your Debian MediaWiki installation, presumably /usr/share/mediawiki-extensions. Make sure these five files are owned by root, and cannot be edited by anyone else. As root:

cd  /usr/share/mediawiki-extensions
chown root:root PasswordReset*
chmod 644 PasswordReset*

Next, mark the extension available to MediaWiki:

cd /etc/mediawiki-extensions/extensions-available
ln -s /usr/share/mediawiki-extensions/PasswordReset.php

Then, enable the extension (either by using the mwenext command, or by this):

cd /etc/mediawiki-extensions/extensions-enabled
ln -s ../extensions-available/PasswordReset.php

Finally, grant the permission to use this extension to some group (presumably a very limited group!!). To this end, add something like the following to the file /etc/mediawiki/LocalSettings.php:

#Account management
# PasswordReset extension adds the following capability
$wgGroupPermissions['bureaucrat']['passwordreset'] = true;

This adds the Password Reset capability to the Mediawiki administrator group "bureaucrat", of which WikiAdmin is a member - and presumably you too.

Using the extension

To reset a user's password, you need the following:

  • your MediaWiki user account needs to be in a MediaWiki group that has been granted the right to use PasswordReset, e.g. bureaucrat as depicted above
  • you must be logged in with that MediaWiki account
  • you need to know the exact name of the MediaWiki account for which to reset the password

In the left navigation area, click on Special pages; scroll down to the section Restricted special pages, you should see an entry Password reset. Click it to enter the Password Reset special page. The interface is very simple: Username, New password, Confirm new password, and a button "Reset password". What more do you need?