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 local sid = dsp.context.authsession
34 utl.ubus("session", "destroy", { ubus_rpc_session = sid })
36 luci.http.header("Set-Cookie", "sysauth=%s; expires=%s; path=%s/" %{
37 sid, 'Thu, 01 Jan 1970 01:00:00 GMT', dsp.build_url()
41 luci.http.redirect(dsp.build_url())