summaryrefslogtreecommitdiffstats
path: root/password-controller.lua
diff options
context:
space:
mode:
authorMike Mason <ms13sp@gmail.com>2007-11-20 16:39:39 +0000
committerMike Mason <ms13sp@gmail.com>2007-11-20 16:39:39 +0000
commit3627a09a8a8a487ef265d0cd5be92e8a6806a6da (patch)
tree3dd5aebdbad91fa5bbc77c34160120318f7c8460 /password-controller.lua
parent92db7c97a2b949afed04f5bc8b1b825917aa1d9a (diff)
downloadacf-alpine-baselayout-3627a09a8a8a487ef265d0cd5be92e8a6806a6da.tar.bz2
acf-alpine-baselayout-3627a09a8a8a487ef265d0cd5be92e8a6806a6da.tar.xz
System Password manager
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@346 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'password-controller.lua')
-rw-r--r--password-controller.lua34
1 files changed, 34 insertions, 0 deletions
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