Added check to make sure a user is logged in

Template will now make sure a user is logged in or else it will redirect
them to the login page