diff options
Diffstat (limited to 'dhcp-controller.lua')
-rw-r--r-- | dhcp-controller.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dhcp-controller.lua b/dhcp-controller.lua index bb85950..5c7e6e4 100644 --- a/dhcp-controller.lua +++ b/dhcp-controller.lua @@ -132,7 +132,7 @@ editnet = function ( self ) tmp = self.clientdata dynamicx = tmp.dynamichosts advancedx = tmp.advanced - if tmp.unknownclients == "permit" then + if tmp.unknownclients == "allow" then dynamicx = tmp.dynamicx end if tmp.useadvanced ~= "use" then @@ -162,9 +162,16 @@ editspc = function ( self ) } if self.clientdata.cmd == "update" then + msg = "" + fields = {} tmp = self.clientdata - value = self.model.advglobal_update( tmp.preconfig, tmp.postconfig ) - return ( cfe({ option = option, value = value, errcode = { msg="", fields={} }}) ) + errmsg = self.model.validate_dynamichosts( tmp.dynamic ) + if #errmsg > 0 then + msg = errmsg + table.insert(fields, "dynamichosts") + end + value = self.model.advglobal_update( tmp.preconfig, tmp.postconfig, tmp.dynamic ) + return ( cfe({ option = option, value = value, errcode = { msg=msg, fields=fields }}) ) end value = self.model.advglobal_read() |