diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-28 12:17:44 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-04-28 12:17:44 +0000 |
commit | df5a49ec9e3f8d737a9dd5434414b19b739179af (patch) | |
tree | d8778cc96ae91603a3532b0f06fe090cd8c948b5 /samba-model.lua | |
parent | 6d2b9bb0b145a92277bb4916e678ad82b4be2b5a (diff) | |
download | acf-samba-df5a49ec9e3f8d737a9dd5434414b19b739179af.tar.bz2 acf-samba-df5a49ec9e3f8d737a9dd5434414b19b739179af.tar.xz |
Updated for handle_form now passing self to get and set functions
Diffstat (limited to 'samba-model.lua')
-rw-r--r-- | samba-model.lua | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/samba-model.lua b/samba-model.lua index fd3d918..54cd65d 100644 --- a/samba-model.lua +++ b/samba-model.lua @@ -102,11 +102,11 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function get_startstop(clientdata) +function get_startstop(self, clientdata) return modelfunctions.get_startstop(processname) end -function startstop_service(startstop, action) +function startstop_service(self, startstop, action) return modelfunctions.startstop_service(startstop, action) end @@ -129,8 +129,8 @@ function getconfigfile(filename) return modelfunctions.getfiledetails(filename, filelist) end -function setconfigfile(filedetails) - return modelfunctions.setfiledetails(filedetails, filelist) +function setconfigfile(self, filedetails) + return modelfunctions.setfiledetails(self, filedetails, filelist) end function get_join() @@ -166,7 +166,7 @@ function get_join() return cfe({ type="group", value=connect, label="Join a Domain", descr=table.concat(status, "\n"), errtxt=errtxt }) end -function set_join(connect) +function set_join(self, connect) configcontent = configcontent or fs.read_file(configfile) or "" config = config or format.parse_ini_file(configcontent) or {} @@ -209,7 +209,8 @@ function list_shares() return cfe({ type="structure", value=shares, label="Shares" }) end -function read_share(name) +function read_share(self, clientdata) + local name = clientdata.name local share = {} configcontent = configcontent or fs.read_file(configfile) or "" config = config or format.parse_ini_file(configcontent) or {} @@ -250,7 +251,7 @@ function read_share(name) return cfe({ type="group", value=share, label="Samba Share" }) end -function update_share(share) +function update_share(self, share) local success, share = validate_share(share) configcontent = configcontent or fs.read_file(configfile) or "" @@ -269,7 +270,7 @@ function update_share(share) return share end -function create_share(share) +function create_share(self, share) local success, share = validate_share(share) configcontent = configcontent or fs.read_file(configfile) or "" |