I think disabling the leave Clan button during a clan war is a wonderful idea
As a clan Co-leader I'd like to be able to see who in a clan made attacks in a war (one, two or NONE) at a glance on the war events page, and also
on the clan list so I don't need to keep paper records of who's helping and who is doing nothing, inactive, missing or just a parasite.
As for levels in farming, I'm not sure your idea will work allowing people to only attack same or higher levels.
What determines that now is a 200trophy rule you can only attack someone within 200 trophys of your score, the problem with that is we get people dropping down levels, either intentionally for easier attacks, or because they've been away from the game for weeks (or longer) and they've lost trophy count through being farmed themselves...
If they were only allowed to attack same or higher TH level players
there is a strong chance they'd be "Trapped" at that lower trophy count