diff options
author | Mike Mason <ms13sp@gmail.com> | 2008-02-04 21:07:39 +0000 |
---|---|---|
committer | Mike Mason <ms13sp@gmail.com> | 2008-02-04 21:07:39 +0000 |
commit | 3857fee1017e8dec164faa13a0ca01828b4d50f6 (patch) | |
tree | 6c5ca2101122aeaf61e18c865d4fa91eaa902a71 /lib/session.lua | |
parent | 30e76e234af48b3c42e1e22eae2ebb25dd3625f6 (diff) | |
download | acf-core-3857fee1017e8dec164faa13a0ca01828b4d50f6.tar.bz2 acf-core-3857fee1017e8dec164faa13a0ca01828b4d50f6.tar.xz |
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
Diffstat (limited to 'lib/session.lua')
-rw-r--r-- | lib/session.lua | 8 |
1 files changed, 5 insertions, 3 deletions
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 |