What about matching the ip to the username you connect with. From there on, take info from the ip?
Edit: And.. that's a lot like what Mael said. Ignore the above :)
Edit: And.. that's a lot like what Mael said. Ignore the above :)