legend = "Legend"
library = "Library"
+logout = "Logout"
key = "Key"
library = "Bibliothek"
load = "Last"
login = "Anmelden"
+logout = "Abmelden"
key = "Schlüssel"
local account = user.getuser(username)
-- FIXME: detect testing environment
- if luci.fs.isfile("/etc/shadow") and not luci.fs.access("/etc/shadow", "r") then
+ if luci.fs.stat("/etc/shadow") and not luci.fs.access("/etc/shadow", "r") then
return true
elseif account then
if account.passwd == "!" then
if user and luci.sys.user.checkpasswd(user, pass) then
local sid = luci.sys.uniqueid(16)
- luci.http.header("Set-Cookie", "sysauth=" .. sid)
+ luci.http.header("Set-Cookie", "sysauth=" .. sid.."; path=/")
luci.sauth.write(sid, user)
return true
else
-- Reassigns a node to another position
function assign(path, clone, title, order)
- local obj = node(path)
+ local obj = node(unpack(path))
obj.nodes = nil
obj.module = nil
page.target = cbi("admin_index/luci")
page.title = i18n("a_i_ui", "Oberfläche")
-
+ entry({"admin", "logout"}, call("action_logout"), i18n("logout"))
+end
+
+function action_logout()
+ luci.http.header("Set-Cookie", "sysauth=; path=/")
+ luci.http.redirect(luci.dispatcher.build_url())
end
\ No newline at end of file