Manual:$wgWhitelistRead/zh

From Linux Web Expert

Revision as of 23:21, 29 June 2023 by 36.225.126.182 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<translate> User rights, access control and monitoring</translate>: $wgWhitelistRead
一些匿名用户能够阅读的页面。
<translate> Introduced in version:</translate>1.1.0
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>一组页面名称,或者为false
<translate> Default value:</translate>false
File:OOjs UI icon notice-destructive.svg <translate> Warning:</translate> <translate> MediaWiki from 1.32 to 1.35.4, 1.36.2, 1.37.0 contain a security issue that allow unprivileged editing of arbitrary page and arbitrary JavaScript execution.</translate> <translate> If you are using one of these versions and can not upgrade to a newer version, please see <tvar name=1>2021-12安全发布/常见问题解答 </tvar> for a workaround.</translate>

详情

如果有个用户组的用户被$wgGroupPermissions 设置为禁止访问wiki…

$wgGroupPermissions[...]['read'] = false;

…你或许仍然希望他们能够浏览关键页面,尤其是登录页! 此设置包含所有用户都可以查看的一组页面的名称,无论其用户组权限如何。

建议至少允许所有人访问主页和登录页以及加载的自定义的CSS和JS,如下所示:

MediaWiki ≥ 1.18.1[1]
$wgWhitelistRead = [
    'Main Page',
    'MediaWiki:Common.css',
    'MediaWiki:Common.js'
    ];
"Main Page"应在两个词之间使用空格而不是下划线。
File:OOjs UI icon notice-destructive.svg <translate> Warning:</translate> 如果你的内容语言不是英语,你或许需要用翻译过的特殊页面的名称来替代英文的名称。

另请参阅

參考資料

  1. 自此r105428开始“Special:PasswordReset”将总是视为白名单,就像“Special:UserLogin”与“Special:ChangePassword”一样。