Making registration for media wiki require admin approval?

偶尔善良 提交于 2019-12-04 09:55:19

You could create a new user right, e.g. "approved", allow admins to assign that right and restrict things like editing to only approved users, like this:

// Disallow editing and uploading from anons and registered users
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = false;

// New user group: approved users
$wgGroupPermissions['approved']['edit'] = true;

// Allow admins to approve (and unapprove) users via Special:UserRights
$wgAddGroups['sysop']['approved'] = true;
$wgRemoveGroups['sysop']['approved'] = true;

Note that removing the edit permission also stops non-approved users from doing most things that directly or indirectly involve changing pages in any way, so you shouldn't need to revoke those rights explicitly.

Also, instead of revoking editing rights from unapproved users completely, you could restrict their editing to certain namespaces using $wgNamespaceProtection (and perhaps further to certain pages in those namespaces using normal per-page protection), something like this:

// Limit editing of the main namespace to approved users
$wgNamespaceProtection[NS_MAIN] = array( 'edit-main' );
$wgGroupPermissions['approved']['edit-main'] = true;

That way, you could set up a page where new users can ask to be approved in one of the namespaces they can edit.

For more information, see Manual:User rights and Help:Assigning permissions on mediawiki.org.

If you're willing to install an extension then Extension:ConfirmAccount would be the best solution for you.

"The ConfirmAccount extension disables direct account creation and requires the approval of new accounts by a bureaucrat"

This means that new users are clearly told within the interface, that they are requesting a user account. It also presents a specially designed interface to the administrators, for approving the requests, and will email somebody (configured email address $wgConfirmAccountContact) when somebody's waiting.

Although spammers can still irritate you a little by requesting accounts (use in conjunction with ConfirmEdit captcha is recommended), they will not be getting as far as actually creating junk user accounts.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!