IP Mode Page to configure this page." end if (ButtonType and ButtonType == "config") then local inputTable = web.cgiToLuaTable(cgi) -- Collect Ipv4 address inputTable["isatapTunnel.localIPv4Address"] = util.joinFields(inputTable,"isatapTunnel","localIPv4Address", ".",4) --automation part local tableIndex = 1 local errorFlag = "OK" validationTable = { function() return validations.checkboxValidate(inputTable["isatapTunnel.useLanAddress"],"0",1) end, function() return validations.ipAddressValidate(inputTable["isatapTunnel.localIPv4Address"],"","IPv4 Address Error") end } while (tableIndex <= #(validationTable)) do validationFunc = validationTable[tableIndex] errorFlag, statusCode,field,skipValidations = validationFunc() if(errorFlag==1 or errorFlag == "ERROR") then statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) or statusCode statusMessage = field .. ": " .. statusMessage break end if(skipValidations ~= "") then tableIndex = tableIndex + skipValidations + 1 else tableIndex = tableIndex + 1 end end if(errorFlag == "OK" or errorFlag == 0) then if (RowId == "-1") then errorFlag, statusCode = nimfView.isatapTunnelConfig(inputTable, "-1", "add") else errorFlag, statusCode = nimfView.isatapTunnelConfig(inputTable, RowId, "edit") end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) end web.goToPage(NextPage, true, true) else -- table for Ipv4 address split octets local ipv4AddressTbl = {} local tabHeadding = "" -- for error if (errorFlag ~= "OK") then configRowId = RowId configRow = web.cgiToLuaTable(cgi) -- for Add elseif (configRowId == "-1") then tabHeadding = "Add ISATAP Tunnel" configRow = db.getDefaults(true, "isatapTunnel") -- for edit else tabHeadding = "Edit ISATAP Tunnel" configRow = db.getRow("isatapTunnel", "_ROWID_", configRowId) end if(configRow["isatapTunnel.localIPv4Address"] ~= nil) then ipv4AddressTbl = util.split(configRow["isatapTunnel.localIPv4Address"], ".") end ?>