= 32) then statusCode = "Can't add configuration to this table. Maximum limit reached." errorFlag = "ERROR" NextPage = "port_forwarding" else errorFlag, statusCode = sslvpn.portForwardConfig (inputTable, RowId, "add") end end else errorFlag, statusCode = sslvpn.portForwardConfig (inputTable, RowId, "edit") end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) or statusCode end web.goToPage(NextPage, true, true) elseif (ButtonType and ButtonType == "hostconfig") then local inputTable = web.cgiToLuaTable(cgi) local hostTbl = {} hostTbl["SSLVPNPortForwardingFQDNMap.ServerIP"] = util.joinFields(inputTable,"SSLVPNPortForwardingFQDNMap","ServerIP", ".",4) --automation part begin errorFlag = "OK" validationTable = { function() return validations.ipAddressValidate(hostTbl["SSLVPNPortForwardingFQDNMap.ServerIP"],"","IP Address error") end } for k,v in pairs (validationTable) do validationFunc= validationTable[k] 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 end --automation part end hostTbl["SSLVPNPortForwardingFQDNMap.FQDNName"] = inputTable["SSLVPNPortForwardingFQDNMap.FQDNName"] if( errorFlag == "OK" or errorFlag ==0 ) then -- for add if (RowId == "-1") then if (cgi["hdHostCount"] ~= nil) then local hdCount = cgi["hdHostCount"] if (tonumber(hdCount) >= 32) then statusCode = "Can't add configuration to this table. Maximum limit reached." errorFlag = "ERROR" NextPage = "port_forwarding" else errorFlag, statusCode = sslvpn.portForwardConfig (hostTbl, RowId, "add") end end else errorFlag, statusCode = sslvpn.portForwardConfig (hostTbl, RowId, "edit") end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) or statusCode end web.goToPage(NextPage, true, true) elseif (ButtonType and ButtonType == "deleteapp") then local rowTbl = {} rowTbl[1] = RowId errorFlag, statusCode = sslvpn.portForwardConfig (rowTbl, "-1","delete") -- 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 == "deletehost") then local rowTbl = {} rowTbl[1] = RowId errorFlag, statusCode = sslvpn.portForwardConfig (rowTbl, "-1","delete") -- 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 local remoteMgmtStatus = db.getAttribute ("accessMgmt", "accessMgmt._ROWID_", "0", "accessMgmtEnable") ?>