I have a SilverStripe site where users have to pay a subscription fee in order to be able to view the site content.
I would like to log user's IP addresses when they access the site, so that in future I can detect if a user is logging in for different IP addresses at the same time, which would be an indication this user has given their login details to another party.
What is the best way to go about doing this? I presume I have 2 choices, log IP upon login or upon visiting, I believe "LastVisited" updates every time a user changes pages, so would that add too much overhead if I was logging their IP each time too?
Either way, how can I perform an action upon "login" and upon "visited"?