X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fcontroller%2Fadmin%2Findex.lua;h=d00d546b649b37eb195aff734372de4d4d6e4821;hp=4e832529d9128bfd64430669b95cd6dd976d1c0d;hb=ec1a86977b1dc5cfc1c24ab1d54205531404087b;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua index 4e832529d..d00d546b6 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/index.lua @@ -1,16 +1,5 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- +-- Copyright 2008 Steven Barth +-- Licensed to the public under the Apache License 2.0. module("luci.controller.admin.index", package.seeall) @@ -38,12 +27,18 @@ end function action_logout() local dsp = require "luci.dispatcher" - local sauth = require "luci.sauth" - if dsp.context.authsession then - sauth.kill(dsp.context.authsession) + local utl = require "luci.util" + local sid = dsp.context.authsession + + if sid then + utl.ubus("session", "destroy", { ubus_rpc_session = sid }) + dsp.context.urltoken.stok = nil + + luci.http.header("Set-Cookie", "sysauth=%s; expires=%s; path=%s/" %{ + sid, 'Thu, 01 Jan 1970 01:00:00 GMT', dsp.build_url() + }) end - luci.http.header("Set-Cookie", "sysauth=; path=" .. dsp.build_url()) luci.http.redirect(luci.dispatcher.build_url()) end