Cleaned up check login

put the check into a different file. Now can be used with a php include