r7018: take advantage of the server[TLS_SUPPORT] variable to auto-redirect the home
authorAndrew Tridgell <tridge@samba.org>
Fri, 27 May 2005 12:36:16 +0000 (12:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:07 +0000 (13:17 -0500)
page of swat to https:// if TLS is initialised OK
(This used to be commit 519bdcac966755b18990ec5382838b2130394daf)

swat/index.esp

index 7023a9e102e7c15e11a664996e8ab2319c3b8e53..037e88836c7c1d1f26cb918dab6758de1842f4dd 100644 (file)
@@ -5,7 +5,12 @@ Samba4 ESP test
 <BODY>
 redirecting you to the test pages ...
 <%
-  redirect("esptest/index.esp");
+if (server['SERVER_PROTOCOL'] == "http" &&
+    server['TLS_SUPPORT'] == "True") {
+       redirect("https://" + headers['HOST'] + request['REQUEST_URI']);
+} else {
+       redirect("esptest/index.esp");
+}
 %>
 </BODY>
 </HTML>