防止外部用户更新或添加 Wiki 页面
Prevent External Users from Updating or adding Wiki Pages
几年前,我使用 mediawiki 创建了一个 wiki。我曾经(仍然)不知道如何管理它。我希望只有我自己 maintained/updated。它是为我的用户保存一组特定的信息。
几周后,它充斥着用户提交的页面(在这种情况下不是一件好事),我猜你会怎么称呼 "spammers"(?)。
我如何设置它以便只有合法的管理员(我)才能 add/update 页面?
我以为我已经启用了一些东西来做到这一点......但它显然不起作用。
在 MediaWiki 中,可以通过在 LocalSettings.php 文件中配置 $wgGroupPermissions 数组来授予或拒绝权限(阅读、编辑、创建页面等)。
有一组默认组,您可以使用 $wgGroupPermissions 来限制页面 creation/editing:
* - all users (including anonymous)
user - registered accounts
autoconfirmed - registered accounts at least as old as $wgAutoConfirmAge and having at least as many edits as $wgAutoConfirmCount
bot - accounts with the bot right (intended for automated scripts)
sysop - users who by default can delete and restore pages, block and unblock users, et cetera
bureaucrat - users who by default can change other users' rights
仅适用于您(作为 wiki 的创建者)的组是 sysop 组。
例如,要拒绝除 sysop 组以外的所有用户的 createpage/edit 权限,您可以将其放在 LocalSettings.php:
# Deny createpage and edit rights to all users
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['edit'] = false;
# Allow only users with the sysop group createpage and edit rights
$wgGroupPermissions['sysop']['createpage'] = true;
$wgGroupPermissions['sysop']['edit'] = true;
“*”字符表示该规则将适用于所有组。然后,我们为“sysop”组添加该规则的例外,允许该组的用户创建或编辑页面。
几年前,我使用 mediawiki 创建了一个 wiki。我曾经(仍然)不知道如何管理它。我希望只有我自己 maintained/updated。它是为我的用户保存一组特定的信息。
几周后,它充斥着用户提交的页面(在这种情况下不是一件好事),我猜你会怎么称呼 "spammers"(?)。
我如何设置它以便只有合法的管理员(我)才能 add/update 页面?
我以为我已经启用了一些东西来做到这一点......但它显然不起作用。
在 MediaWiki 中,可以通过在 LocalSettings.php 文件中配置 $wgGroupPermissions 数组来授予或拒绝权限(阅读、编辑、创建页面等)。
有一组默认组,您可以使用 $wgGroupPermissions 来限制页面 creation/editing:
* - all users (including anonymous)
user - registered accounts
autoconfirmed - registered accounts at least as old as $wgAutoConfirmAge and having at least as many edits as $wgAutoConfirmCount
bot - accounts with the bot right (intended for automated scripts)
sysop - users who by default can delete and restore pages, block and unblock users, et cetera
bureaucrat - users who by default can change other users' rights
仅适用于您(作为 wiki 的创建者)的组是 sysop 组。
例如,要拒绝除 sysop 组以外的所有用户的 createpage/edit 权限,您可以将其放在 LocalSettings.php:
# Deny createpage and edit rights to all users
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['edit'] = false;
# Allow only users with the sysop group createpage and edit rights
$wgGroupPermissions['sysop']['createpage'] = true;
$wgGroupPermissions['sysop']['edit'] = true;
“*”字符表示该规则将适用于所有组。然后,我们为“sysop”组添加该规则的例外,允许该组的用户创建或编辑页面。