  A disordered mean field model for multimode laser in open and irregular
cavities is proposed and discussed within the replica analysis. The model
includes the dynamics of the mode intensity and accounts also for the possible
presence of a linear coupling between the modes, due, e.g., to the leakages
from an open cavity. The complete phase diagram, in terms of disorder strength,
source pumping and non-linearity, consists of four different optical regimes:
incoherent fluorescence, standard mode locking, random lasing and the novel
spontaneous phase locking. A replica symmetry breaking phase transition is
predicted at the random lasing threshold. For a high enough strength of
non-linearity, a whole region with nonvanishing complexity anticipates the
transition, and the light modes in the disordered medium display typical
discontinuous glassy behavior, i.e., the photonic glass has a multitude of
metastable states that corresponds to different mode-locking processes in
random lasers. The lasing regime is still present for very open cavities,
though the transition becomes continuous at the lasing threshold.
