summaryrefslogtreecommitdiffstats
path: root/tmppassword-controller.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-02-18 17:05:44 +0000
committerMika Havela <mika.havela@gmail.com>2008-02-18 17:05:44 +0000
commit867179d46067f0861bb53d4c99a3fe461f7015d6 (patch)
tree4e34f481eae7bb724d896cfe96998c10da8d0926 /tmppassword-controller.lua
parent58b6f99326473ed4a8670f4a31172c667b4eaa27 (diff)
downloadacf-alpine-baselayout-867179d46067f0861bb53d4c99a3fe461f7015d6.tar.bz2
acf-alpine-baselayout-867179d46067f0861bb53d4c99a3fe461f7015d6.tar.xz
Created a temporary password-manager. This will probably be moved somewhere else.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@749 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'tmppassword-controller.lua')
-rwxr-xr-xtmppassword-controller.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/tmppassword-controller.lua b/tmppassword-controller.lua
new file mode 100755
index 0000000..c19d6b4
--- /dev/null
+++ b/tmppassword-controller.lua
@@ -0,0 +1,47 @@
+module(..., package.seeall)
+
+local list_redir = function (self)
+ self.conf.action = "status"
+ 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
+end
+
+function status(self)
+ local status=self.model.getstatus(self)
+ status.cmdnew = cfe ({
+ name="cmdnew",
+ type="submit",
+ label="Create new account",
+ value="Create",
+ disabled="yes",
+ })
+ return { status=status }
+end
+
+function edit(self)
+ local config=self.model.getsettings(self.clientdata.userid)
+ config.cmdsave = cfe ({
+ name="cmdsave",
+ type="submit",
+ label="Save changes",
+ value="Save",
+ disabled="yes",
+ })
+ config.cmddelete = cfe ({
+ name="cmddelete",
+ type="submit",
+ label="Delete this account",
+ value="Delete",
+ disabled="yes",
+ })
+
+ return { config=config, clientdata=self.clientdata }
+end
+