summaryrefslogtreecommitdiffstats
path: root/password-model.lua
blob: 33dffbdb133b84a68f68a0661eaa464083b41a3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- password model methods
module (..., package.seeall)
strsplit = require "split"

-- no initializer in model - use controller.init for that

get = function (self)
	f = io.open ("/etc/shadow")
        c = f:read("*l")
	temp = strsplit(":", c)
	if temp[2] == "!" then
	status = "not set"
	else
	status = "set"
	end        
	f:close()	
	return (cfe{value=status, name="password"})
end