summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2017-05-06 15:06:07 +0200
committerJo-Philipp Wich <jo@mein.io>2017-05-06 15:07:57 +0200
commit596f47649cbf5b1e6c3c45d20980b7bb545d8fbb (patch)
tree76ecd8599b32b95b2af2a64897e57170c2022a7c /modules
parent63d61d726cd3487820f2c7ba70a2470a3c196456 (diff)
luci-base: luci.dispatcher: allow overriding sysauth template
In some cases it is useful to be able to override the template used for the sysauth login dialog. Add a new property "sysauth_template" which allows overriding the template name from controller files. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/dispatcher.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua
index 0876ce658..0bd19456f 100644
--- a/modules/luci-base/luasrc/dispatcher.lua
+++ b/modules/luci-base/luasrc/dispatcher.lua
@@ -101,7 +101,7 @@ function error500(message)
return false
end
-function authenticator.htmlauth(validator, accs, default)
+function authenticator.htmlauth(validator, accs, default, template)
local user = http.formvalue("luci_username")
local pass = http.formvalue("luci_password")
@@ -113,7 +113,7 @@ function authenticator.htmlauth(validator, accs, default)
require("luci.template")
context.path = {}
http.status(403, "Forbidden")
- luci.template.render("sysauth", {duser=default, fuser=user})
+ luci.template.render(template or "sysauth", {duser=default, fuser=user})
return false
@@ -360,7 +360,7 @@ function dispatch(request)
if not util.contains(accs, user) then
if authen then
- local user, sess = authen(sys.user.checkpasswd, accs, def)
+ local user, sess = authen(sys.user.checkpasswd, accs, def, track.sysauth_template)
local token
if not user or not util.contains(accs, user) then
return