1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Licensed to the public under the Apache License 2.0.
4 module("luci.controller.admin.index", package.seeall)
8 if not root.target then
9 root.target = alias("admin")
13 local page = node("admin")
14 page.target = firstchild()
15 page.title = _("Administration")
18 page.sysauth_authenticator = "htmlauth"
22 -- Empty services menu to be populated by addons
23 entry({"admin", "services"}, firstchild(), _("Services"), 40).index = true
25 entry({"admin", "logout"}, call("action_logout"), _("Logout"), 90)
28 function action_logout()
29 local dsp = require "luci.dispatcher"
30 local utl = require "luci.util"
31 if dsp.context.authsession then
32 utl.ubus("session", "destroy", {
33 ubus_rpc_session = dsp.context.authsession
35 dsp.context.urltoken.stok = nil
38 luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url())
39 luci.http.redirect(luci.dispatcher.build_url())