Log the IP address used to create an account.
This commit is contained in:
parent
caa20ccc40
commit
2ccbc55236
2 changed files with 10 additions and 0 deletions
|
@ -16,6 +16,7 @@ class UserController < ApplicationController
|
|||
@user.visible = true
|
||||
@user.data_public = true
|
||||
@user.description = "" if @user.description.nil?
|
||||
@user.creation_ip = request.remote_ip
|
||||
|
||||
if @user.save
|
||||
flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
|
||||
|
|
9
db/migrate/016_add_creation_ip.rb
Normal file
9
db/migrate/016_add_creation_ip.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class AddCreationIp < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column "users", "creation_ip", :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column "users", "creation_ip"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue