Autologin based on IP

I guess I did not explain very well what made it simpiler, there is no need for the flag bit. You could change the IP address for the DB query and it will still work.