mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
sanity check for banning sites
This commit is contained in:
parent
aab39212ef
commit
b786df44d1
1 changed files with 4 additions and 0 deletions
|
@ -195,6 +195,10 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
def ban!
|
||||
if username.nil? || username.empty?
|
||||
raise 'username is missing'
|
||||
end
|
||||
|
||||
DB.transaction {
|
||||
FileUtils.mv files_path, File.join(PUBLIC_ROOT, 'banned_sites', username)
|
||||
self.is_banned = true
|
||||
|
|
Loading…
Add table
Reference in a new issue