The influence of supernovae and passing stars on comets in the Oort cloud