X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Frpc%2Fluasrc%2Fcontroller%2Frpc.lua;fp=modules%2Frpc%2Fluasrc%2Fcontroller%2Frpc.lua;h=b3ec32ce41a7cb753410ca52b5437b9b2f7b7e7a;hp=fdfbdb38e31f9018d8c161eb41073618ecf67717;hb=a0650b4ca96a184887369e04bc4793579364aeef;hpb=77756f08b465ba9561d2d45c40633ebcac13702e diff --git a/modules/rpc/luasrc/controller/rpc.lua b/modules/rpc/luasrc/controller/rpc.lua index fdfbdb38e3..b3ec32ce41 100644 --- a/modules/rpc/luasrc/controller/rpc.lua +++ b/modules/rpc/luasrc/controller/rpc.lua @@ -33,21 +33,25 @@ function index() luci.http.status(403, "Forbidden") end - uci = entry({"rpc", "uci"}, call("rpc_uci")) - uci.sysauth = "root" - uci.sysauth_authenticator = authenticator + if pcall(require, "luci.model.uci") then + uci = entry({"rpc", "uci"}, call("rpc_uci")) + uci.sysauth = "root" + uci.sysauth_authenticator = authenticator + end fs = entry({"rpc", "fs"}, call("rpc_fs")) fs.sysauth = "root" fs.sysauth_authenticator = authenticator - fs = entry({"rpc", "sys"}, call("rpc_sys")) - fs.sysauth = "root" - fs.sysauth_authenticator = authenticator + sys = entry({"rpc", "sys"}, call("rpc_sys")) + sys.sysauth = "root" + sys.sysauth_authenticator = authenticator - fs = entry({"rpc", "ipkg"}, call("rpc_ipkg")) - fs.sysauth = "root" - fs.sysauth_authenticator = authenticator + if pcall(require, "luci.model.ipkg") then + fs = entry({"rpc", "ipkg"}, call("rpc_ipkg")) + fs.sysauth = "root" + fs.sysauth_authenticator = authenticator + end uci = entry({"rpc", "auth"}, call("rpc_auth")) end