Renamed reworked UCI API to uci2 to allow a peaceful coexistence with the old one
[project/luci.git] / libs / sgi-webuci / root / usr / lib / boa / luci.lua
index 39cee1c..387d577 100644 (file)
@@ -20,12 +20,13 @@ function init(path)
 
        require("luci.dispatcher")
        require("luci.sgi.webuci")
-       require("uci")
+       require("luci.model.uci")
 
        if (root ~= '/') then
                -- Entering dummy mode
-               uci.set_savedir(root..'/tmp/.uci')
-               uci.set_confdir(root..'/etc/config')
+               luci.model.uci.cursor = function(config, ...)
+                       return uci2.cursor(config or root .. "/etc/config", ...)
+               end
                
                luci.sys.hostname = function() return "" end
                luci.sys.loadavg  = function() return 0,0,0,0,0 end
@@ -35,12 +36,11 @@ function init(path)
                
                luci.sys.net.arptable           = function() return {} end
                luci.sys.net.devices            = function() return {} end
-               luci.sys.net.routes                     = function() return {} end
+               luci.sys.net.routes             = function() return {} end
                luci.sys.wifi.getiwconfig       = function() return {} end
                luci.sys.wifi.iwscan            = function() return {} end
                
                luci.sys.user.checkpasswd   = function() return true end
-               luci.http.basic_auth = function() return true end
        end
 end
 
@@ -58,8 +58,8 @@ function handle_req(context)
        env.PATH_INFO       = context.uri
        env.REMOTE_PORT     = context.remote_port
        env.SERVER_ADDR     = context.server_addr
+       env.HTTP_COOKIE     = context.cookie
        env.SCRIPT_NAME     = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO)
 
-       luci.sgi.webuci.initenv(env, vars)
-       luci.dispatcher.httpdispatch()
+       luci.sgi.webuci.run(env, vars)
 end