mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
Support for a new site setting: newuser_spam_host_threshold
. If a new user posts a link
to the same host enough tiles, they will not be able to post the same link again. Additionally, the site will flag all their previous posts with links as spam and they will be instantly hidden via the auto hide workflow.
This commit is contained in:
parent
04b8cd5c95
commit
d554a59102
19 changed files with 355 additions and 75 deletions
|
@ -73,6 +73,12 @@ module Discourse
|
|||
end
|
||||
end
|
||||
|
||||
# Either returns the system_username user or the first admin.
|
||||
def self.system_user
|
||||
user = User.where(username_lower: SiteSetting.system_username).first if SiteSetting.system_username.present?
|
||||
user = User.admins.order(:id).first if user.blank?
|
||||
user
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue