From 0c5dc7bc77a4fd7d7f0d965e3185e2df4c608f05 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 26 Aug 2008 00:53:28 +0000 Subject: libs/core: Reworked some basic libraries to not use package.seeall libs/json: Implemented own JSON-Decoder (Encoder will follow) modules/rpc: Preliminary implemented RPC-Exports for luci.fs, luci.sys and luci.model.uci --- libs/web/luasrc/dispatcher.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs/web') diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua index 3ee42d72bb..3cfa6c7044 100644 --- a/libs/web/luasrc/dispatcher.lua +++ b/libs/web/luasrc/dispatcher.lua @@ -187,13 +187,15 @@ function dispatch(request) if not luci.util.contains(accs, user) then if authen then - local user = authen(luci.sys.user.checkpasswd, accs, def) + local user, sess = authen(luci.sys.user.checkpasswd, accs, def) if not user or not luci.util.contains(accs, user) then return else - local sid = luci.sys.uniqueid(16) + local sid = sess or luci.sys.uniqueid(16) luci.http.header("Set-Cookie", "sysauth=" .. sid.."; path=/") - luci.sauth.write(sid, user) + if not sess then + luci.sauth.write(sid, user) + end end else luci.http.status(403, "Forbidden") -- cgit v1.2.3