mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 13:35:20 -05:00
FEATURE: on initial boot hint users on how to get admin
This commit is contained in:
@@ -45,5 +45,9 @@ Discourse::Application.configure do
|
||||
|
||||
config.enable_anon_caching = false
|
||||
require 'rbtrace'
|
||||
|
||||
if emails = GlobalSetting.developer_emails
|
||||
config.developer_emails = emails.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Some sanity checking so we don't count on an unindexed column on boot
|
||||
if User.limit(20).count < 20 && User.where(admin: true).count == 1
|
||||
notice =
|
||||
if GlobalSetting.developer_emails.blank?
|
||||
"No developer email addresses defined, logging in <a href='https://meta.discourse.org/t/how-to-create-an-administrator-account-after-install/14046'>will be tricky.</a>"
|
||||
else
|
||||
emails = GlobalSetting.developer_emails.split(",")
|
||||
if emails.length > 1
|
||||
emails = emails[0..-2].join(' , ') << " or #{emails[-1]} "
|
||||
end
|
||||
"Please create an account or login with #{emails}"
|
||||
end
|
||||
|
||||
if notice != SiteSetting.global_notice
|
||||
SiteSetting.global_notice = notice
|
||||
SiteSetting.has_login_hint = true
|
||||
end
|
||||
|
||||
# we may be booting with no User table eg: first migration, just skip
|
||||
end rescue nil
|
||||
@@ -479,6 +479,9 @@ uncategorized:
|
||||
global_notice:
|
||||
default: ""
|
||||
client: true
|
||||
has_login_hint:
|
||||
default: false
|
||||
hidden: true
|
||||
|
||||
# Category IDs
|
||||
lounge_category_id:
|
||||
|
||||
Reference in New Issue
Block a user