diff options
author | Mike Mason <ms13sp@gmail.com> | 2008-01-23 22:15:21 +0000 |
---|---|---|
committer | Mike Mason <ms13sp@gmail.com> | 2008-01-23 22:15:21 +0000 |
commit | 8ca88e4ba817144acf9f81a4f51b8f3836a4d6b4 (patch) | |
tree | d2b1f35d4a599552f1f3cf8f83e88844f870b7fe /app/acf-util/logon-model.lua | |
parent | c3e3a9b829fa79ff690b97223a899534fec89ea9 (diff) | |
download | acf-core-8ca88e4ba817144acf9f81a4f51b8f3836a4d6b4.tar.bz2 acf-core-8ca88e4ba817144acf9f81a4f51b8f3836a4d6b4.tar.xz |
Adding logon-status and finally with nangel's help got this working
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@632 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app/acf-util/logon-model.lua')
-rw-r--r-- | app/acf-util/logon-model.lua | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/app/acf-util/logon-model.lua b/app/acf-util/logon-model.lua index 3c89a2a..03179ca 100644 --- a/app/acf-util/logon-model.lua +++ b/app/acf-util/logon-model.lua @@ -2,7 +2,8 @@ module (..., package.seeall) -local sess = require ("session") +require ("session") +require ("html") -- load an authenticator -- FIXME: use an "always true" as default? @@ -33,11 +34,28 @@ logon = function (self, id, password ) end end -logoff = function (self, sessionid) +logoff = function (self, sessdata) -- sessionid invalid? -- record event, ignore the attempt -- else -- unlink session -- issue new sessionid + + --made it so that we get a new sessionid then try to delete it + --need to make the whole sessiondata table go bye bye + delsess = session.unlink_session(self.conf.sessiondir, sessdata) + if delsess == true then + logoff = "Successful" + else + logoff = "Incomplete or Unsuccessful logoff" + end + sessiondata.id = session.random_hash(512) + sessiondata = {} + return ( cfe{ {value=logoff,name="logoff"},{value=sessiondata,name="sessiondata"} }) end +status = function(self, sessdata) + sessid = sessdata + checkme = session.check_session(self.conf.sessiondir,sessdata) + return ( cfe { checkme={value=checkme,name="checkme"}, sessid={value=sessid,name="sessid" } }) +end |