changeset 706:fe03637fe5a6

server_side: add a link to the FAQ in the HTTP/HTTPS warning dialog
author souliane <souliane@mailoo.org>
date Fri, 05 Jun 2015 21:16:45 +0200
parents 531eacb82e9f
children dfe4b0291daa
files src/server/server.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/server/server.py	Thu Jun 04 12:03:45 2015 +0200
+++ b/src/server/server.py	Fri Jun 05 21:16:45 2015 +0200
@@ -850,11 +850,14 @@
         """@return: a security warning message, or None if the connection is secure"""
         if self.request.URLPath().scheme == 'https' or not self.sat_host.security_warning:
             return None
-        text = D_("You are about to connect to an unsecured service.")
+        text = D_("You are about to connect to an unsecure service.")
         if self.sat_host.connection_type == 'both':
             new_port = (':%s' % self.sat_host.port_https_ext) if self.sat_host.port_https_ext != HTTPS_PORT else ''
             url = "https://%s" % self.request.URLPath().netloc.replace(':%s' % self.sat_host.port, new_port)
-            text += D_('<br />Secure version of this website: <a href="%(url)s">%(url)s</a>') % {'url': url}
+            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>'}
+            text += D_('<br />and use the secure version of this website:<br /><a href="%(url)s" target="#">%(url)s</a>') % {'url': url}
+        else:
+            text += D_('You should ask the administrator of %(url)s to turn on HTTPS.')
         return text