From 3627a09a8a8a487ef265d0cd5be92e8a6806a6da Mon Sep 17 00:00:00 2001 From: Mike Mason Date: Tue, 20 Nov 2007 16:39:39 +0000 Subject: System Password manager git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@346 ab2d0c66-481e-0410-8bed-d214d4d58bed --- password-controller.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 password-controller.lua (limited to 'password-controller.lua') diff --git a/password-controller.lua b/password-controller.lua new file mode 100644 index 0000000..bc5389e --- /dev/null +++ b/password-controller.lua @@ -0,0 +1,34 @@ +-- the password controller + +module (..., package.seeall) + +-- Cause an http redirect to our "read" action +-- We use the self.conf table because it already has prefix,controller,etc +-- The redir code is defined in the application error handler (acf-controller) +local list_redir = function (self) + self.conf.action = "read" + self.conf.type = "redir" + error (self.conf) +end + +mvc={} +mvc.on_load = function(self, parent) + if (self.worker[self.conf.action] == nil ) or ( self.conf.action == "init" ) then + self.worker[self.conf.action] = list_redir(self) + end + + --logit ("password.mvc.on_load activated") + +end + + +-- Public methods + +read = function (self) + return ({ password = self.model:get()} ) +end + + +update = function (self) + return ( {password = self.model:set(cfe({value=self.clientdata.password}))}) +end -- cgit v1.2.3