diff options
Diffstat (limited to 'dhcp-controller.lua')
-rw-r--r-- | dhcp-controller.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dhcp-controller.lua b/dhcp-controller.lua index 0542150..cca9a98 100644 --- a/dhcp-controller.lua +++ b/dhcp-controller.lua @@ -49,6 +49,31 @@ dep = function ( self ) return ( cfe ({ msg = msg }) ) end +settings = function ( self ) + + if not self.clientdata.cmd then + list_redir(self) + end + + local settings = {} + local option = { script = ENV["SCRIPT_NAME"], + prefix = self.conf.prefix, + controller = self.conf.controller, + action = self.conf.action, + extra = "" + } + + if self.clientdata.cmd == "update" then + tmp = self.clientdata + settings = self.model.create_new_settings( tmp.defleasetime, tmp.maxleasetime, tmp.domainname ) + errcode, settings = self.model.update_settings( settings ) + return ( cfe ({ option = option, value = settings, errcode = errcode })) + else + settings = self.model.read_settings() + return ( cfe ({ option = option, value = settings, errcode = { msg = "", fields={} }}) ) + end +end + editnet = function ( self ) if not self.clientdata.cmd then |