From 3857fee1017e8dec164faa13a0ca01828b4d50f6 Mon Sep 17 00:00:00 2001 From: Mike Mason Date: Mon, 4 Feb 2008 21:07:39 +0000 Subject: Adding the beingings of the authorization items. Also adding some of the updates to the Autentication. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@689 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/session.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/session.lua') diff --git a/lib/session.lua b/lib/session.lua index ef7c596..751b693 100644 --- a/lib/session.lua +++ b/lib/session.lua @@ -149,7 +149,7 @@ unlink_session = function (sessionpath, session) end --need to see if this is a "real"-user session or just a temp one. -check_session = function (sessionpath, session) +check_session = function (sessionpath, session ) if session == nil then return "an unknown user" end local fullpath = sessionpath .. "/session." .. session @@ -163,17 +163,19 @@ check_session = function (sessionpath, session) return "an unknown user" else local c = dofile(fullpath).userinfo.userid - return c + local d = dofile(fullpath).userinfo.roles + return c,d end end + -- Record an invalid login event -- ID would typically be an ip address or username -- the format is lockevent.id.datetime.processid record_event = function( sessionpath, id_u, id_ip ) local x = io.open (string.format ("%s/lockevent.%s.%s.%s.%s", - sessionpath or "/", id_u or "", id_ip, os.time(), + sessionpath or "/", id_u or "", id_ip or "", os.time(), (posix.getpid("pid")) or "" ), "w") io.close(x) end -- cgit v1.2.3