Kat_F
(Kat F)
2019 年8 月 10 日 02:33
1
On our main site there are often people who use underscores and dashes in usernames. When they are ported to our Discourse forum, one or more of those characters is often dropped from the username, resulting in a mismatch.
The forum is provided for the site users only and being able to correlate between the usernames is important.
Examples:
kayakaya_ becomes kayakaya
__aena13 becomes _aena13
At present we haven’t figured out how to either automatically delete or disable forum accounts when the mains are closed or at least generate a report. Is that possible?
The usernames are being auto-edited to reflect the Discourse rules for usernames.
Kat_F
(Kat F)
2019 年8 月 10 日 02:41
3
That’s pretty much what I figured. Thankfully we have found a place that keeps the actual username intact.
Falco
(Falco)
2019 年8 月 10 日 02:44
4
We recently added two site settings which allow you to permit more characters in the username
Lifting the restrictions on allowed characters in usernames is one of the oldest feature requests. Starting with Discourse 2.3.0.beta9 it’s finally possible to use Unicode characters within usernames and group names.
[image]
New Site Settings
There are two new site settings: allowed unicode username characters and unicode usernames.
allowed unicode username characters allows you to allow only certain Unicode characters (e.g. [äöüßÄÖÜẞ] or \p{Greek}). By default Discourse permits letters (Ll …
Did you try tweaking those?
Kat_F
(Kat F)
2019 年8 月 10 日 02:46
5
We’ll take a look at that and see if it helps. Thank you.
我们在 SSO 方面也遇到了同样的问题,用户名被转换了。
我之前在 这里 提到过这个问题,但这个话题更新一些——也许有人可以查看一下。
随着对用户名和组名引入 Unicode 支持,现在可以使用像 中国 这样的用户名(这很棒!),但 Discourse 不允许用户名以连字符开头或结尾(但下划线等符号是可以的)。
禁止在首尾位置使用连字符有什么原因吗?如果这样做没有明显的弊端,是否有机会修订这一政策?/cc @Falco
Kat_F
(Kat F)
2020 年2 月 3 日 16:54
7
当用户输入特殊字符时,情况会变得复杂,因为他们想要的用户名已被占用。
Falco
(Falco)
2020 年2 月 3 日 16:54
8
您可以尝试在自定义插件中覆盖这些规则,并先使用几周。如果在正常的 Discourse 使用中未出现问题,请提交拉取请求。
我试着做了尝试,成功实现了用户名前后带连字符的功能,包括在提及(mentions)中也能正常工作。
但在用户名前后带下划线的情况下就没那么幸运了。因为在消息编辑器中,Markdown 解析器的优先级似乎高于 @提及 :用户名被渲染成了斜体,而不是链接。
目前我在这方面有些卡住,不确定该从哪里入手解决。有什么建议吗?@Falco