diff options
author | Mike Mason <ms13sp@gmail.com> | 2007-11-20 16:39:39 +0000 |
---|---|---|
committer | Mike Mason <ms13sp@gmail.com> | 2007-11-20 16:39:39 +0000 |
commit | 3627a09a8a8a487ef265d0cd5be92e8a6806a6da (patch) | |
tree | 3dd5aebdbad91fa5bbc77c34160120318f7c8460 /password-model.lua | |
parent | 92db7c97a2b949afed04f5bc8b1b825917aa1d9a (diff) | |
download | acf-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-model.lua')
-rw-r--r-- | password-model.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/password-model.lua b/password-model.lua new file mode 100644 index 0000000..33dffbd --- /dev/null +++ b/password-model.lua @@ -0,0 +1,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 + |