Photoionising shocks in SNRs and AGN