Merge pull request #470 from thesabbir/patch-01
authorHannu Nyman <hannu.nyman@iki.fi>
Thu, 17 Sep 2015 08:47:54 +0000 (11:47 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Thu, 17 Sep 2015 08:47:54 +0000 (11:47 +0300)
merged
modules/luci-mod-rpc: fix #466 #427 attempt to index global 'luci' (a nil value)

modules/luci-mod-rpc/luasrc/controller/rpc.lua

index 129ca43..759bb74 100644 (file)
@@ -49,10 +49,10 @@ function rpc_auth()
        server.challenge = function(user, pass)
                local sid, token, secret
 
-               require "luci.config"
+               local config = require "luci.config"
 
                if sys.user.checkpasswd(user, pass) then
-                       local sdat = util.ubus("session", "create", { timeout = luci.config.sauth.sessiontime })
+                       local sdat = util.ubus("session", "create", { timeout = config.sauth.sessiontime })
                        if sdat then
                                sid = sdat.ubus_rpc_session
                                token = sys.uniqueid(16)