summaryrefslogtreecommitdiffstats
path: root/app/acf-util/logon-controller.lua
diff options
context:
space:
mode:
authorMike Mason <ms13sp@gmail.com>2008-01-26 16:39:08 +0000
committerMike Mason <ms13sp@gmail.com>2008-01-26 16:39:08 +0000
commit3f7830de7012e45d4508f41eda4e675159d2cc44 (patch)
tree2a04ef8da642753035953577c1864c6f4ca64174 /app/acf-util/logon-controller.lua
parent8a2b52812304fb5a936a6a894df6ab1f40a0bda6 (diff)
downloadacf-core-3f7830de7012e45d4508f41eda4e675159d2cc44.tar.bz2
acf-core-3f7830de7012e45d4508f41eda4e675159d2cc44.tar.xz
Changes effect only the log in|out functions. Will work now. Next working on updating to prevent misuse of the login function.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@656 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app/acf-util/logon-controller.lua')
-rw-r--r--app/acf-util/logon-controller.lua35
1 files changed, 1 insertions, 34 deletions
diff --git a/app/acf-util/logon-controller.lua b/app/acf-util/logon-controller.lua
index e10874e..fe53542 100644
--- a/app/acf-util/logon-controller.lua
+++ b/app/acf-util/logon-controller.lua
@@ -12,42 +12,9 @@ mvc.on_load = function(self, parent)
end
logon = function(self)
---return ( {logon=self.model:logon(self,clientdata.userid, clientdata.password) })
-
-local userid=cfe({ name="userid" })
-local password=cfe({ name="password" })
-local logon=cfe({ name="Logon", type="submit"})
-local s = ""
-
- -- FIXME - if they are already logged in, log out first
-
- 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
- sessiondata.id = session.random_hash ( 512)
- sessiondata.userinfo = t or {}
- self.conf.prefix="/acf-util/"
- self.conf.controller="logon"
- self.conf.action = "status"
- self.conf.type = "redir"
- error (self.conf)
- end
- end
- -- If we reach this point, just give them the login page
- return ( cfe ({type="form",
- option={ script=ENV["SCRIPT_NAME"],
- prefix=self.conf.prefix,
- controller = self.conf.controller,
- action = "logon" },
- value = { userid, password, logon } }))
+ return ( {logon=self.model.logon(self, clientdata.userid, clientdata.password,clientdata.sessionid) })
end
-
logout = function(self)
return { logout = self.model:logoff(clientdata.sessionid) }
end