手册:$wgInvalidUsernameCharacters

This page is a translated version of the page Manual:$wgInvalidUsernameCharacters and the translation is 80% complete.
Outdated translations are marked like this.
用户账户、身份验证: $wgInvalidUsernameCharacters
创建新账号时阻止的字符。
引进版本:1.15.0 (r48765)
移除版本:仍在使用
允许的值:(字符串)
默认值:'@:>=' (1.40+, git #78b03385)

'@:>' (1.39+, git #9d458f6d)
'@:' (1.26-1.38, git #9aa5cd1b)

'@' (1.15-1.25)

详情

创建新账号时阻止的字符。 这不影响任何现有用户。

@ 符号默认被禁止,因为MediaWiki在内部作为用户在另外一个Wiki的帐户(跨Wiki用户)所使用。 “:”符号被禁用,因为在不同的名字空间配置和跨Wiki配置方面,不同的Wiki上用户名的合法性有所不同。 如果您允许在用户名中使用"@"符号,您应该也对$wgUserrightsInterwikiDelimiter 进行设定。 否则,您将不能给用户名中包含"@"符号的用户通过正常方式授予不同权限(虽然仍然可以通过用户ID设置)。 但是,您可以自由地允许用户在用户名中使用":"只要您不用共享数据库Extension:CentralAuth运行多个wiki,且不创建使得现有用户名无效的新名字空间或跨维基前缀。

这在注册时将作为正则表达式字符类(像 / 的正则表达式字符将被转义)。

Apart from checking for the signs given in $wgInvalidUsernameCharacters, MediaWiki also checks other conditions, which can prevent a username from being allowed. For example IP addresses cannot be used as usernames and combinations of characters, which are not allowed in page names cannot be used either. 更多信息参见m:Help:Page name

The matchPattern and genPattern regular expressions in $wgAutoCreateTempUser will further restrict available usernames.

示例

若要阻止创建包含多个字符的用户名,可使用以下设置:

$wgInvalidUsernameCharacters = '@:>=#€';
Make sure that you always include the characters MediaWiki recommends to include by default.

另请参阅