From 3701d2ffbcedc50ae88954182544fe54b46d1763 Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Tue, 3 Sep 2013 17:40:55 +0000 Subject: [PATCH] core/sysauth: Redirect to https on login page if possible, #317 --- modules/admin-core/luasrc/view/sysauth.htm | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/admin-core/luasrc/view/sysauth.htm b/modules/admin-core/luasrc/view/sysauth.htm index 8c4b19c7c8..7c39f0da51 100644 --- a/modules/admin-core/luasrc/view/sysauth.htm +++ b/modules/admin-core/luasrc/view/sysauth.htm @@ -9,8 +9,6 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -$Id$ - -%> <%+header%> @@ -51,4 +49,32 @@ $Id$ if (input) input.focus(); //]]> + +<% +local uci = require "luci.model.uci".cursor() +local fs = require "nixio.fs" +local https_key = uci:get("uhttpd", "main", "key") +local https_port = uci:get("uhttpd", "main", "listen_https") +if type(https_port) == "table" then + https_port = https_port[1] +end + +if https_port and fs.access(https_key) then + https_port = https_port:match("(%d+)$") +%> + + + +<% end %> + <%+footer%> -- 2.30.2