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:
Robin Ward
2013-05-10 16:58:23 -04:00
parent 04b8cd5c95
commit d554a59102
19 changed files with 355 additions and 75 deletions

View File

@ -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