Extension:ConfirmAccount
![]() 发行状态: 穩定版 |
|
---|---|
![]() |
|
实现 | 用户身份 , 数据库 , 特殊页面 |
描述 | Requires submission and approval of accounts. |
作者 | Aaron Schulz讨论 |
兼容性政策 | 快照跟随MediaWiki发布。 master分支不向后兼容。 |
MediaWiki | >= 1.37.0 |
数据库更改 | 是 |
表 | account_requests account_credentials |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下載 | README |
|
|
季度下載量 | 243 (Ranked 39th) |
正在使用的公开wiki数 | 953 (Ranked 279th) |
前往translatewiki.net翻譯ConfirmAccount扩展 | |
問題 | 开启的任务 · 报告错误 |
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 管理员 /Bureaucrats to be able to directly make them) by configuring 手册:用户权限 .
The ConfirmEdit extension can be used (in conjunction with the ConfirmAccount extension) in order to use captchas to stop flood requests (since version 1.39).
安裝
- 下载文件,并将其放置在您
extensions/
文件夹中的ConfirmAccount
目录内。 - 将下列代码放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'ConfirmAccount' ); $wgGroupPermissions['*']['createaccount'] = false; // <span lang="en" dir="ltr" class="mw-content-ltr">REQUIRED to enforce account requests via this extension</span> $wgGroupPermissions['bureaucrat']['createaccount'] = true; // <span lang="en" dir="ltr" class="mw-content-ltr">optional to allow account creation by this trusted user group</span>
- 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
- Further configure as required.
- Ensure the wiki has write permissions on
$wgUploadDirectory
.
- Please also note the known issues, because they may affect your wiki.
完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。
配置
Optional
There are several configuration variables that can be adjusted in LocalSettings.php , after wfLoadExtension('ConfirmAccount');
See part "config"
in extension.json for all the variables that can be set.
$wgMakeUserPageFromBio = false;
$wgConfirmAccountRequestFormItems['Biography']['enabled'] = false;
$wgConfirmAccountRequestFormItems['Biography']['minWords'] = 10;
For example:
$wgWhitelistRead = [
'Special:RequestAccount',
'Main Page'
];
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.
最小的
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 = [
'UserName' => [ 'enabled' => true ],
'RealName' => [ 'enabled' => false ],
'Biography' => [ 'enabled' => false, 'minWords' => 50 ],
'AreasOfInterest' => [ 'enabled' => false ],
'CV' => [ 'enabled' => false ],
'Notes' => [ 'enabled' => true ],
'Links' => [ 'enabled' => false ],
'TermsOfService' => [ 'enabled' => false ],
];
Optionally tweak system messages: requestaccount-text, requestaccount-notes, requestaccount-ext-text, requestaccount-acc-text.
用法
- As a bureaucrat (or other user with the confirmaccount permission), browse to
Special:ConfirmAccounts
- Click Review
- You will see the whole form with the users' data.
Carefully review the form, and proceed to creating the account or rejecting the request.
- 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.
- After an account is created, the data input by the user at the time of the request can be referred to by typing the username at
Special:UserCredentials
LocalSettings.php
:
$wgConfirmAccountContact = 'Bureaucrat@domain.com';
Sending notification email to multiple users
This extension allows sending emails to multiple approvers to confirm the account if these users have the confirmaccount-notify
permission.
This is in addition/alternative to the $wgConfirmAccountContact
setting.
This can be achieved (for instance for bureaucrats) by providing them this permission by adding the following to the LocalSettings.php file:
$wgGroupPermissions['bureaucrat']['confirmaccount-notify'] = true;
增强
Pruning Frequency
To combat robot-requests, default settings prevent rejected email accounts from re-requesting an account for a random period of time after rejection. If you want rejected emails to be able to re-request accounts immediately after rejection, or after a fixed wait-time (days, weeks, months, or even years after rejection), apply the following 2 steps:
1) In the "LocalSettings.php" file, after required declaration, set Rejected-Age to 0 (for immediate expiration on rejection), or to your desired wait-time, in seconds:
wfLoadExtension( 'ConfirmAccount' );
$wgRejectedAccountMaxAge = 0;
2) Add one line to the file /frontend/specialpages/actions/RequestAccount_body.php
at the very end of the function showForm()
which shows the Request form, to force pruning right before any new request:
原始代码:
$out->addWikiMsg( 'requestaccount-footer' );
}
新代码:
$out->addWikiMsg( 'requestaccount-footer' );
# PRUNE
ConfirmAccount::runAutoMaintenance();
}
“请求帐户”链接
如果您想添加“请求帐户”登录链接,該擴展程序已經為您添加了它。 However, if that doesn't work, you will need to update to the latest version of your branch of ConfirmAccount from Git. For instance, if you are using MediaWiki 1.35, you should stay on the REL1_35 branch but pull from Git to retrieve the latest changes.
已知问题
- If
$wgEmailConfirmToEdit = true;
is set users will need to confirm their email twice before being able to edit. See 任务T182337 for further information.
- 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 Special:ResetPassword 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.
This prevents email addresses from re-requesting accounts for an unknown time period. You can override this behavior, and allow immediate re-requests, by forcing prune right before any new Request is submitted. Instructions here.
- [solved] Captcha: before version 1.39, the captcha was not validated (see 任务T168783), there was only a specific patch for hCaptcha (see Topic:W449yd63slfossl2#flow-post-w457lxnfmrb51gct).
问题定位
- 通知邮件不会发送
If you are testing, note that a user must first confirm their email address through the link emailed to them, and then the email will be sent to the bureaucrat to confirm the account.
Make sure that setting(s) related to extension are introduced after the require_once line. Not before, otherwise extension doesn't see these settings and they fail silently. e.g.
wfLoadExtension( 'ConfirmAccount' );
$wgConfirmAccountContact = "admin@example.com";
Also note that when using the 'confirmaccount-notify' setting, that each user in the group (e.g. sysop) will not receive notices unless their 电子邮件选项 in Special:Preferences allow "允许其他用户向我发送电子邮件" and that they have confirmed their email address within the same form.
参见
- Extension:InviteSignup, for administrator-initiated (mass) account creation
- TwnMainPage extension, offering a "sandbox" where user can create an unprivileged account, propose some edits and ask approval
![]() | 此扩展在以下wiki农场/托管网站和/或软件包中提供: 這不是一份權威名單。 即使某些wiki农场/托管网站和/或软件包未在这里列出,它们也可能提供此扩展。 请检查你的wiki农场/托管网站或软件包以确认提供情况。 |
- Stable extensions/zh
- User identity extensions/zh
- Database extensions/zh
- Special page extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- AdminLinks extensions/zh
- AuthChangeFormFields extensions/zh
- BeforePageDisplay extensions/zh
- LoadExtensionSchemaUpdates extensions/zh
- SkinTemplateNavigation::Universal extensions/zh
- SpecialPageBeforeExecute extensions/zh
- UserCreateForm extensions/zh
- UserLoginForm extensions/zh
- All extensions/zh
- Extensions included in BlueSpice/zh
- Extensions included in Canasta/zh
- Extensions included in MyWikis/zh