Extension:ConfirmAccount

From MediaWiki.org
Jump to: navigation, search

Other languages:
català • ‎Deutsch • ‎English • ‎British English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎中文
MediaWiki extensions manual
Crystal Clear action run.png
ConfirmAccount

Release status: stable

ConfirmAccounts.png
Implementation User identity, Database, Special page
Description Requires submission and approval of accounts.
Author(s) Aaron Schulztalk
MediaWiki 1.19+
Database changes Yes
Tables account_requests
account_credentials
License GPL
Download
README
Parameters
  • $wgMakeUserPageFromBio
  • $wgAutoUserBioText
  • $wgAutoWelcomeNewUsers
  • $wgRejectedAccountMaxAge
  • $wgConfirmAccountRejectAge
  • $wgAccountRequestThrottl
  • $wgAccountRequestWhileBlocked
  • $wgConfirmAccountRequestFormItems
  • $wgAccountRequestExts
  • $wgAccountRequestTypes
  • $wgConfirmAccountSortkey
  • $wgConfirmAccountSaveInfo
  • $wgConfirmAccountContact
  • $wgConfirmAccountCaptchas
  • $wgConfirmAccountFSRepos
  • $wgConfirmAccountNotice
Added rights
  • confirmaccount
  • requestips
  • lookupcredentials
Hooks used
AbortNewAccount

LoadExtensionSchemaUpdates
PersonalUrls
UserCreateForm
UserLoginForm
BeforePageDisplay
AdminLinks
AddNewAccount
Debug
EmailConfirmed
userCan

Translate the ConfirmAccount extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

Issues:

Open tasks · Report a bug

The ConfirmAccount extension disables direct account creation and requires the approval of new accounts by a bureaucrat. Direct account creation can still be enabled (if you want Sysops/Bureaucrats to be able to directly make them) by configuring user rights.

The ConfirmEdit extension can be used (in conjunction with the ConfirmAccount extension) in order to use captchas to stop flood requests.

Installation[edit | edit source]

  • Download and place the file(s) in a directory called ConfirmAccount in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Ensure the wiki has write permissions on $wgUploadDirectory, or manually set $wgFileStore['accountreqs'] and $wgFileStore['accountcreds'] to a writable directory of your choice.
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Optional configuration[edit | edit source]

There are several configuration variables that can be adjusted in LocalSettings.php (after the require_once line that includes ConfirmAccount.php). See ConfirmAccount.config.php for all the variables that can be set. (The default values are in ConfirmAccount.config.php, but you should not edit that file).


MediaWiki version: 1.19
  • Note Note: By default, a 50 word biography is required for the new user to submit the request form. To adjust this requirement, edit $wgAccountRequestMinWords, e.g. for 10 words:
$wgAccountRequestMinWords = 10;

Setting $wgAccountRequestMinWords to 0 will disable it entirely.


MediaWiki version: 1.20
  • Note Note: By default, a 50 word biography is required for the new user to submit the request form. To adjust this requirement, edit $wgConfirmAccountRequestFormItems['Biography']['minWords'] in LocalSettings.php, e.g. for 10 words:
$wgConfirmAccountRequestFormItems['Biography']['minWords'] = 10;

To disable the biography, set $wgConfirmAccountRequestFormItems['Biography']['enabled'] to false:

$wgConfirmAccountRequestFormItems['Biography']['enabled'] = false;
  • Note Note: Sysops can still create accounts directly. To disable this, add to LocalSettings.php:
$wgGroupPermissions['sysop']['createaccount'] = false;
  • Note Note: If only logged-in users are allowed to view pages, make sure you add the request account page to $wgWhitelistRead. For example:
$wgWhitelistRead = array( 'Special:RequestAccount', 'Main Page' );
In other languages you have to replace "Main Page" with its local name, for instance "Hauptseite" in a German wiki.

To further categorize users based on their interests, you can set up MediaWiki:Requestaccount-areas. This should be in a format like:

*Topic|Topic wiki page|text to append to all interested users' bios |text to append to all interested users' bios in group0|text to append to all interested users' bios group1|text to append to all interested users' bios in group2|...

