diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-07-22 19:58:39 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-07-22 19:58:39 +0000 |
commit | 8cfe28d0691856222685b93f4a58664416a0aa65 (patch) | |
tree | bdc57542af8a67aefbd4b587b6aa9d5483ca3e55 /app/acf-util/logon-model.lua | |
parent | a1ad49891bbeea6c4c5cf77a574d219c9a722eab (diff) | |
download | acf-core-8cfe28d0691856222685b93f4a58664416a0aa65.tar.bz2 acf-core-8cfe28d0691856222685b93f4a58664416a0aa65.tar.xz |
Split common code out of authenticator-plaintext into authenticator.lua in preparation for adding SQL authentication. Rewrote authentication functions to use cfe's. Made corresponding changes to roles and logon. Added dnsfiles field to userdata for tinydns access control.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1314 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, 7 insertions, 15 deletions
diff --git a/app/acf-util/logon-model.lua b/app/acf-util/logon-model.lua index 3644a09..b817cf9 100644 --- a/app/acf-util/logon-model.lua +++ b/app/acf-util/logon-model.lua @@ -6,18 +6,7 @@ require ("session") require ("html") require ("fs") require ("roles") - ---varibles for time in case of logons,expired,lockouts - --- load an authenticator --- FIXME: use an "always true" as default? - -local auth -if authenticator then - auth = require ("authenticator-" .. conf.authenticator) -else - auth = require ("authenticator-plaintext") -end +require ("authenticator") -- Logoff the user by deleting session data logoff = function (sessiondir, sessiondata) @@ -42,7 +31,7 @@ logon = function (self, userid, password, ip_addr, sessiondir, sessiondata) end if false == countevent and userid and password then - if auth.authenticate (self, userid, password) then + if authenticator.authenticate (self, userid, password) then -- We have a successful login, change sessiondata -- for some reason, can't call this function or it skips rest of logon -- logout(sessiondir, sessiondata) @@ -54,8 +43,11 @@ logon = function (self, userid, password, ip_addr, sessiondir, sessiondata) end --]] sessiondata.id = session.random_hash(512) - local t = auth.get_userinfo (self, userid) - sessiondata.userinfo = t or {} + local t = authenticator.get_userinfo (self, userid) + sessiondata.userinfo = {} + for name,value in pairs(t.value) do + sessiondata.userinfo[name] = value.value + end return cfe({ type="boolean", value=true, label="Logon Success" }) else -- We have a bad login, log the event |