Removed two global variabes $ip and $loc. Fixed admin login and some other stuff.
Merge pull request #90 from ernstchan/bugfixes

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