I have an existing application with many models. I would like to register the IP address of the user who created them, with the main goal to help get rid of spam or other abusive users (if I do not know what IP addresses they use, I can’t block it). I will need to track them over time, when users can access from home, office, phone, etc., And I would like to see usage patterns. It may also be interesting to talk about where users visit or something like that, but any side effects are purely thinking at the moment.
We use a cookie-based user session storage method.
I can imagine two ways to do this (I will create them as answers so that people can vote):
- Add an IP address attribute for each model and pass this to
- Some Logger Model Called by Observer or After_save Callback
Thoughts? Are there any better ways? Plugins that do this? Thanks!!
source
share