mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
safety check
This commit is contained in:
parent
f7933061d4
commit
1035123076
1 changed files with 5 additions and 0 deletions
5
app.rb
5
app.rb
|
@ -417,6 +417,11 @@ post '/admin/banip' do
|
|||
redirect '/admin'
|
||||
end
|
||||
|
||||
if site.ip.nil? || site.ip.empty?
|
||||
flash[:error] = 'IP is blank, cannot continue'
|
||||
redirect '/admin'
|
||||
end
|
||||
|
||||
sites = Site.filter(ip: site.ip).all
|
||||
sites.each {|site| ban_site site.username}
|
||||
flash[:error] = "#{sites.length} sites have been banned."
|
||||
|
|
Loading…
Add table
Reference in a new issue