Moved login functionality to whole site, only works with index.php currently though