fdanard
(Franck Danard)
2021 年6 月 17 日 08:42
1
Hi Everyone.
I’m newbe on Discourse, and I must to change something in Login page but I don’t know where is the target and is content.
The URL looks like this: my.domain.com/auth/crowd and I get a Login page but I’m not able to edit its content.
I saw something in the discourse conf file (crowd_custom_html ) but the content is not really the same as displayed on the page.
I wonder where I can change this content.
Also, I checked if there were any redirection on /auth/crowd , Nothing (I guess).
Is someone can help me please?
Thanks
Franck
Your discourse is probably using Atlassian Crowd for sso
You should check the crowd documentation for any changes to your login page.
2 个赞
fdanard
(Franck Danard)
2021 年11 月 30 日 10:31
4
在进一步深入研究代码后(我不会 Ruby),看起来代码中有某些内容阻止了 HTML 内容。
else
OmniAuth.config.form_css << GlobalSetting.crowd_custom_css
end
end
OmniAuth::Form.build(title: (GlobalSetting.try(:crowd_popup_title) || GlobalSetting.try(:crowd_title) || "Crowd Authentication")) do
text_field 'Username', 'username'
password_field 'Password', 'password'
html "\n<input type='hidden' name='authenticity_token' value='#{token}'/>" if token
button 'Login'
if GlobalSetting.respond_to?(:crowd_custom_html)
html GlobalSetting.crowd_custom_html
end
end.to_response
end
end
omniauth.provider :crowd,
name: 'crowd',
crowd_server_url: GlobalSetting.try(:crowd_server_url),
application_name: GlobalSetting.try(:crowd_application_name),
application_password: GlobalSetting.try(:crowd_application_password)
我想这可能是设置 DISCOURSE_CROWD_CUSTOM_HTML 的原因:这将在此处显示内容?
1 个赞
david
(David Taylor)
2021 年11 月 30 日 13:50
5
是的,这应该可行——您应该在 app.yml 文件中配置 DISCOURSE_CROWD_CUSTOM_HTML 环境变量。
fdanard
(Franck Danard)
2021 年11 月 30 日 13:52
6
不幸的是,它不起作用。
也许内容必须用引号括起来?
目前,内容没有用引号括起来。
david
(David Taylor)
2021 年11 月 30 日 15:17
7
是的,我刚刚在本地试了一下,看起来我们在解析包含引号的 GlobalSetting 值时遇到了一些问题(自定义 HTML 几乎总是包含引号)。我刚刚推送了这个变通方法:
committed 03:11PM - 30 Nov 21 UTC
The discourse.conf file doesn't handle strings with single quotes in them. There… fore we can't use the GlobalSetting interface, and need to reach directly for the ENV.
Not ideal, and can possibly be improved in future updates of 'launcher', and the discourse.conf file. For now, this commit will solve the issue for this plugin.
如果更新你的站点,现在应该会好很多。这是我现在可以正常工作的示例值:
DISCOURSE_CROWD_CUSTOM_HTML: "<a href='https://example.com' style='display: block; margin: 0.5em 0; text-align: center'>Sign up for an example.com account!</a><a style='display: block; text-align: center' href='https://example.com/forgot_password'>Forgot Password</a>"
fdanard
(Franck Danard)
2021 年11 月 30 日 15:21
8
非常感谢你,大卫。
我明天会更新网站。
现在就做吧,现在不是好时机。
我可以通过图形用户界面(GUI)更新网站吗?
我会通知你。
1 个赞
david
(David Taylor)
2021 年11 月 30 日 15:25
9
fdanard:
我能通过GUI更新网站吗?
如果你不更改 app.yml 中的值,那么你应该可以通过 /admin/upgrade 来升级 discourse-crowd 插件。
david
(David Taylor)
2021 年11 月 30 日 15:28
11
这与其他任何更新都一样——更新运行时可能会有几秒钟/几分钟的停机/缓慢。如果可能,最好等到您的网站访问量较低时再进行更新。
fdanard
(Franck Danard)
2021 年11 月 30 日 15:45
13
@david 请教一个问题。
我看到有 crowd_popup_title 和 crowd_title 。
它们之间的区别是,前者显示在弹出窗口中,后者显示在整页中,对吗?
david
(David Taylor)
2021 年11 月 30 日 15:51
14
“popup”一词有点过时了。我们不再使用弹出窗口进行身份验证,因此该值实际上用作身份验证期间选项卡的 <title>:
(即,这部分:)
crowd_title 用作登录按钮上的标签(如果您启用了多种登录方法)。
如果您不提供 crowd_popup_title,则 crowd_title 将用于登录选项卡的 <title>。
fdanard
(Franck Danard)
2021 年11 月 30 日 15:55
15
好的。
我这么说是因为,确实,更新后没有用于登录的弹出窗口。我们现在有一个完整的登录页面。
顺便说一句,有没有办法自定义这个页面,比如背景……等等?
1 个赞
david
(David Taylor)
2021 年11 月 30 日 16:35
16
是的,您可以使用 DISCOURSE_CROWD_CUSTOM_CSS 向页面添加自定义 CSS 规则。
1 个赞
system
(system)
关闭
2021 年12 月 31 日 08:04
18
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.