Extension:ConfirmAccount

From Organic Design wiki
Revision as of 18:02, 11 August 2012 by Nad (talk | contribs)

We been getting a lot of user signing up with the intent to do spamming - they haven't been able to because we've had a policy requiring users to request entry into the known group before they can edit. But recently even the number of signups have become annoying and messing up the recent changes, so I've finally installed the MW:Extension:ConfirmAccount ConfirmAccount extension.

It's important to install the version of the extension that matches the MediaWiki version. I find the easiest way to do this is to use Subversion to checkout a specific release of the extension code, e.g.

<bash>svn co http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_16/extensions/ConfirmAccount</bash>

This extension also requires some SQL tables to be added. This is easily done by piping the ConfirmAccount.sql into your database from shell. But not that the SQL script will need to be edited in two locations if you use a table-prefix in your wiki.

LocalSettings

These are the settings we use for the ConfirmAccount extension on this wiki.

$wgMakeUserPageFromBio = false;
$wgUseRealNamesOnly = false;
$wgAccountRequestMinWords = 0;
$wgAccountRequestToS = false;
$wgAccountRequestExtraInfo = false;
$wgConfirmAccountContact = false;
$wgConfirmAccountCaptchas = false;
$wgAllowAccountRequestFiles = false;
$wgConfirmAccountNotice = true;

System messages

I also adjusted the following system messages to suit our site:

Adjust code to notify an admin of requests

The ConfirmAccount extension does not provide an email notification to administrators when a user requests a new account. There are also no hooks in the user main system allowing an administrator confirmation to be gracefully added, so unfortunately a code-base hack was required to implement this. It has been done by changing line 583 of RequestAccount_body.php which has the following content:

<php>return $user->sendMail(

wfMsg( 'requestaccount-email-subj' ), wfMsg( 'requestaccount-email-body', wfGetIP(), $user->getName(), $url, $wgContLang->timeanddate( $expiration, false ), $wgContLang->date( $expiration, false ), $wgContLang->time( $expiration, false ) ) );</php>


Insert the following before the return statement to send a message to ad admin first.

<php>User::newFromName( 'ADMIN-USER-NAME' )->sendMail(
       "A new user \"" . $user->getName() . "\" has requested an account on OrganicDesign",
       "A new user \"" . $user->getName() . "\" (" . wfGetIP() . ") has requested an account on OrganicDesign.

Manage account requests at the following link, https://www.organicdesign.co.nz/Special:ConfirmAccounts" );</php>