killmeplease
Mk Z on Steam
This is just great 
Even more so as i need exactly this for my ZOC mod, i mean "right of passage" diplomacy option.
Afforess
I haven't tried Advanced Diplomacy yet maybe things described below are already realized..
My suggestion is:
for a given civ to cancel automatically open borders agreement with any civ that goes to war with a third civ given civ is not at war with.
Say you are civ A that have OB agreement with both civ B and civ C. civ C declares a war on civ B => open borders cancelled both with civ B and civ C. Civ A should to declare a war on either of them in order to make an OB agreement with the other, or wait until they make peace (after is OB cancelled, RoP agreement with both civs remains). edit: OR civ A can sign OB with ONE of warring civs later, what will have a negative diplo effect:
"-1: You allowed our enemies to pass through your territory"
Consequences of this:
1. you can not to attack from a third civ's territory (your troops will be moved immediately from any neutral country's territory after a DoW);
2. there will be no battles on a third civ's territory (that always looked weird).
PS: i have a feeling that "open borders" and "right of passage" agreement names should be swapped. imo right of passage suit better to right of military units passage through one's territory while OB is associated with trade..

Even more so as i need exactly this for my ZOC mod, i mean "right of passage" diplomacy option.
Afforess
I haven't tried Advanced Diplomacy yet maybe things described below are already realized..
My suggestion is:
for a given civ to cancel automatically open borders agreement with any civ that goes to war with a third civ given civ is not at war with.
Say you are civ A that have OB agreement with both civ B and civ C. civ C declares a war on civ B => open borders cancelled both with civ B and civ C. Civ A should to declare a war on either of them in order to make an OB agreement with the other, or wait until they make peace (after is OB cancelled, RoP agreement with both civs remains). edit: OR civ A can sign OB with ONE of warring civs later, what will have a negative diplo effect:
"-1: You allowed our enemies to pass through your territory"
Consequences of this:
1. you can not to attack from a third civ's territory (your troops will be moved immediately from any neutral country's territory after a DoW);
2. there will be no battles on a third civ's territory (that always looked weird).
PS: i have a feeling that "open borders" and "right of passage" agreement names should be swapped. imo right of passage suit better to right of military units passage through one's territory while OB is associated with trade..