diff options
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 "" |