diff options
-rw-r--r-- | app/template-html.lsp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/template-html.lsp b/app/template-html.lsp index 4382b60..bf028e1 100644 --- a/app/template-html.lsp +++ b/app/template-html.lsp @@ -1,5 +1,6 @@ <? local pageinfo , mainmenu, submenu, viewtable, session = ... - html=require("html") ?> + html=require("html") + sess=require("session") ?> Status: 200 OK Content-Type: text/html <? if (session.id) then @@ -33,11 +34,12 @@ Content-Type: text/html <span class="mute"> <p> <? local ctlr = pageinfo.script .. "/acf-util/logon/" - if session.id == nil then + + sname = sess.check_session("/tmp", session.id) + if sname == "an unknown user" then io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log in</a>\n", ctlr .. "logon" ) ) else - sess = session.name or "unknown" - io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log out as '" .. sess .. "'</a>\n", ctlr .. "logout" ) ) + io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log out as '" .. sname .. "'</a>\n", ctlr .. "logout" ) ) end ?> | <a href="/">home</a> | |