Remove locationRules for old domain at main domain changing

This commit is contained in:
Alexis Gavoty 2013-06-02 20:52:17 +02:00
parent 44ed6c8b4d
commit b8ebd8986e

View file

@ -121,6 +121,12 @@ def tools_maindomain(old_domain, new_domain):
"$tmp->{'locationRules'}->{'"+ new_domain +"'}->{'(?#0ynh_user)^/ynh-user/'} = '$uid ne \"admin\"';" "$tmp->{'locationRules'}->{'"+ new_domain +"'}->{'(?#0ynh_user)^/ynh-user/'} = '$uid ne \"admin\"';"
] ]
if old_domain is not 'yunohost.org':
lemon_conf_lines.extend([
"$tmp->{'locationRules'}->{'"+ old_domain +"'}->{'(?#0ynh_admin)^/ynh-admin/'} = '';",
"$tmp->{'locationRules'}->{'"+ old_domain +"'}->{'(?#0ynh_user)^/ynh-user/'} = '';"
])
with open(lemon_tmp_conf,'a') as lemon_conf: with open(lemon_tmp_conf,'a') as lemon_conf:
for line in lemon_conf_lines: for line in lemon_conf_lines:
lemon_conf.write(line + '\n') lemon_conf.write(line + '\n')