diff options
Diffstat (limited to 'dhcp-controller.lua')
-rw-r--r-- | dhcp-controller.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/dhcp-controller.lua b/dhcp-controller.lua index 4db9f25..d0a046f 100644 --- a/dhcp-controller.lua +++ b/dhcp-controller.lua @@ -125,9 +125,17 @@ editnet = function ( self ) if self.clientdata.cmd == "update" then tmp = self.clientdata + dynamicx = tmp.dynamichosts + advancedx = tmp.advanced + if tmp.unknownclients == "permit" then + dynamicx = tmp.dynamicx + end + if tmp.useadvanced ~= "use" then + advancedx = tmp.advancedx + end net = self.model.create_new_net( tmp.name, tmp.defleasetime, tmp.maxleasetime, tmp.gateway, tmp.domainname, tmp.dnssrv1, tmp.dnssrv2, tmp.subnet, tmp.netmask, tmp.leaserangestart, - tmp.leaserangeend, tmp.wpad, tmp.statichosts, tmp.unknownclients, tmp.dynamichosts, tmp.advanced ) + tmp.leaserangeend, tmp.wpad, tmp.statichosts, tmp.unknownclients, dynamicx, advancedx, tmp.useadvanced ) errcode, net = self.model.subnet_write( net ) return ( cfe({ option = option, value = net, errcode = errcode }) ) end @@ -150,13 +158,13 @@ createnet = function ( self ) } if self.clientdata.cmd == "new" then - net = self.model.create_new_net( "<new>", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) + net = self.model.create_new_net( "<new>", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) return ( cfe({ option = option, value = net, errcode = { msg = "", fields = nil }}) ) elseif self.clientdata.cmd == "create" then tmp = self.clientdata net = self.model.create_new_net( tmp.name, tmp.defleasetime, tmp.maxleasetime, tmp.gateway, tmp.domainname, tmp.dnssrv1, tmp.dnssrv2, tmp.subnet, - tmp.netmask, tmp.leaserangestart, tmp.leaserangeend, tmp.wpad, "", tmp.unknownclients, "", "" ) + tmp.netmask, tmp.leaserangestart, tmp.leaserangeend, tmp.wpad, "", tmp.unknownclients, "", "", "" ) errcode, net = self.model.subnet_create( net ) if #errcode.msg == 0 then self.conf.type = "redir" |