diff options
author | Steven Barth <steven@midlink.org> | 2009-07-25 10:47:26 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-07-25 10:47:26 +0000 |
commit | a77f1b91aeb9d6770a2fa5bc83a6100119e825d1 (patch) | |
tree | 0639ba6c88dd430af6708658c1ef7f9abb3b7965 /libs/web/luasrc/dispatcher.lua | |
parent | b8ab3b9dacab9c6d4344c60fdb4046087a24f233 (diff) |
Allow Basic-Auth pass-through
Diffstat (limited to 'libs/web/luasrc/dispatcher.lua')
-rw-r--r-- | libs/web/luasrc/dispatcher.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index c863d9ff72..01cc109219 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -258,7 +258,7 @@ function dispatch(request) local verifytoken = false if not sess then sess = luci.http.getcookie("sysauth") - sess = sess and sess:match("^[a-f0-9]+$") + sess = sess and sess:match("^[a-f0-9]*$") verifytoken = true end @@ -272,6 +272,12 @@ function dispatch(request) if not verifytoken or ctx.urltoken.stok == sdat.token then user = sdat.user end + else + local eu = http.getenv("HTTP_AUTH_USER") + local ep = http.getenv("HTTP_AUTH_PASS") + if eu and ep and luci.sys.user.checkpasswd(eu, ep) then + authen = function() return eu end + end end if not util.contains(accs, user) then |