A few years ago, I went to replace the tub faucets in our home. I went into the bedroom next to the bathroom and pulled off the panel that lets me access the plumbing behind the tub. (If you need to check if you have a removable 'panel' in the room/closet next to the bathroom, please do this first.) Lo and behold, no shut-offs in there. And from what I understand, this is not uncommon. So, the next thing to do was to go down the basement and find the water pipes that went to the 2nd floor. I started this by following the MAIN that comes into the house, and by the process of elimination, shut off a pair of hot & cold valves 2-at-a-time until the tub water shut off. The bad news wasn't that there weren't any shut-offs behind the panel in the room next to the bathroom. The bad news was the hot & cold shut-offs that did shut the water off to the tub ALSO shut off the water to the sink and toilet in the bathroom, PLUS, the 3/4 bath in the master bedroom! Basically, it shut down all the plumbing that went to the 2nd floor. Other than puting shut-offs in behind the tub, there wasn't any other way to shut off water to the tub. For what little 'need' there was to do this, I left well enough alone. :(
As far as what to do about the unit coming off the wall, I can't be of much help on what you should do. Reason being is I'll bet that either some moisture got back there and has softened up the wall, and the 'gravity' of the unit pulled away from the wall. If this is the case, repair needs to be properly done so the unit doesn't pull off the wall again. Or, it's possible that just the installation of the unit was poor to begin with. All I can stress is that if you're planning on doing this repair yourself, you look into the proper way to repair a bathroom wall. The bathroom is a high humidity room and due diligence should be used. You only want to do this job once, and do it right. Also, before you do any repair, see if there is any wall or wall-cavity prep you should do that will help in keeping the unit ON the wall. Someone might suggest cross-studs, for example, to mount the unit to for more strength. (You'll need to be sure of where something like this should go in the wall cavity.) And insullation too.
I'll be watching this post to see what others might have to say. If you need more help, go to Plumber's Advice Forum. If you have more 'facts' like wall condition, brand of shower, etc., etc., do provide them. Best of luck.