summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/acf-util/logon-controller.lua11
-rw-r--r--app/acf_www-controller.lua2
-rw-r--r--lib/authenticator-plaintext.lua4
-rw-r--r--lib/session.lua2
4 files changed, 10 insertions, 9 deletions
diff --git a/app/acf-util/logon-controller.lua b/app/acf-util/logon-controller.lua
index 676736f..bdc2327 100644
--- a/app/acf-util/logon-controller.lua
+++ b/app/acf-util/logon-controller.lua
@@ -25,18 +25,19 @@ logon = function(self)
if clientdata.userid and clientdata.password then
local t = self.model.logon(self,clientdata.userid,clientdata.password)
-
+
if t == nil then
userid.value = self.clientdata.userid
userid.errtxt = "There was a problem logging in"
else
-- the login was successful - give them a new session, and redir to logged in
- session.id = session.random_hash ( 512)
- session.userinfo = t or {}
+ self.sessiondata.id = session.random_hash ( 512)
+ self.sessiondata.userinfo = t or {}
+ self.conf.prefix="/"
self.conf.controller="welcome"
- self.conf.action = ""
+ self.conf.action = "read"
self.conf.type = "redir"
- logevent ("Logon was successful for " .. session.userinfo.username or "" )
+ logevent ("Logon was successful for " .. self.sessiondata.userinfo.username or "" )
error (self.conf)
end
end
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua
index 1043ade..1f9bf9f 100644
--- a/app/acf_www-controller.lua
+++ b/app/acf_www-controller.lua
@@ -164,7 +164,7 @@ view_resolver = function(self)
-- the inheritance means self.conf is used instead
action = self.conf.action,
hostname = h.hostname.value,
- alpineversion = alpineversion.worker.read(alpineversion),
+ -- alpineversion = alpineversion.worker.read(alpineversion),
prefix = self.conf.prefix,
script = self.conf.appuri,
skin = self.conf.skin or ""
diff --git a/lib/authenticator-plaintext.lua b/lib/authenticator-plaintext.lua
index 21b3a48..8466ed3 100644
--- a/lib/authenticator-plaintext.lua
+++ b/lib/authenticator-plaintext.lua
@@ -47,7 +47,7 @@ pvt.parse_authfile = function(filename)
end
pvt.get_id = function(userid, authstruct)
- if authstruct == nil then return false end
+ if authstruct == nil then return nil end
for x = 1,#authstruct do
if authstruct[x].userid == userid then
return authstruct[x]
@@ -87,7 +87,7 @@ get_userinfo = function ( self, userid )
if t == false then
return nil
else
- pvt.get_id (userid, t)
+ return pvt.get_id (userid, t)
end
end
diff --git a/lib/session.lua b/lib/session.lua
index 37dcecb..1c59df0 100644
--- a/lib/session.lua
+++ b/lib/session.lua
@@ -89,7 +89,7 @@ end
save_session = function( sessionpath, session, sessiontable)
local file = io.open(sessionpath .. "/session." .. session , "w")
if file == nil then
- return false
+ return nil
end
local id = sessiontable.id