These group numbers are based on $wgAccountRequestTypes. So if 0 is the index for 'authors', then 'authors' interested in a topic will have the group0 text appended to their biography. This can be useful, say, if users can be approved as either authors or editors. Authors can have "category:X authors" where X is a topic, like "mathematics", and editors can have "category:x editors". You can have as many groups as you want, but you need at least one.

Usage[edit | edit source]

Confirming account requests on Special:ConfirmAccounts (beta form)
  1. As a bureaucrat (or other user with the confirmaccount permission), browse to Special:ConfirmAccounts
  2. Click Review
  3. You will see the whole form with the users' data. Carefully review the form, and proceed to creating the account or rejecting the request.
  4. If you chose to create the account, the user's biography will become their userpage and the userpage will be automatically created with the default summary of Creating user page with biography of new user.

Note: In order for bureaucrats to get notified of pending requests you need to set an email / mailing list in LocalSettings.php:

$wgConfirmAccountContact = 'Bureaucrat@domain.com';

Enhancements[edit | edit source]

If you would like to add a "Request account" login link add the following to the "LocalSettings.php" file:

$wgHooks['PersonalUrls'][] = 'onPersonalUrls';

function onPersonalUrls( array &$personal_urls, Title $title, SkinTemplate $skin  ) {
    // Add a link to Special:RequestAccount if a link exists for login
    if ( isset( $personal_urls['login'] ) || isset( $personal_urls['anonlogin'] ) ) {
            $personal_urls['createaccount'] = array(
                'text' => wfMessage( 'requestaccount' )->text(),
                'href' => SpecialPage::getTitleFor( 'RequestAccount' )->getFullURL()
            );
    }
    return true;
}

as well as the text "Request account" to page "MediaWiki:Requestaccount".

Minimal settings[edit | edit source]

To attempt to prevent spam, instead of captchas, blacklists and filters; manually moderate new user registrations, with a simpler Request account. Requesting only a username, email address and brief message. Add the following to LocalSettings.php after the line require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";.

 $wgMakeUserPageFromBio = false;
 $wgAutoWelcomeNewUsers = false;
 $wgConfirmAccountRequestFormItems = array(
        'UserName'        => array( 'enabled' => true ),
        'RealName'        => array( 'enabled' => false ),
        'Biography'       => array( 'enabled' => false, 'minWords' => 50 ),
        'AreasOfInterest' => array( 'enabled' => false ),
        'CV'              => array( 'enabled' => false ),
        'Notes'           => array( 'enabled' => true ),
        'Links'           => array( 'enabled' => false ),
        'TermsOfService'  => array( 'enabled' => false ),
 );

Optionally tweak system messages: requestaccount-text, requestaccount-notes, requestaccount-ext-text, requestaccount-acc-text.

Preventing empty userpage from being created[edit | edit source]

Change function createUserpage in extensions/ConfirmAccount/business/AccountConfirmSubmission.php, the last part to look like this:

 #Create userpage!
if( !empty($body) ) {  // <- new
 $article = new WIkiPage( ...
 $article->doEdit( ...
 }  // <- new

Known issues[edit | edit source]

  • Do not set $wgGroupPermissions['*']['createaccount'] to true in LocalSettings, it will override the request login and allow users to sign up without confirmation.
  • Do not set/create MediaWiki:Requestaccount-areas/xx where xx is a language code, the first part of each line is used as the keys to store in the DB for the items account requesters check.
  • Older versions of MediaWiki may not show the link to Special:RequestAccount at the user login form. You can edit MediaWiki:loginprompt to remedy this.
  • If your email client loses its mail data before sending it out, users will not get their passwords but may have an account. Since no one knows the passwords, you may want to use Extension:Password Reset to send them new ones.
  • If only a few people view the confirm accounts page, the randomly triggered pruning of old requests will not trigger often, so old rejected requests may persist.
  • Integration with LDAP Authentication extension

Troubleshooting[edit | edit source]

This error is avoided by using the MediaWiki 1.24+ updater, or the LocalisationUpdate extension in Mediawiki 1.23+.
Updating fails with Class 'ConfirmAccountUISetup' not found in extensions/ConfirmAccount/ConfirmAccount.php:42

→ Add require( __DIR__ . '/frontend/ConfirmAccountUI.setup.php' ); to line 41 in the "ConfirmAccount.php" file.

See also bug 55470 for detailed information on this.

See also[edit | edit source]