summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--password-controller.lua10
-rw-r--r--password-model.lua15
2 files changed, 2 insertions, 23 deletions
diff --git a/password-controller.lua b/password-controller.lua
index 727cf77..30a6f07 100644
--- a/password-controller.lua
+++ b/password-controller.lua
@@ -21,14 +21,6 @@ mvc.on_load = function(self, parent)
end
-
--- Public methods
-
-read = function (self)
- return ({ password = self.model:get()} )
-end
-
-
-update = function (self)
+update = function (self,self.sessionid.userid)
return ( {report = self.model:set() })
end
diff --git a/password-model.lua b/password-model.lua
index e4dfb22..376c0e2 100644
--- a/password-model.lua
+++ b/password-model.lua
@@ -4,21 +4,8 @@ require "format"
-- no initializer in model - use controller.init for that
-get = function (self)
---hardcoded for root now
- f = format.search_for_lines("/etc/shadow", "root:")
- temp = format.string_to_table(f,":")
- if temp[2] == "!" then
- status = "not set"
- else
- status = "set"
- end
- f:close()
- return (cfe{value=status, name="password"})
-end
-
--setup so that it will compare password input
-set = function (self, cmd1, cmd2)
+set = function (self, userid, cmd1, cmd2)
if cmd1 ~= cmd2 then report = "Invalid or non matching password. Try again"
else
command = "/usr/bin/cryptpw" .. " " .. cmd1