From db514b6f4f6d8725f27617e93838b69fbc41cb2d Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 30 Aug 2018 20:11:38 +0200 Subject: [PATCH] Fix escapes in Ushahidi update_email --- basic/srv/spotter/appmgr/confupdater.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/srv/spotter/appmgr/confupdater.py b/basic/srv/spotter/appmgr/confupdater.py index 489002a..a9edd86 100644 --- a/basic/srv/spotter/appmgr/confupdater.py +++ b/basic/srv/spotter/appmgr/confupdater.py @@ -105,10 +105,10 @@ def update_email(email): replace_file_line('/srv/sigmah/conf/sigmah.properties', 'mail.support.to=', email) # Ushahidi if app_exists('ushahidi'): - email_json = '{\\"incoming_type\\":\\"IMAP\\",\\"incoming_server\\":\\"localhost\\",\\"incoming_port\\":143,\\"incoming_security\\":\\"None\\",\\"incoming_username\\":\\"{}\\",\\"incoming_password\\":\\"password\\",\\"outgoing_type\\":\\"SMTP\\",\\"outgoing_server\\":\\"postfix\\",\\"outgoing_port\\":25,\\"outgoing_security\\":\\"None\\",\\"outgoing_username\\":\\"{}\\",\\"outgoing_password\\":\\"password\\",\\"from\\":\\"{}\\",\\"from_name\\":\\"Ushahidi\\"}'.format(email, email, email) + email_json = '{{\\"incoming_type\\":\\"IMAP\\",\\"incoming_server\\":\\"localhost\\",\\"incoming_port\\":143,\\"incoming_security\\":\\"None\\",\\"incoming_username\\":\\"{}\\",\\"incoming_password\\":\\"password\\",\\"outgoing_type\\":\\"SMTP\\",\\"outgoing_server\\":\\"postfix\\",\\"outgoing_port\\":25,\\"outgoing_security\\":\\"None\\",\\"outgoing_username\\":\\"{}\\",\\"outgoing_password\\":\\"password\\",\\"from\\":\\"{}\\",\\"from_name\\":\\"Ushahidi\\"}}'.format(email, email, email) query = 'UPDATE `config` SET `config_value` = "{}" WHERE `group_name` LIKE "data-provider" AND `config_key` LIKE "email";'.format(email_json) run_mysql_query(query, 'ushahidi') - query = 'UPDATE `config` SET `config_value` = "\"{}\"" WHERE `group_name` LIKE "site" AND `config_key` LIKE "email";'.format(email) + query = 'UPDATE `config` SET `config_value` = "\\"{}\\"" WHERE `group_name` LIKE "site" AND `config_key` LIKE "email";'.format(email) run_mysql_query(query, 'ushahidi') def update_url(host):