mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
More signup reporting
This commit is contained in:
parent
eba8a307bd
commit
ec4a3b4440
1 changed files with 13 additions and 2 deletions
|
@ -41,13 +41,24 @@ end
|
|||
def require_unbanned_ip
|
||||
if session[:banned] || Site.banned_ip?(request.ip)
|
||||
signout
|
||||
session[:banned] = true
|
||||
flash[:error] = 'Site creation has been banned due to ToS violation/spam. '+
|
||||
session[:banned] = request.ip if !session[:banned]
|
||||
send_banned_report
|
||||
flash[:error] = 'Site creation has been banned due to a Terms of Service violation. '+
|
||||
'If you believe this to be in error, <a href="/contact">contact the site admin</a>.'
|
||||
return {result: 'error'}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
def send_banned_report
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
reply_to: 'contact@neocities.org',
|
||||
to: 'errors@neocities.org',
|
||||
subject: "[Neocities] Ban report",
|
||||
body: "IP: #{request.ip}\n\nSession: #{session.inspect}\n\nParams:#{params.inspect}"
|
||||
})
|
||||
end
|
||||
|
||||
def title
|
||||
out = "Neocities"
|
||||
return out if request.path == '/'
|
||||
|
|
Loading…
Add table
Reference in a new issue