mirror of
https://github.com/neocities/neocities.git
synced 2025-04-28 11:12:30 +02:00
strengthen banning
This commit is contained in:
parent
4af4347492
commit
a64c123a8c
1 changed files with 5 additions and 3 deletions
8
app.rb
8
app.rb
|
@ -1546,8 +1546,9 @@ end
|
||||||
|
|
||||||
def require_login
|
def require_login
|
||||||
redirect '/' unless signed_in?
|
redirect '/' unless signed_in?
|
||||||
if current_site.is_banned || parent_site.is_banned
|
if session[:banned] || current_site.is_banned || parent_site.is_banned
|
||||||
session[:id] = nil
|
session[:id] = nil
|
||||||
|
session[:banned] = true
|
||||||
redirect '/'
|
redirect '/'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1567,9 +1568,10 @@ def parent_site
|
||||||
end
|
end
|
||||||
|
|
||||||
def require_unbanned_ip
|
def require_unbanned_ip
|
||||||
if Site.banned_ip?(request.ip)
|
if session[:banned] || Site.banned_ip?(request.ip)
|
||||||
session[:id] = nil
|
session[:id] = nil
|
||||||
flash[:error] = 'Your IP address has been banned due to misconduct/spam. '+
|
session[:banned] = true
|
||||||
|
flash[:error] = 'Site creation has been banned due to ToS violation/spam. '+
|
||||||
'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
|
||||||
|
|
Loading…
Add table
Reference in a new issue