refactoring credential checking and javascript files
added flag for warning page so it comes up when it should