From c2dcd9a6e48e4d92d3f4c16ca5c1ae1d519b40b5 Mon Sep 17 00:00:00 2001 From: Nathan Angelacos Date: Sun, 9 Dec 2007 18:18:41 +0000 Subject: WIP git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@422 ab2d0c66-481e-0410-8bed-d214d4d58bed --- app/acf-util/logon-controller.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/acf-util/logon-controller.lua') diff --git a/app/acf-util/logon-controller.lua b/app/acf-util/logon-controller.lua index c0fa8b9..f641d33 100644 --- a/app/acf-util/logon-controller.lua +++ b/app/acf-util/logon-controller.lua @@ -24,17 +24,19 @@ logon = function(self) -- FIXME - if they are already logged in, log out first if clientdata.userid and clientdata.password then - if self.model.logon(self, clientdata.userid, clientdata.password) == false 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 = self.model.get_userinfo (userid) + session.userinfo = t or {} self.conf.controller="welcome" self.conf.action = "" self.conf.type = "redir" - logevent ("Logon was successful for " .. session.userinfo.username) + logevent ("Logon was successful for " .. session.userinfo.username or "" ) error (self.conf) end else -- cgit v1.2.3