在 MediaWiki 中如何限制只有註冊用戶才可以編輯

本功能也適用於 1.7.1 版本。

在 MediaWiki 中如何限制只有註冊用戶才可以編輯?

假如正在用 MediaWiki 1.5.6
在 LocalSettings.php 中插入以下代碼:

/**
* Permission keys given to users in each group.
* All users are implicitly in the '*' group including anonymous visitors;
* logged-in users are all implicitly in the 'user' group. These will be
* combined with the permissions of all groups that a given user is listed
* in in the user_groups table.
*
* This replaces wgWhitelistAccount and wgWhitelistEdit
*
* 將許可關鍵字應用到每個組的用戶中.
* 隱含條件下, 所有的用戶都在'*'組, 其中包括匿名用戶.
* 所有登錄用戶隱含地在'user'組中. 這些將作用在用戶群
* 組表中所有群組的許可權限.
*
* 這會替換 wgWhitelistAccount 和 wgWhitelistEdit
*/
$wgGroupPermissions = array();

$wgGroupPermissions['*' ]['createaccount'] = true;
$wgGroupPermissions['*' ]['read'] = true;
$wgGroupPermissions['*' ]['edit'] = false;

$wgGroupPermissions['user' ]['move'] = true;
$wgGroupPermissions['user' ]['read'] = true;
$wgGroupPermissions['user' ]['edit'] = true;
$wgGroupPermissions['user' ]['upload'] = true;
$wgGroupPermissions['user' ]['createpage'] = true;

$wgGroupPermissions['bot' ]['bot'] = true;

$wgGroupPermissions['sysop']['block'] = true;
$wgGroupPermissions['sysop']['createaccount'] = true;
$wgGroupPermissions['sysop']['delete'] = true;
$wgGroupPermissions['sysop']['editinterface'] = true;
$wgGroupPermissions['sysop']['import'] = true;
$wgGroupPermissions['sysop']['importupload'] = true;
$wgGroupPermissions['sysop']['move'] = true;
$wgGroupPermissions['sysop']['patrol'] = true;
$wgGroupPermissions['sysop']['protect'] = true;
$wgGroupPermissions['sysop']['rollback'] = true;
$wgGroupPermissions['sysop']['upload'] = true;

$wgGroupPermissions['bureaucrat']['userrights'] = true;
// Used by the Special:Renameuser extension
$wgGroupPermissions['bureaucrat']['renameuser'] = true;

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *