add ip of site creators so we can block spammers

This commit is contained in:
Kyle Drake 2013-06-24 12:49:24 -07:00
parent 3108ffb516
commit 4b82bdec2e
2 changed files with 10 additions and 1 deletions

2
app.rb
View file

@ -54,7 +54,7 @@ end
post '/create' do
dashboard_if_signed_in
@site = Site.new username: params[:username], password: params[:password], email: params[:email], new_tags: params[:tags], is_nsfw: params[:is_nsfw]
@site = Site.new username: params[:username], password: params[:password], email: params[:email], new_tags: params[:tags], is_nsfw: params[:is_nsfw], ip: request.ip
recaptcha_is_valid = recaptcha_valid?

View file

@ -0,0 +1,9 @@
Sequel.migration do
up {
DB.add_column :sites, :ip, :text
}
down {
DB.add_column :sites, :ip
}
end