summaryrefslogtreecommitdiffstats
path: root/app/acf-util/password-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'app/acf-util/password-controller.lua')
-rwxr-xr-xapp/acf-util/password-controller.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/app/acf-util/password-controller.lua b/app/acf-util/password-controller.lua
new file mode 100755
index 0000000..c19d6b4
--- /dev/null
+++ b/app/acf-util/password-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
+