Do you currently have a database table containing user details? If so, you could add "lastlogon timestamp" and "lastlogon ip" fields to that record. Then when someone attempts to login, you compare the current time and the source IP to the ones you have on record. If everything is ok, update the record, and complete the login.
Just be careful with your logic. You don't want to lockout someone just because his dialup connection fell over and he had to reconnect, thereby getting a new IP.