From a64c123a8cf650912d224c1911d532af79670ef7 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 9 Nov 2014 16:59:10 -0800 Subject: [PATCH] strengthen banning --- app.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app.rb b/app.rb index 338c0dcd..999ac4cc 100644 --- a/app.rb +++ b/app.rb @@ -1546,8 +1546,9 @@ end def require_login 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[:banned] = true redirect '/' end end @@ -1567,9 +1568,10 @@ def parent_site end def require_unbanned_ip - if Site.banned_ip?(request.ip) + if session[:banned] || Site.banned_ip?(request.ip) 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, contact the site admin.' return {result: 'error'}.to_json end