comparison src/server/server.py @ 707:dfe4b0291daa

server_side: remove unwanted "target" property in the HTTP to HTTPS link + use "<p>" instead of "<br>"
author souliane <souliane@mailoo.org>
date Sun, 07 Jun 2015 13:17:05 +0200
parents fe03637fe5a6
children df8cb7bedfbf
comparison
equal deleted inserted replaced
706:fe03637fe5a6 707:dfe4b0291daa
848 848
849 def __getSecurityWarning(self): 849 def __getSecurityWarning(self):
850 """@return: a security warning message, or None if the connection is secure""" 850 """@return: a security warning message, or None if the connection is secure"""
851 if self.request.URLPath().scheme == 'https' or not self.sat_host.security_warning: 851 if self.request.URLPath().scheme == 'https' or not self.sat_host.security_warning:
852 return None 852 return None
853 text = D_("You are about to connect to an unsecure service.") 853 text = "<p>" + D_("You are about to connect to an unsecure service.") + "</p><p>&nbsp;</p><p>"
854
854 if self.sat_host.connection_type == 'both': 855 if self.sat_host.connection_type == 'both':
855 new_port = (':%s' % self.sat_host.port_https_ext) if self.sat_host.port_https_ext != HTTPS_PORT else '' 856 new_port = (':%s' % self.sat_host.port_https_ext) if self.sat_host.port_https_ext != HTTPS_PORT else ''
856 url = "https://%s" % self.request.URLPath().netloc.replace(':%s' % self.sat_host.port, new_port) 857 url = "https://%s" % self.request.URLPath().netloc.replace(':%s' % self.sat_host.port, new_port)
857 text += D_('<br />Please read our %(faq_prefix)ssecurity notice%(faq_suffix)s regarding HTTPS') % {'faq_prefix': '<a href="http://salut-a-toi.org/faq.html#https" target="#">', 'faq_suffix': '</a>'} 858 text += D_('Please read our %(faq_prefix)ssecurity notice%(faq_suffix)s regarding HTTPS') % {'faq_prefix': '<a href="http://salut-a-toi.org/faq.html#https" target="#">', 'faq_suffix': '</a>'}
858 text += D_('<br />and use the secure version of this website:<br /><a href="%(url)s" target="#">%(url)s</a>') % {'url': url} 859 text += "</p><p>" + D_('and use the secure version of this website:')
860 text += '</p><p>&nbsp;</p><p align="center"><a href="%(url)s">%(url)s</a>' % {'url': url}
859 else: 861 else:
860 text += D_('You should ask the administrator of %(url)s to turn on HTTPS.') 862 text += D_('You should ask the administrator of %(url)s to turn on HTTPS.')
861 return text 863
864 return text + "</p><p>&nbsp;</p>"
862 865
863 866
864 class SignalHandler(jsonrpc.JSONRPC): 867 class SignalHandler(jsonrpc.JSONRPC):
865 868
866 def __init__(self, sat_host): 869 def __init__(self, sat_host):