2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
14 module("luci.controller.admin.index", package.seeall)
17 luci.i18n.loadc("base")
18 local i18n = luci.i18n.translate
21 if not root.target then
22 root.target = alias("admin")
26 entry({"about"}, template("about"))
28 local page = node("admin")
29 page.target = alias("admin", "index")
30 page.title = i18n("Administration")
33 page.sysauth_authenticator = "htmlauth"
37 local page = node("admin", "index")
38 page.target = template("admin_index/index")
39 page.title = i18n("Overview")
43 local page = node("admin", "index", "luci")
44 page.target = cbi("admin_index/luci")
45 page.title = i18n("User Interface")
48 entry({"admin", "index", "components"}, call("redir_components"), i18n("LuCI Components"), 20)
49 entry({"admin", "index", "logout"}, call("action_logout"), i18n("Logout"), 90)
52 function redir_components()
53 luci.http.redirect(luci.dispatcher.build_url("admin", "system", "packages")..'?update=1&query=luci')
56 function action_logout()
57 local dsp = require "luci.dispatcher"
58 local sauth = require "luci.sauth"
59 if dsp.context.authsession then
60 sauth.kill(dsp.context.authsession)
61 dsp.context.urltoken.stok = nil
64 luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url())
65 luci.http.redirect(luci.dispatcher.build_url())