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
|
def require_unbanned_ip
|
||||||
if session[:banned] || Site.banned_ip?(request.ip)
|
if session[:banned] || Site.banned_ip?(request.ip)
|
||||||
signout
|
signout
|
||||||
session[:banned] = true
|
session[:banned] = request.ip if !session[:banned]
|
||||||
flash[:error] = 'Site creation has been banned due to ToS violation/spam. '+
|
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>.'
|
'If you believe this to be in error, <a href="/contact">contact the site admin</a>.'
|
||||||
return {result: 'error'}.to_json
|
return {result: 'error'}.to_json
|
||||||
end
|
end
|
||||||
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
|
def title
|
||||||
out = "Neocities"
|
out = "Neocities"
|
||||||
return out if request.path == '/'
|
return out if request.path == '/'
|
||||||
|
|
Loading…
Add table
Reference in a new issue