Removed two global variabes $ip and $loc. Fixed admin login and some oth...

...er stuff.