  We use quantum Monte Carlo simulations with the worm algorithm to study the
phase diagram of a two-dimensional Bose-Hubbard model with cavity-mediated
long-range interactions and uncorrelated disorder in the hard-core limit. Our
study shows the system is in a supersolid phase at weak disorder and a
disordered solid phase at stronger disorder. Due to long-range interactions, a
large region of metastable states exists in both clean and disordered systems.
By comparing the phase diagrams for both clean and disordered systems, we find
that disorder suppresses metastable states and superfluidity. We compare these
results with the phase diagram of the extended Bose-Hubbard model with
nearest-neighbor interactions. Here, the supersolid phase does not exist even
at weak disorder. We identify two kinds of glassy phases: a Bose glass phase
and a disordered solid phase. The glassy phases intervene between the
density-wave and superfluid phases as the Griffiths phase of the Bose-Hubbard
model. The disordered solid phase intervenes between the density-wave and Bose
glass phases since both have a finite structure factor.
