mirror of
https://github.com/neocities/neocities.git
synced 2025-05-09 08:18:31 +02:00
fixes to banhammer
This commit is contained in:
parent
41b214b99f
commit
c68cbeb5a4
3 changed files with 5 additions and 3 deletions
3
app.rb
3
app.rb
|
@ -234,7 +234,8 @@ post '/admin/banhammer' do
|
||||||
|
|
||||||
DB.transaction {
|
DB.transaction {
|
||||||
FileUtils.mv site_base_path(site.username), File.join(settings.public_folder, 'banned_sites', site.username)
|
FileUtils.mv site_base_path(site.username), File.join(settings.public_folder, 'banned_sites', site.username)
|
||||||
site.update is_banned: true
|
site.is_banned = true
|
||||||
|
site.save(validate: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
flash[:success] = 'MISSION ACCOMPLISHED'
|
flash[:success] = 'MISSION ACCOMPLISHED'
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Site < Sequel::Model
|
||||||
errors.add :over_capacity, 'We are currently at capacity, and cannot create your home page. We will fix this shortly. Please come back later and try again, our apologies.'
|
errors.add :over_capacity, 'We are currently at capacity, and cannot create your home page. We will fix this shortly. Please come back later and try again, our apologies.'
|
||||||
end
|
end
|
||||||
|
|
||||||
if values[:username].nil? || values[:username].empty? || values[:username].match(BAD_USERNAME_REGEX) # || USERNAME_SHITLIST.include?(values[:username])
|
if new? && (values[:username].nil? || values[:username].empty? || values[:username].match(BAD_USERNAME_REGEX)) # || USERNAME_SHITLIST.include?(values[:username])
|
||||||
errors.add :username, 'A valid username is required.'
|
errors.add :username, 'A valid username is required.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -17,3 +17,4 @@
|
||||||
h2 Banned Terrorists
|
h2 Banned Terrorists
|
||||||
- @banned_sites.each do |banned_site|
|
- @banned_sites.each do |banned_site|
|
||||||
= banned_site.username
|
= banned_site.username
|
||||||
|
br
|
||||||
|
|
Loading…
Add table
Reference in a new issue