= tonumber (maxLimitVal)) then statusMessage = "Can't add configuration to this table. Maximum limit reached." NextPage = "mac_filter" else errorFlag, statusCode = fwView.macFilteringConfig(inputTable, "-1", "add") -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) end end end web.goToPage(NextPage, true, true) elseif (ButtonType and ButtonType == "delete") then local inputTable = web.cgiToLuaTable(cgi) local field, splitted, rows = web.cgiSearch(cgi,"SourceMACAddressCheck") -- if any rows to delete if (rows) then errorFlag, statusCode = fwView.deleteMac(rows) end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) web.goToPage(NextPage, true, true) elseif (ButtonType and ButtonType == "config") then local inTable = web.cgiToLuaTable(cgi) local inputTable = {} inputTable["MACFiltering.MACFilterEnable"] = inTable["MACFiltering.MACFilterEnable"] if (inTable["MACFiltering.MACFilterEnable"] ~= nil and inTable["MACFiltering.MACFilterEnable"] == "1") then inputTable["MACFiltering.MACAddressPolicy"] = inTable["MACFiltering.MACAddressPolicy"] end configRow = db.getRow("MACFiltering","_ROWID_", "1") if(configRow== nil) then errorFlag, statusCode = fwView.macFilteringConfig(inputTable, "-1", "add") else errorFlag, statusCode = fwView.macFilteringConfig(inputTable, "1", "edit") end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) web.goToPage(NextPage, true, true) else -- for error if (errorFlag ~= "OK") then configRow = web.cgiToLuaTable(cgi) configRow = db.getRow("MACFiltering","_ROWID_", "1") if(configRow == nil) then local outTable = {} outTable["MACFiltering.MACFilterEnable"] = "0" configRow = outTable end -- for edit else configRow = db.getRow("MACFiltering","_ROWID_", "1") if(configRow == nil) then local outTable = {} outTable["MACFiltering.MACFilterEnable"] = "0" configRow = outTable end end -- Show "Permit and block the rest" as default option -- if Source MAC filter is in disable state. if (configRow["MACFiltering.MACFilterEnable"] == "0") then configRow["MACFiltering.MACAddressPolicy"] = "1" end ?>