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
15 module("luci.controller.admin.index", package.seeall)
19 if not root.target then
20 root.target = alias("admin")
24 local page = node("admin")
25 page.target = alias("admin", "status")
26 page.title = _("Administration")
29 page.sysauth_authenticator = "htmlauth"
33 entry({"admin", "logout"}, call("action_logout"), _("Logout"), 90)
36 function action_logout()
37 local dsp = require "luci.dispatcher"
38 local sauth = require "luci.sauth"
39 if dsp.context.authsession then
40 sauth.kill(dsp.context.authsession)
41 dsp.context.urltoken.stok = nil
44 luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url())
45 luci.http.redirect(luci.dispatcher.build_url())