<% // REVISIT # Prince # Variable Declaration var sql=""; var cmd=null; // use current machine ID filter or default to abx* // use the current group id filter or default to groupx // Show machines currently online/offline // Show machines that have/have not checked in since y/m/d h:s // Checking in from connection gateway 1.2.3.4 // In IP address range 1.2.3.4 to 1.2.3.4 // machines with script "x" pending // machines with script "x" failed/succeeded // machines that have/have not run script "x" since y/m/d h:s // computer name filter // operating system type & OS version var recSet = Server.CreateObject("ADODB.Recordset"); var tempSet = Server.CreateObject("ADODB.Recordset"); var needToSave = new String("false"); var radioSet = new String(""); var reloadCmd = new String(""); var newView = getQueryStr("newView"); var firstPass = new String(Request.form("firstPass")); if (firstPass == "undefined") firstPass = ""; var activeViewId = new Number(Request.form("activeViewId")); if (isNaN(activeViewId)) activeViewId = 0; var takeId = new Number(Request.form("takeId")); if (isNaN(takeId)) takeId = 0; var lastViewId = new Number(Request.form("lastViewId")); if (isNaN(lastViewId)) lastViewId = -1; var buttonType = new Number(Request.form("buttonType")); if (isNaN(buttonType)) buttonType = 0; var editTitle = new String(Request.form("editTitle")); editTitle = ArgumentCheck(editTitle, "string"); if (editTitle == "undefined") editTitle = ""; editTitle = editTitle.replace(/[\%\'\"\/\\\:\?\<\>\|]/g,"").substr(0,100); var useMachFil = new String(Request.form("useMachFil")); if (useMachFil == "undefined") useMachFil = ""; var overMachFil = new String(Request.form("overMachFil")); overMachFil = ArgumentCheck(overMachFil); if (overMachFil == "undefined") overMachFil = "*"; overMachFil = overMachFil.replace(/[\%,\'\"\/\\\:\?\<\>\| ]/g,"").substr(0,100); if (overMachFil.length == 0) overMachFil = "*"; var useGroupFil = new String(Request.form("useGroupFil")); if (useGroupFil == "undefined") useGroupFil = ""; var groupIdFil = new String(Request.form("groupIdFil")); groupIdFil = ArgumentCheck(groupIdFil); if (groupIdFil == "undefined") groupIdFil = ""; var useViewColFil = new String(Request.form("useViewColFil")); if (useViewColFil == "undefined") useViewColFil = ""; var useColFil = new String(Request.form("useColFil")); if (useColFil == "undefined") useColFil = ""; var colIdFil = new Number(Request.form("colIdFil")); if (isNaN(colIdFil)) colIdFil = 0; var showHideCollection = new Number(Request.form("showHideCollection")); if (isNaN(showHideCollection)) showHideCollection = 0; var showCheckin = new String(Request.form("showCheckin")); if (showCheckin == "undefined") showCheckin = ""; var checkinStat = new Number(Request.form("checkinStat")); if (isNaN(checkinStat)) checkinStat = 1; var onLineMin = new Number(Request.form("onLineMin")); if (isNaN(onLineMin)) onLineMin = 1; if (onLineMin < 1) onLineMin = 1; if (onLineMin > 9999) onLineMin = 9999; var onLineMinUnit = new String(Request.form("onLineMinUnit")); if (onLineMinUnit == "undefined") onLineMinUnit = "Day"; var showSuspended = new String(Request.form("showSuspended")); if (showSuspended == "undefined") showSuspended = ""; var suspendedStat = new Number(Request.form("suspendedStat")); if (isNaN(suspendedStat)) suspendedStat = 1; var showReboot = new String(Request.form("showReboot")); if (showReboot == "undefined") showReboot = ""; var rebootStat = new Number(Request.form("rebootStat")); if (isNaN(rebootStat)) rebootStat = 1; var rebootMin = new Number(Request.form("rebootMin")); if (isNaN(rebootMin)) rebootMin = 1; if (rebootMin < 1) rebootMin = 1; if (rebootMin > 9999) rebootMin = 9999; var rebootMinUnit = new String(Request.form("rebootMinUnit")); if (rebootMinUnit == "undefined") rebootMinUnit = "Day"; var useAgentCredentialStatus = new String(Request.form("useAgentCredentialStatus")); if (useAgentCredentialStatus == "undefined") useAgentCredentialStatus = ""; var agentCredentialStatus = new Number(Request.form("agentCredentialStatus")); if (isNaN(agentCredentialStatus)) agentCredentialStatus = -1; var useGateway = new String(Request.form("useGateway")); if (useGateway == "undefined") useGateway = ""; var onlyGateway = new String(Request.form("onlyGateway")); if (onlyGateway == "undefined") onlyGateway = ""; onlyGateway = onlyGateway.replace(/[^\d\.\*]/g,"").substr(0,20); var useIpFil = new String(Request.form("useIpFil")); if (useIpFil == "undefined") useIpFil = ""; var ipFil = new String(Request.form("ipFil")); if (ipFil == "undefined") ipFil = ""; ipFil = ipFil.replace(/[^\d\.\*]/g,"").substr(0,20); var useOs = new String(Request.form("useOs")); if (useOs == "undefined") useOs = ""; var osType = new Number(Request.form("osType")); if (isNaN(osType)) osType = 0; var useOsVer = new String(Request.form("useOsVer")); if (useOsVer == "undefined") useOsVer = ""; var osVer = new String(Request.form("osVer")); osVer = ArgumentCheck(osVer); if (osVer == "undefined") osVer = "*"; osVer = osVer.substr(0,100); if (osVer.length == 0) osVer = "*"; var scriptId = new Number(Request.form("scriptId")); if (isNaN(scriptId)) scriptId = 0; var scriptName = new String(Request.form("scriptName")); if (scriptName == "undefined") scriptName = ""; var useScriptPending = new String(Request.form("useScriptPending")); if (useScriptPending == "undefined") useScriptPending = ""; var scriptPending = new Number(Request.form("scriptPending")); if (isNaN(scriptPending)) scriptPending = 0; var useScriptResult = new String(Request.form("useScriptResult")); if (useScriptResult == "undefined") useScriptResult = ""; var scriptResult = new Number(Request.form("scriptResult")); if (isNaN(scriptResult)) scriptResult = 0; var useScriptSince = new String(Request.form("useScriptSince")); if (useScriptSince == "undefined") useScriptSince = ""; var scriptSince = new Number(Request.form("scriptSince")); if (isNaN(scriptSince)) scriptSince = 0; var scriptMin = new Number(Request.form("scriptMin")); if (isNaN(scriptMin)) scriptMin = 1; if (scriptMin < 1) scriptMin = 1; if (scriptMin > 9999) scriptMin = 9999; var scriptMinUnit = new String(Request.form("scriptMinUnit")); if (scriptMinUnit == "undefined") scriptMinUnit = "Day"; var useAppName = new String(Request.form("useAppName")); if (useAppName == "undefined") useAppName = ""; var appContainMiss = new Number(Request.form("appContainMiss")); if (isNaN(appContainMiss)) appContainMiss = 1; var appFilter = new String(Request.form("appFilter")); if (appFilter == "undefined") appFilter = "*"; appFilter = appFilter.substr(0,100); appFilter = appFilter.replace(/\'/g,"''"); appFilter = ArgumentCheck(appFilter); var useAppVer = new String(Request.form("useAppVer")); if (useAppVer == "undefined") useAppVer = ""; var verCompare = new Number(Request.form("verCompare")); if (isNaN(verCompare)) verCompare = 1; var verFilter = new String(Request.form("verFilter")); if (verFilter == "undefined") verFilter = "0"; verFilter = verFilter.substr(0,100); verFilter = verFilter.replace(/\'/g,"''"); verFilter = ArgumentCheck(verFilter); var usePatchFil = new String(Request.form("usePatchFil")); if (usePatchFil == "undefined") usePatchFil = ""; var missingPatches = new Number(Request.form("missingPatches")); if (isNaN(missingPatches)) missingPatches = 0; if (missingPatches < 1) missingPatches = 0; if (missingPatches > 9999) missingPatches = 9999; var usePatchPolicy = new String(Request.form("usePatchPolicy")); if (usePatchPolicy == "0") { usePatchPolicy = ""; } else if (usePatchPolicy == "undefined") { usePatchPolicy = ""; } var usePatchScanPending = new String(Request.form("usePatchScanPending")); if (usePatchScanPending == "undefined") usePatchScanPending = ""; var patchScanPending = new Number(Request.form("patchScanPending")); if (isNaN(patchScanPending)) patchScanPending = 0; var useDefaultPatchScanSource = new String(Request.form("useDefaultPatchScanSource")); if (useDefaultPatchScanSource == "undefined") useDefaultPatchScanSource = ""; // radio buttons var defaultPatchScanSource = new Number(Request.form("defaultPatchScanSource")); if (isNaN(defaultPatchScanSource)) defaultPatchScanSource = 0; var usePatchScanResult = new String(Request.form("usePatchScanResult")); if (usePatchScanResult == "undefined") usePatchScanResult = ""; var patchScanResult = new Number(Request.form("patchScanResult")); if (isNaN(patchScanResult)) patchScanResult = 0; var usePatchScanSince = new String(Request.form("usePatchScanSince")); if (usePatchScanSince == "undefined") usePatchScanSince = ""; var patchScanSince = new Number(Request.form("patchScanSince")); if (isNaN(patchScanSince)) patchScanSince = 0; var patchScanMin = new Number(Request.form("patchScanMin")); if (isNaN(patchScanMin)) patchScanMin = 1; if (patchScanMin < 1) patchScanMin = 0; if (patchScanMin > 9999) patchScanMin = 9999; var patchScanMinUnit = new String(Request.form("patchScanMinUnit")); if (patchScanMinUnit == "undefined") patchScanMinUnit = "Day"; var usePatchRebootPending = new String(Request.form("usePatchRebootPending")); if (usePatchRebootPending == "undefined") usePatchRebootPending = ""; var usePatchInstallFailures = new String(Request.form("usePatchInstallFailures")); if (usePatchInstallFailures == "undefined") usePatchInstallFailures = ""; var usePatchWuauservFailures = new String(Request.form("usePatchWuauservFailures")); if (usePatchWuauservFailures == "undefined") usePatchWuauservFailures = ""; var usePatchTestStatus = new String(Request.form("usePatchTestStatus")); if (usePatchTestStatus == "undefined") usePatchTestStatus = ""; var patchTestStatus = new Number(Request.form("patchTestStatus")); if (isNaN(patchTestStatus)) patchTestStatus = -2; var usePatchAutoUpdateConfig = new String(Request.form("usePatchAutoUpdateConfig")); if (usePatchAutoUpdateConfig == "undefined") usePatchAutoUpdateConfig = ""; var patchAutoUpdateConfig = new Number(Request.form("patchAutoUpdateConfig")); if (isNaN(patchAutoUpdateConfig)) patchAutoUpdateConfig = 0; var usePatchRebootConfig = new String(Request.form("usePatchRebootConfig")); if (usePatchRebootConfig == "undefined") usePatchRebootConfig = ""; var patchRebootConfig = new Number(Request.form("patchRebootConfig")); if (isNaN(patchRebootConfig)) patchRebootConfig = 0; var usePatchFileSrcConfig = new String(Request.form("usePatchFileSrcConfig")); if (usePatchFileSrcConfig == "undefined") usePatchFileSrcConfig = ""; var patchFileSrcConfig = new String(Request.form("patchFileSrcConfig")); patchFileSrcConfig = ArgumentCheck(patchFileSrcConfig); if (patchFileSrcConfig == "undefined") patchFileSrcConfig = "0,4"; var usePatchUnscanned = new String(Request.form("usePatchUnscanned")); if (usePatchUnscanned == "undefined") usePatchUnscanned = ""; var usePatchFileShare = new String(Request.form("usePatchFileShare")); if (usePatchFileShare == "undefined") usePatchFileShare = ""; var usePatchFileShareSet = new String(Request.form("usePatchFileShareSet")); if (usePatchFileShareSet == "undefined") usePatchFileShareSet = ""; var patchFileShareAgentGuid = new String(Request.form("machGuid")); patchFileShareAgentGuid = ArgumentCheck(patchFileShareAgentGuid); if (patchFileShareAgentGuid == "undefined") patchFileShareAgentGuid = null; var patchFileShareAgentDisplayName = new String(Request.form("patchFileShareAgentDisplayName")); if (patchFileShareAgentDisplayName == "undefined") patchFileShareAgentDisplayName = ""; var usePatchOnlineScanFail = new String(Request.form("usePatchOnlineScanFail")); if (usePatchOnlineScanFail == "undefined") usePatchOnlineScanFail = ""; var usePatchMissingKB = new String(Request.form("usePatchMissingKB")); if (usePatchMissingKB == "undefined") usePatchMissingKB = ""; var patchMissingKB = new String(Request.form("patchMissingKB")); patchMissingKB = ArgumentCheck(patchMissingKB); if (patchMissingKB == "undefined") patchMissingKB = ""; var usePatchInstalledKB = new String(Request.form("usePatchInstalledKB")); if (usePatchInstalledKB == "undefined") usePatchInstalledKB = ""; var patchInstalledKB = new String(Request.form("patchInstalledKB")); patchInstalledKB = ArgumentCheck(patchInstalledKB); if (patchInstalledKB == "undefined") patchInstalledKB = ""; var useWuaDisabled = new String(Request.form("useWuaDisabled")); if (useWuaDisabled == "undefined") useWuaDisabled = ""; var wuaDisabled = new Number(Request.form("wuaDisabled")); if (isNaN(wuaDisabled)) wuaDisabled = 0; var andMachineLabelsFlag = new Number(Request.form("andMachineLabelsFlag")); if (isNaN(andMachineLabelsFlag)) andMachineLabelsFlag = 0; var advFilter = new String(Request.form("advFilter")); if (advFilter == "undefined") advFilter = ""; var advFilterId = new Number(Request.form("advFilterId")); if (isNaN(advFilterId)) advFilterId = 0; var useMonitorset = new String(Request.form("useMonitorset")); if (useMonitorset == "undefined") useMonitorset = ""; var useMonitorsetID = new String(Request.form("useMonitorsetID")); if (useMonitorsetID == "undefined") useMonitorsetID = 0; var useSNMPMonitorset = new String(Request.form("useSNMPMonitorset")); if (useSNMPMonitorset == "undefined") useSNMPMonitorset = ""; var useSNMPMonitorsetID = new String(Request.form("useSNMPMonitorsetID")); if (useSNMPMonitorsetID == "undefined") useSNMPMonitorsetID = 0; var useApp1 = new String(Request.form("useApp1")); if (useApp1 == "undefined") useApp1 = ""; var useApp2 = new String(Request.form("useApp2")); if (useApp2 == "undefined") useApp2 = ""; var useApp3 = new String(Request.form("useApp3")); if (useApp3 == "undefined") useApp3 = ""; var useApp4 = new String(Request.form("useApp4")); if (useApp4 == "undefined") useApp4 = ""; var useApp5 = new String(Request.form("useApp5")); if (useApp5 == "undefined") useApp5 = ""; var useApp6 = new String(Request.form("useApp6")); if (useApp6 == "undefined") useApp6 = ""; var useApp7 = new String(Request.form("useApp7")); if (useApp7 == "undefined") useApp7 = ""; var useApp8 = new String(Request.form("useApp8")); if (useApp8 == "undefined") useApp8 = ""; var useApp9 = new String(Request.form("useApp9")); if (useApp9 == "undefined") useApp9 = ""; var useApp10 = new String(Request.form("useApp10")); if (useApp10 == "undefined") useApp10 = ""; var useApp11 = new String(Request.form("useApp11")); if (useApp11 == "undefined") useApp11 = ""; var useApp12 = new String(Request.form("useApp12")); if (useApp12 == "undefined") useApp12 = ""; var useApp13 = new String(Request.form("useApp13")); if (useApp13 == "undefined") useApp13 = ""; var useApp14 = new String(Request.form("useApp14")); if (useApp14 == "undefined") useApp14 = ""; var useApp15 = new String(Request.form("useApp15")); if (useApp15 == "undefined") useApp15 = ""; var useApp16 = new String(Request.form("useApp16")); if (useApp16 == "undefined") useApp16 = ""; var useApp17 = new String(Request.form("useApp17")); if (useApp17 == "undefined") useApp17 = ""; var useApp18 = new String(Request.form("useApp18")); if (useApp18 == "undefined") useApp18 = ""; var useApp19 = new String(Request.form("useApp19")); if (useApp19 == "undefined") useApp19 = ""; var useApp20 = new String(Request.form("useApp20")); if (useApp20 == "undefined") useApp20 = ""; var useLabel1 = new String(Request.form("useLabel1")); if (useLabel1 == "undefined") useLabel1 = ""; var useLabel2 = new String(Request.form("useLabel2")); if (useLabel2 == "undefined") useLabel2 = ""; var useLabel3 = new String(Request.form("useLabel3")); if (useLabel3 == "undefined") useLabel3 = ""; var useLabel4 = new String(Request.form("useLabel4")); if (useLabel4 == "undefined") useLabel4 = ""; var useLabel5 = new String(Request.form("useLabel5")); if (useLabel5 == "undefined") useLabel5 = ""; var useLabel6 = new String(Request.form("useLabel6")); if (useLabel6 == "undefined") useLabel6 = ""; var useLabel7 = new String(Request.form("useLabel7")); if (useLabel7 == "undefined") useLabel7 = ""; var useLabel8 = new String(Request.form("useLabel8")); if (useLabel8 == "undefined") useLabel8 = ""; var useLabel9 = new String(Request.form("useLabel9")); if (useLabel9 == "undefined") useLabel9 = ""; var useLabel10 = new String(Request.form("useLabel10")); if (useLabel10 == "undefined") useLabel10 = ""; var useLabel11 = new String(Request.form("useLabel11")); if (useLabel11 == "undefined") useLabel11 = ""; var useLabel12 = new String(Request.form("useLabel12")); if (useLabel12 == "undefined") useLabel12 = ""; var useLabel13 = new String(Request.form("useLabel13")); if (useLabel13 == "undefined") useLabel13 = ""; var useLabel14 = new String(Request.form("useLabel14")); if (useLabel14 == "undefined") useLabel14 = ""; var useLabel15 = new String(Request.form("useLabel15")); if (useLabel15 == "undefined") useLabel15 = ""; var useLabel16 = new String(Request.form("useLabel16")); if (useLabel16 == "undefined") useLabel16 = ""; var useLabel17 = new String(Request.form("useLabel17")); if (useLabel17 == "undefined") useLabel17 = ""; var useLabel18 = new String(Request.form("useLabel18")); if (useLabel18 == "undefined") useLabel18 = ""; var useLabel19 = new String(Request.form("useLabel19")); if (useLabel19 == "undefined") useLabel19 = ""; var useLabel20 = new String(Request.form("useLabel20")); if (useLabel20 == "undefined") useLabel20 = ""; var useLabel21 = new String(Request.form("useLabel21")); if (useLabel21 == "undefined") useLabel21 = ""; var useLabel22 = new String(Request.form("useLabel22")); if (useLabel22 == "undefined") useLabel22 = ""; var useLabel23 = new String(Request.form("useLabel23")); if (useLabel23 == "undefined") useLabel23 = ""; var useLabel24 = new String(Request.form("useLabel24")); if (useLabel24 == "undefined") useLabel24 = ""; var useLabel25 = new String(Request.form("useLabel25")); if (useLabel25 == "undefined") useLabel25 = ""; var useLabel26 = new String(Request.form("useLabel26")); if (useLabel26 == "undefined") useLabel26 = ""; var useLabel27 = new String(Request.form("useLabel27")); if (useLabel27 == "undefined") useLabel27 = ""; var useLabel28 = new String(Request.form("useLabel28")); if (useLabel28 == "undefined") useLabel28 = ""; var useLabel29 = new String(Request.form("useLabel29")); if (useLabel29 == "undefined") useLabel29 = ""; var useLabel30 = new String(Request.form("useLabel30")); if (useLabel30 == "undefined") useLabel30 = ""; var useLabel31 = new String(Request.form("useLabel31")); if (useLabel31 == "undefined") useLabel31 = ""; var useLabel32 = new String(Request.form("useLabel32")); if (useLabel32 == "undefined") useLabel32 = ""; var useLabel33 = new String(Request.form("useLabel33")); if (useLabel33 == "undefined") useLabel33 = ""; var useLabel34 = new String(Request.form("useLabel34")); if (useLabel34 == "undefined") useLabel34 = ""; var useLabel35 = new String(Request.form("useLabel35")); if (useLabel35 == "undefined") useLabel35 = ""; var useLabel36 = new String(Request.form("useLabel36")); if (useLabel36 == "undefined") useLabel36 = ""; var useLabel37 = new String(Request.form("useLabel37")); if (useLabel37 == "undefined") useLabel37 = ""; var useLabel38 = new String(Request.form("useLabel38")); if (useLabel38 == "undefined") useLabel38 = ""; var useLabel39 = new String(Request.form("useLabel39")); if (useLabel39 == "undefined") useLabel39 = ""; var useLabel40 = new String(Request.form("useLabel40")); if (useLabel40 == "undefined") useLabel40 = ""; var useLabel41 = new String(Request.form("useLabel41")); if (useLabel41 == "undefined") useLabel41 = ""; var useLabel42 = new String(Request.form("useLabel42")); if (useLabel42 == "undefined") useLabel42 = ""; var useLabel43 = new String(Request.form("useLabel43")); if (useLabel43 == "undefined") useLabel43 = ""; var useLabel44 = new String(Request.form("useLabel44")); if (useLabel44 == "undefined") useLabel44 = ""; var useLabel45 = new String(Request.form("useLabel45")); if (useLabel45 == "undefined") useLabel45 = ""; var useLabel46 = new String(Request.form("useLabel46")); if (useLabel46 == "undefined") useLabel46 = ""; var useLabel47 = new String(Request.form("useLabel47")); if (useLabel47 == "undefined") useLabel47 = ""; var useLabel48 = new String(Request.form("useLabel48")); if (useLabel48 == "undefined") useLabel48 = ""; var useLabel49 = new String(Request.form("useLabel49")); if (useLabel49 == "undefined") useLabel49 = ""; var useLabel50 = new String(Request.form("useLabel50")); if (useLabel50 == "undefined") useLabel50 = ""; var useLabel51 = new String(Request.form("useLabel51")); if (useLabel51 == "undefined") useLabel51 = ""; var useLabel52 = new String(Request.form("useLabel52")); if (useLabel52 == "undefined") useLabel52 = ""; var useLabel53 = new String(Request.form("useLabel53")); if (useLabel53 == "undefined") useLabel53 = ""; var useLabel54 = new String(Request.form("useLabel54")); if (useLabel54 == "undefined") useLabel54 = ""; var useLabel55 = new String(Request.form("useLabel55")); if (useLabel55 == "undefined") useLabel55 = ""; /* Temporary conditional statement */ cmd = "IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS " + " WHERE TABLE_NAME = 'ViewDef' AND COLUMN_NAME = 'useMonsetFilter') " + " BEGIN " + " ALTER TABLE ViewDef ADD useMonsetFilter INT NULL" + " END; "; dbConn.Execute(cmd ,0,128); /* Temporary conditional statement */ cmd = "IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS " + " WHERE TABLE_NAME = 'ViewDef' AND COLUMN_NAME = 'MonsetID') " + " BEGIN " + " ALTER TABLE ViewDef ADD MonsetID INT NULL" + " END; "; dbConn.Execute(cmd ,0,128); /* Temporary conditional statement */ cmd = "IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS " + " WHERE TABLE_NAME = 'ViewDef' AND COLUMN_NAME = 'useSNMPsetFilter') " + " BEGIN " + " ALTER TABLE ViewDef ADD useSNMPsetFilter INT NULL" + " END; "; dbConn.Execute(cmd ,0,128); /* Temporary conditional statement */ cmd = "IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS " + " WHERE TABLE_NAME = 'ViewDef' AND COLUMN_NAME = 'SNMPsetID') " + " BEGIN " + " ALTER TABLE ViewDef ADD SNMPsetID INT NULL" + " END; "; dbConn.Execute(cmd ,0,128); if (firstPass.length == 0 && newView.length == 0) { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="SELECT activeViewId FROM adminMachFil WHERE adminId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@adminId", sessionAdminId)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); if (recSet.EOF == false) { activeViewId = Number(recSet("activeViewId")); } recSet.Close(); } var appInt = 0; var appArray = new Array(); var appArrayStr = new Array(); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="select id, ref from partnerApp where usageCountsAvail = 1 and partitionId = ?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@partitionid", sessionPartition)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); while (recSet.EOF == false) { appArray[appInt] = new Number(recSet("id")); appArrayStr[appInt] = new String(recSet("ref")); appInt++; recSet.MoveNext(); } recSet.Close(); var appsCount = appInt; var labelInt = 0; var labelArray = new Array(); var labelArrayStr = new Array(); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="select id, ref from agentlabel where partitionId = ? OR internalCode = 1 ORDER BY ref"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@partitionid", sessionPartition)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); while (recSet.EOF == false) { labelArray[labelInt] = new Number(recSet("id")); labelArrayStr[labelInt] = new String(recSet("ref")); labelInt++; recSet.MoveNext(); } recSet.Close(); var labelsCount = labelInt; if ((takeId > 0)&&(sessionAdminType==2)) { // Take ownership // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="UPDATE viewDef SET adminId=? WHERE adminId > 0 AND viewId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@adminId", sessionAdminId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", takeId)); cmd.Execute(adExecuteNoRecords); } showCollections = true; switch (Number(buttonType)) { case 0: // nothing hit default: break; case 1: // save hit case 2: // save as hit. create a new view if (useMachFil.length == 0) uMachFil = 0; else uMachFil = 1; if (useGroupFil.length == 0) uGroupFil = 0; else uGroupFil = 1; if (useViewColFil.length == 0) uViewColFil = 0; else uViewColFil = 1; if (useColFil.length == 0) uColFil = 0; else if (Number(showHideCollection) == 1) uColFil = 2; else uColFil = 1; if (showCheckin.length == 0) sCheckin = 0; else if (Number(checkinStat) == 0) sCheckin = 1; else if (Number(checkinStat) == 1) sCheckin = 2; else sCheckin = 3; switch (String(onLineMinUnit)) { case "Min": default: oMin = onLineMin; break; case "Hr": oMin = onLineMin * 60; break; case "Day": oMin = onLineMin * 60 * 24; break; } if (showSuspended.length == 0) sSuspended = 0; else if (Number(suspendedStat) == 0) sSuspended = 1; else sSuspended = 2; if (showReboot.length == 0) sReboot = 0; else if (Number(rebootStat) == 0) sReboot = 1; else sReboot = 2; switch (String(rebootMinUnit)) { case "Min": default: rMin = rebootMin; break; case "Hr": rMin = rebootMin * 60; break; case "Day": rMin = rebootMin * 60 * 24; break; } if (useAgentCredentialStatus.length > 0) cCredentialStatus = 1; else cCredentialStatus = 0; if (cCredentialStatus == 0) agentCredentialStatus = -1; if (useGateway.length == 0) uGateway = 0; else uGateway = 1; if (useIpFil.length == 0) uIp = 0; else uIp = 1; if (Number(useOs) == 0) uOs = 0; else uOs = osType; if (useOsVer.length == 0) uOsVer = 0; else uOsVer = 1; if (useScriptPending.length == 0) uScriptPending = 0; else if (Number(scriptPending) == 1) uScriptPending = 1; else uScriptPending = 2; if (useScriptResult.length == 0) uScriptResult = 0; else if (Number(scriptResult) == 1) uScriptResult = 1; else uScriptResult = 2; if (useScriptSince.length == 0) uScriptSince = 0; else if (Number(scriptSince) == 1) uScriptSince = 1; else uScriptSince = 2; switch (String(scriptMinUnit)) { case "Min": default: sMin = scriptMin; break; case "Hr": sMin = scriptMin * 60; break; case "Day": sMin = scriptMin * 60 * 24; break; } if (Number(useAppName) == 0) uApp = 0; else uApp = appContainMiss; if (Number(useAppName) == 0) uAppVer = 0; else if (Number(useAppVer) == 0) uAppVer = 0; else uAppVer = verCompare; if (usePatchFil.length == 0) { uPatch = 0; uMissingPatch = 0; uPatchPolicy = 0; } else { if (Number(missingPatches) > 0) { uPatch = 1; uMissingPatch = Number(missingPatches); if (usePatchPolicy.length == 0) { uPatchPolicy = 0; } else { uPatchPolicy = 1; } } else { uPatch = 0; uMissingPatch = 0; uPatchPolicy = 0; } } if (usePatchScanPending.length == 0) uPatchScanPending = 0; else if (Number(patchScanPending) == 1) uPatchScanPending = 1; else uPatchScanPending = 2; if (useDefaultPatchScanSource.length == 0) uDefaultPatchScanSource = 0; else if (Number(defaultPatchScanSource) == 1) uDefaultPatchScanSource = 1; else uDefaultPatchScanSource = 2; if (usePatchScanResult.length == 0) uPatchScanResult = 0; else if (Number(patchScanResult) == 1) uPatchScanResult = 1; else uPatchScanResult = 2; if (usePatchScanSince.length == 0) uPatchScanSince = 0; else if (Number(patchScanSince) == 1) uPatchScanSince = 1; else uPatchScanSince = 2; switch (String(patchScanMinUnit)) { case "Min": default: psMin = patchScanMin; break; case "Hr": psMin = patchScanMin * 60; break; case "Day": psMin = patchScanMin * 60 * 24; break; } if (uPatchScanSince == 0) { patchScanMinUnit = "Day"; psMin = 60 * 24; } if (usePatchRebootPending.length > 0) cPatchRebootPending = 1; else cPatchRebootPending = 0; if (usePatchInstallFailures.length > 0) cPatchInstallFailures = 1; else cPatchInstallFailures = 0; if (usePatchWuauservFailures.length > 0) cPatchWuauservFailures = 1; else cPatchWuauservFailures = 0; if (usePatchTestStatus.length > 0) cPatchTestStatus = 1; else cPatchTestStatus = 0; if (cPatchTestStatus == 0) patchTestStatus = -2; if (usePatchAutoUpdateConfig.length > 0) cPatchAutoUpdateConfig = 1; else cPatchAutoUpdateConfig = 0; if (cPatchAutoUpdateConfig == 0) patchAutoUpdateConfig = 0; if (usePatchRebootConfig.length > 0) cPatchRebootConfig = 1; else cPatchRebootConfig = 0; if (cPatchRebootConfig == 0) patchRebootConfig = 0; if (usePatchFileSrcConfig.length > 0) cPatchFileSrcConfig = 1; else cPatchFileSrcConfig = 0; if (cPatchFileSrcConfig == 0) patchFileSrcConfig = "0,4"; if (usePatchUnscanned.length > 0) cPatchUnscanned = 1; else cPatchUnscanned = 0; if (usePatchFileShare.length > 0) cPatchFileShare = 1; else cPatchFileShare = 0; if (usePatchFileShareSet.length > 0) cPatchFileShareSet = 1; else cPatchFileShareSet = 0; if (cPatchFileShareSet == 0 || patchFileShareAgentGuid.length == 0) patchFileShareAgentGuid = null; if (usePatchOnlineScanFail.length > 0) cPatchOnlineScanFail = 1; else cPatchOnlineScanFail = 0; if (usePatchOnlineScanFail.length > 0) cPatchOnlineScanFail = 1; else cPatchOnlineScanFail = 0; if (usePatchMissingKB.length > 0) cPatchMissingKB = 1; else cPatchMissingKB = 0; if (cPatchMissingKB == 0) patchMissingKB = ""; if (usePatchInstalledKB.length > 0) cPatchInstalledKB = 1; else cPatchInstalledKB = 0; if (cPatchInstalledKB == 0) patchInstalledKB = ""; if (useWuaDisabled.length == 0) uWuaDisabled = 0; else if (Number(wuaDisabled) == 1) uWuaDisabled = 1; else uWuaDisabled = 2; if (Number(andMachineLabelsFlag) == 1) uAndMachineLabelsFlag = 1; else uAndMachineLabelsFlag = 0; if (advFilter.length > 0) cAdvFilter = 1; else cAdvFilter = 0; if (useMonitorset.length > 0) useMonitorset = 1; else useMonitorset = 0; if (useMonitorsetID <= 0) { useMonitorset = 0; } if (useSNMPMonitorset.length > 0) useSNMPMonitorset = 1; else useSNMPMonitorset = 0; if (useSNMPMonitorsetID <= 0) { useSNMPMonitorset = 0; } if (Number(buttonType) == 2) { // process save as // create a unique id for this view oldActiveViewId = activeViewId; activeViewId = Number(String(Math.random()).substr(2,8)); // duplicate the advanced filter so this new view gets its own copy to use newAdvFilterId = Number(String(Math.random()).substr(2,8)); numViewName = 0; // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="SELECT COUNT(*) AS numViewName "+ "FROM viewDef v "+ "JOIN adminIdTab t ON v.adminId = t.adminId "+ "JOIN administrators a ON t.adminName = a.adminName "+ "AND a.partitionStr = ? "+ "WHERE v.viewName = ?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@partitionStr", sessionPartition)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@viewName", editTitle)); tempSet.CursorType = adOpenStatic; tempSet.Open(cmd); if (!tempSet.EOF) { numViewName = Number(tempSet("numViewName")); } tempSet.Close(); if (numViewName > 0) { editTitle = xlate("Copy of",true) + " " + editTitle; } // create the view // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="INSERT reportFilters (filterId,colId,showCol,filter) "+ "(SELECT ?,colId,showCol,filter FROM reportFilters "+ "WHERE filterId=?)"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@filterId", newAdvFilterId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@filterId", advFilterId)); cmd.Execute(adExecuteNoRecords); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="INSERT INTO viewDef (viewId,adminId,viewName,readWrite,shareAll,"+ "useMachFil,overMachFil,useGroupFil,groupIdFil,showCheckin,onLineMin,showSuspended,"+ "showReboot,rebootMin,useAgentCredentialStatus,agentCredentialStatus,useGateway,onlyGateway,useIpFil,ipFil,useOs,useOsVer,osVer,"+ "useScriptPending,scriptId,useScriptResult,useScriptSince,scriptMin,useViewColFil,useColFil,colIdFil,"+ "useAppName,appFilter,useAppVer,verFilter,usePatchFil,missingPatches,usePatchPolicy,usePatchScanPending,useDefaultPatchScanSource,"+ "usePatchScanResult,usePatchScanSince,patchScanMin,usePatchRebootPending,usePatchInstallFailures,usePatchTestStatus,usePatchWuauservFailures,"+ "patchTestStatus,usePatchAutoUpdateConfig,patchAutoUpdateConfig,usePatchRebootConfig,patchRebootConfig,"+ "usePatchFileSrcConfig,patchFileSrcConfig,usePatchUnscanned,usePatchFileShare,usePatchFileShareSet,patchFileShareAgentGuid,usePatchOnlineScanFail,"+ "usePatchMissingKB,patchMissingKB,usePatchInstalledKB,patchInstalledKB,useWuaDisabled,advFilter,advFilterId, useMonsetFilter, MonsetID, useSNMPsetFilter, SNMPsetID, andMachineLabelsFlag) "+ "VALUES (?,?,?,0,0,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@adminId", sessionAdminId)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@viewName", editTitle)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useMachFil", uMachFil)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@overMachFil", overMachFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useGroupFil", uGroupFil)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@groupIdFil", groupIdFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@showCheckin", sCheckin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@onLineMin", oMin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@showSuspended", sSuspended)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@showReboot", sReboot)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@rebootMin", rMin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useAgentCredentialStatus", cCredentialStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@agentCredentialStatus", agentCredentialStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useGateway", uGateway)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@onlyGateway", onlyGateway)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useIpFil", uIp)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@ipFil", ipFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useOs", uOs)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useOsVer", uOsVer)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@osVer", osVer)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useScriptPending", uScriptPending)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@scriptId", scriptId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useScriptResult", uScriptResult)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useScriptSince", uScriptSince)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@scriptMin", sMin)); cmd.Parameters.Append( createAdoInputParamTinyInt(cmd, "@useViewColFil", uViewColFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useColFil", uColFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@colIdFil", colIdFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useAppName", uApp)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@appFilter", appFilter)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useAppVer", uAppVer)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@verFilter", verFilter)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFil", uPatch)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@missingPatches", uMissingPatch)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchPolicy", uPatchPolicy)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchScanPending", uPatchScanPending)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useDefaultPatchScanSource", uDefaultPatchScanSource)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchScanResult", uPatchScanResult)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchScanSince", uPatchScanSince)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchScanMin", psMin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchRebootPending", cPatchRebootPending)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchInstallFailures", cPatchInstallFailures)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchTestStatus", cPatchWuauservFailures)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchWuauservFailures", cPatchTestStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchTestStatus", patchTestStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchAutoUpdateConfig", cPatchAutoUpdateConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchAutoUpdateConfig", patchAutoUpdateConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchRebootConfig", cPatchRebootConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchRebootConfig", patchRebootConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFileSrcConfig", cPatchFileSrcConfig)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@patchFileSrcConfig", patchFileSrcConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchUnscanned", cPatchUnscanned)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFileShare", cPatchFileShare)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFileShareSet", cPatchFileShareSet)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@patchFileShareAgentGuid", patchFileShareAgentGuid)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchOnlineScanFail", cPatchOnlineScanFail)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchMissingKB", cPatchMissingKB)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@patchMissingKB", patchMissingKB)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchInstalledKB", cPatchInstalledKB)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@patchInstalledKB", patchInstalledKB)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useWuaDisabled", uWuaDisabled)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@advFilter", cAdvFilter)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@advFilterId", newAdvFilterId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useMonsetFilter", useMonitorset)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@MonsetID", useMonitorsetID)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useSNMPsetFilter", useSNMPMonitorset)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@SNMPsetID", useSNMPMonitorsetID)); cmd.Parameters.Append( createAdoInputParamBit(cmd, "@andMachineLabelsFlag", uAndMachineLabelsFlag)); cmd.Execute(adExecuteNoRecords); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="delete from viewDefApp where viewId = ? "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Execute(adExecuteNoRecords); for(i = 0; i < appsCount; i++) { if (i == 0) { if (useApp1 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[0])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[0])); cmd.Execute(adExecuteNoRecords); } } if (i == 1) { if (useApp2 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[1])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[1])); cmd.Execute(adExecuteNoRecords); } } if (i == 2) { if (useApp3 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[2])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[2])); cmd.Execute(adExecuteNoRecords); } } if (i == 3) { if (useApp4 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[3])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[3])); cmd.Execute(adExecuteNoRecords); } } if (i == 4) { if (useApp5 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[4])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[4])); cmd.Execute(adExecuteNoRecords); } } if (i == 5) { if (useApp6 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[5])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[5])); cmd.Execute(adExecuteNoRecords); } } if (i == 6) { if (useApp7 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[6])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[6])); cmd.Execute(adExecuteNoRecords); } } if (i == 7) { if (useApp8 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[7])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[7])); cmd.Execute(adExecuteNoRecords); } } if (i == 8) { if (useApp9 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[8])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[8])); cmd.Execute(adExecuteNoRecords); } } if (i == 9) { if (useApp10 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[9])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[9])); cmd.Execute(adExecuteNoRecords); } } if (i == 10) { if (useApp11 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[10])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[10])); cmd.Execute(adExecuteNoRecords); } } if (i == 11) { if (useApp12 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[11])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[11])); cmd.Execute(adExecuteNoRecords); } } if (i == 12) { if (useApp13 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[12])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[12])); cmd.Execute(adExecuteNoRecords); } } if (i == 13) { if (useApp14 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[13])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[13])); cmd.Execute(adExecuteNoRecords); } } if (i == 14) { if (useApp15 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[14])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[14])); cmd.Execute(adExecuteNoRecords); } } if (i == 15) { if (useApp16 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[15])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[15])); cmd.Execute(adExecuteNoRecords); } } if (i == 16) { if (useApp17 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[16])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[16])); cmd.Execute(adExecuteNoRecords); } } if (i == 17) { if (useApp18 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[17])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[17])); cmd.Execute(adExecuteNoRecords); } } if (i == 18) { if (useApp19 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[18])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[18])); cmd.Execute(adExecuteNoRecords); } } if (i == 19) { if (useApp20 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[19])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[19])); cmd.Execute(adExecuteNoRecords); } } } // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="delete from viewDeflabel where viewId = ? "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Execute(adExecuteNoRecords); for(i = 0; i < labelsCount; i++) { if (i == 0) { if (useLabel1 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[0])); cmd.Execute(adExecuteNoRecords); } } if (i == 1) { if (useLabel2 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[1])); cmd.Execute(adExecuteNoRecords); } } if (i == 2) { if (useLabel3 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[2])); cmd.Execute(adExecuteNoRecords); } } if (i == 3) { if (useLabel4 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[3])); cmd.Execute(adExecuteNoRecords); } } if (i == 4) { if (useLabel5 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[4])); cmd.Execute(adExecuteNoRecords); } } if (i == 5) { if (useLabel6 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[5])); cmd.Execute(adExecuteNoRecords); } } if (i == 6) { if (useLabel7 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[6])); cmd.Execute(adExecuteNoRecords); } } if (i == 7) { if (useLabel8 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[7])); cmd.Execute(adExecuteNoRecords); } } if (i == 8) { if (useLabel9 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[8])); cmd.Execute(adExecuteNoRecords); } } if (i == 9) { if (useLabel10 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[9])); cmd.Execute(adExecuteNoRecords); } } if (i == 10) { if (useLabel11 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[10])); cmd.Execute(adExecuteNoRecords); } } if (i == 11) { if (useLabel12 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[11])); cmd.Execute(adExecuteNoRecords); } } if (i == 12) { if (useLabel13 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[12])); cmd.Execute(adExecuteNoRecords); } } if (i == 13) { if (useLabel14 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[13])); cmd.Execute(adExecuteNoRecords); } } if (i == 14) { if (useLabel15 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[14])); cmd.Execute(adExecuteNoRecords); } } if (i == 15) { if (useLabel16 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[15])); cmd.Execute(adExecuteNoRecords); } } if (i == 16) { if (useLabel17 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[16])); cmd.Execute(adExecuteNoRecords); } } if (i == 17) { if (useLabel18 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[17])); cmd.Execute(adExecuteNoRecords); } } if (i == 18) { if (useLabel19 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[18])); cmd.Execute(adExecuteNoRecords); } } if (i == 19) { if (useLabel20 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[19])); cmd.Execute(adExecuteNoRecords); } } if (i == 20) { if (useLabel21 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[20])); cmd.Execute(adExecuteNoRecords); } } if (i == 21) { if (useLabel22 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[21])); cmd.Execute(adExecuteNoRecords); } } if (i == 22) { if (useLabel23 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[22])); cmd.Execute(adExecuteNoRecords); } } if (i == 23) { if (useLabel24 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[23])); cmd.Execute(adExecuteNoRecords); } } if (i == 24) { if (useLabel25 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[24])); cmd.Execute(adExecuteNoRecords); } } if (i == 25) { if (useLabel26 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[25])); cmd.Execute(adExecuteNoRecords); } } if (i == 26) { if (useLabel27 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[26])); cmd.Execute(adExecuteNoRecords); } } if (i == 27) { if (useLabel28 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[27])); cmd.Execute(adExecuteNoRecords); } } if (i == 28) { if (useLabel29 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[28])); cmd.Execute(adExecuteNoRecords); } } if (i == 29) { if (useLabel30 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[29])); cmd.Execute(adExecuteNoRecords); } } if (i == 30) { if (useLabel31 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[30])); cmd.Execute(adExecuteNoRecords); } } if (i == 31) { if (useLabel32 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[31])); cmd.Execute(adExecuteNoRecords); } } if (i == 32) { if (useLabel33 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[32])); cmd.Execute(adExecuteNoRecords); } } if (i == 33) { if (useLabel34 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[33])); cmd.Execute(adExecuteNoRecords); } } if (i == 34) { if (useLabel35 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[34])); cmd.Execute(adExecuteNoRecords); } } if (i == 35) { if (useLabel36 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[35])); cmd.Execute(adExecuteNoRecords); } } if (i == 36) { if (useLabel37 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[36])); cmd.Execute(adExecuteNoRecords); } } if (i == 37) { if (useLabel38 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[37])); cmd.Execute(adExecuteNoRecords); } } if (i == 38) { if (useLabel39 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[38])); cmd.Execute(adExecuteNoRecords); } } if (i == 39) { if (useLabel40 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[39])); cmd.Execute(adExecuteNoRecords); } } if (i == 40) { if (useLabel41 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[40])); cmd.Execute(adExecuteNoRecords); } } if (i == 41) { if (useLabel42 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[41])); cmd.Execute(adExecuteNoRecords); } } if (i == 42) { if (useLabel43 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[42])); cmd.Execute(adExecuteNoRecords); } } if (i == 43) { if (useLabel44 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[43])); cmd.Execute(adExecuteNoRecords); } } if (i == 44) { if (useLabel45 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[44])); cmd.Execute(adExecuteNoRecords); } } if (i == 45) { if (useLabel46 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[45])); cmd.Execute(adExecuteNoRecords); } } if (i == 46) { if (useLabel47 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[46])); cmd.Execute(adExecuteNoRecords); } } if (i == 47) { if (useLabel48 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[47])); cmd.Execute(adExecuteNoRecords); } } if (i == 48) { if (useLabel49 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[48])); cmd.Execute(adExecuteNoRecords); } } if (i == 49) { if (useLabel50 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[49])); cmd.Execute(adExecuteNoRecords); } } if (i == 50) { if (useLabel51 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[50])); cmd.Execute(adExecuteNoRecords); } } if (i == 51) { if (useLabel52 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[51])); cmd.Execute(adExecuteNoRecords); } } if (i == 52) { if (useLabel53 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[52])); cmd.Execute(adExecuteNoRecords); } } if (i == 53) { if (useLabel54 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[53])); cmd.Execute(adExecuteNoRecords); } } if (i == 54) { if (useLabel55 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[54])); cmd.Execute(adExecuteNoRecords); } } } // copy over any view collection attached to the old view // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="INSERT viewCollection (viewId,agentGuid) "+ "(SELECT ?,agentGuid FROM viewCollection WHERE viewId=?)"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", oldActiveViewId)); cmd.Execute(adExecuteNoRecords); } else { // save hit // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="UPDATE viewDef SET viewName=?,useMachFil=?,overMachFil=?,useGroupFil=?,groupIdFil=?,showCheckin=?,onLineMin=?,showSuspended=?,showReboot=?,rebootMin=?,useAgentCredentialStatus=?,agentCredentialStatus=?,useGateway=?,onlyGateway=?,useIpFil=?,ipFil=?,useOs=?,useOsVer=?,osVer=?,useScriptPending=?,scriptId=?,useScriptResult=?,useScriptSince=?,scriptMin=?,useViewColFil=?,useColFil=?,colIdFil=?,useAppName=?,appFilter=?,useAppVer=?,verFilter=?,advFilter=?,advFilterId=?,usePatchFil=?,missingPatches=?,usePatchPolicy=?,usePatchScanPending=?,usePatchScanResult=?,useDefaultPatchScanSource=?,usePatchScanSince=?,patchScanMin=?,usePatchRebootPending=?,usePatchInstallFailures=?,usePatchWuauservFailures=?,usePatchTestStatus=?,patchTestStatus=?,usePatchAutoUpdateConfig=?,patchAutoUpdateConfig=?,usePatchRebootConfig=?,patchRebootConfig=?,usePatchFileSrcConfig=?,patchFileSrcConfig=? "+ ",usePatchUnscanned=?,usePatchFileShare=?,usePatchFileShareSet=?,patchFileShareAgentGuid=?,usePatchOnlineScanFail=?,usePatchMissingKB=?,patchMissingKB=? "+ ",usePatchInstalledKB=?,patchInstalledKB=? "+ ",useWuaDisabled=?,useMonsetFilter=?,MonsetID=?,useSNMPsetFilter=?,SNMPsetID=?,andMachineLabelsFlag=? WHERE viewId=? AND (adminId=? OR (readWrite=1 AND shareAll=1)"+ " OR (readWrite=1 AND EXISTS (SELECT 1 FROM viewAcl WHERE viewId = ? AND adminId=?)))"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@viewName", editTitle)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useMachFil", uMachFil)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@overMachFil", overMachFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useGroupFil", uGroupFil)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@groupIdFil", groupIdFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@showCheckin", sCheckin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@onLineMin", oMin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@showSuspended", sSuspended)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@showReboot", sReboot)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@rebootMin", rMin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useAgentCredentialStatus", cCredentialStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@agentCredentialStatus", agentCredentialStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useGateway", uGateway)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@onlyGateway", onlyGateway)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useIpFil", uIp)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@ipFil", ipFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useOs", uOs)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useOsVer", uOsVer)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@osVer", osVer)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useScriptPending", uScriptPending)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@scriptId", scriptId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useScriptResult", uScriptResult)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useScriptSince", uScriptSince)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@scriptMin", sMin)); cmd.Parameters.Append( createAdoInputParamTinyInt(cmd, "@useViewColFil", uViewColFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useColFil", uColFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@colIdFil", colIdFil)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useAppName", uApp)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@appFilter", appFilter)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useAppVer", uAppVer)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@verFilter", verFilter)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@advFilter", cAdvFilter)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@advFilterId", advFilterId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFil", uPatch)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@missingPatches", uMissingPatch)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchPolicy", uPatchPolicy)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchScanPending", uPatchScanPending)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchScanResult", uPatchScanResult)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useDefaultPatchScanSource", uDefaultPatchScanSource)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchScanSince", uPatchScanSince)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchScanMin", psMin)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchRebootPending", cPatchRebootPending)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchInstallFailures", cPatchInstallFailures)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchWuauservFailures", cPatchWuauservFailures)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchTestStatus", cPatchTestStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchTestStatus", patchTestStatus)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchAutoUpdateConfig", cPatchAutoUpdateConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchAutoUpdateConfig", patchAutoUpdateConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchRebootConfig", cPatchRebootConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@patchRebootConfig", patchRebootConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFileSrcConfig", cPatchFileSrcConfig)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@patchFileSrcConfig", patchFileSrcConfig)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchUnscanned", cPatchUnscanned)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFileShare", cPatchFileShare)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchFileShareSet", cPatchFileShareSet)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@patchFileShareAgentGuid", patchFileShareAgentGuid)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchOnlineScanFail", cPatchOnlineScanFail)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchMissingKB", cPatchMissingKB)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@patchMissingKB", patchMissingKB)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@usePatchInstalledKB", cPatchInstalledKB)); cmd.Parameters.Append( createAdoInputParamNVarchar(cmd, "@patchInstalledKB", patchInstalledKB)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useWuaDisabled", uWuaDisabled)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useMonsetFilter", useMonitorset)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@MonsetID", useMonitorsetID)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@useSNMPsetFilter", useSNMPMonitorset)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@SNMPsetID", useSNMPMonitorsetID)); cmd.Parameters.Append( createAdoInputParamBit(cmd, "@andMachineLabelsFlag", uAndMachineLabelsFlag)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@adminId", sessionAdminId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@adminId", sessionAdminId)); cmd.Execute(adExecuteNoRecords); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="delete from viewDefApp where viewId = ? "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Execute(adExecuteNoRecords); for(i = 0; i < appsCount; i++) { if (i == 0) { if (useApp1 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[0])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[0])); cmd.Execute(adExecuteNoRecords); } } if (i == 1) { if (useApp2 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[1])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[1])); cmd.Execute(adExecuteNoRecords); } } if (i == 2) { if (useApp3 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[2])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[2])); cmd.Execute(adExecuteNoRecords); } } if (i == 3) { if (useApp4 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[3])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[3])); cmd.Execute(adExecuteNoRecords); } } if (i == 4) { if (useApp5 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[4])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[4])); cmd.Execute(adExecuteNoRecords); } } if (i == 5) { if (useApp6 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[5])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[5])); cmd.Execute(adExecuteNoRecords); } } if (i == 6) { if (useApp7 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[6])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[6])); cmd.Execute(adExecuteNoRecords); } } if (i == 7) { if (useApp8 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[7])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[7])); cmd.Execute(adExecuteNoRecords); } } if (i == 8) { if (useApp9 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[8])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[8])); cmd.Execute(adExecuteNoRecords); } } if (i == 9) { if (useApp10 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[9])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[9])); cmd.Execute(adExecuteNoRecords); } } if (i == 10) { if (useApp11 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[10])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[10])); cmd.Execute(adExecuteNoRecords); } } if (i == 11) { if (useApp12 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[11])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[11])); cmd.Execute(adExecuteNoRecords); } } if (i == 12) { if (useApp13 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[12])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[12])); cmd.Execute(adExecuteNoRecords); } } if (i == 13) { if (useApp14 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[13])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[13])); cmd.Execute(adExecuteNoRecords); } } if (i == 14) { if (useApp15 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[14])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[14])); cmd.Execute(adExecuteNoRecords); } } if (i == 15) { if (useApp16 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[15])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[15])); cmd.Execute(adExecuteNoRecords); } } if (i == 16) { if (useApp17 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[16])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[16])); cmd.Execute(adExecuteNoRecords); } } if (i == 17) { if (useApp18 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[17])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[17])); cmd.Execute(adExecuteNoRecords); } } if (i == 18) { if (useApp19 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[18])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[18])); cmd.Execute(adExecuteNoRecords); } } if (i == 19) { if (useApp20 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDefApp (viewId, appId, appRef) values (?, ?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@appId", appArray[19])); cmd.Parameters.Append( createAdoInputParamVarchar(cmd, "@appRef", appArrayStr[19])); cmd.Execute(adExecuteNoRecords); } } } // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="delete from viewDeflabel where viewId = ? "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Execute(adExecuteNoRecords); for(i = 0; i < labelsCount; i++) { if (i == 0) { if (useLabel1 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[0])); cmd.Execute(adExecuteNoRecords); } } if (i == 1) { if (useLabel2 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[1])); cmd.Execute(adExecuteNoRecords); } } if (i == 2) { if (useLabel3 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[2])); cmd.Execute(adExecuteNoRecords); } } if (i == 3) { if (useLabel4 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[3])); cmd.Execute(adExecuteNoRecords); } } if (i == 4) { if (useLabel5 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[4])); cmd.Execute(adExecuteNoRecords); } } if (i == 5) { if (useLabel6 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[5])); cmd.Execute(adExecuteNoRecords); } } if (i == 6) { if (useLabel7 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[6])); cmd.Execute(adExecuteNoRecords); } } if (i == 7) { if (useLabel8 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[7])); cmd.Execute(adExecuteNoRecords); } } if (i == 8) { if (useLabel9 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[8])); cmd.Execute(adExecuteNoRecords); } } if (i == 9) { if (useLabel10 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[9])); cmd.Execute(adExecuteNoRecords); } } if (i == 10) { if (useLabel11 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[10])); cmd.Execute(adExecuteNoRecords); } } if (i == 11) { if (useLabel12 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[11])); cmd.Execute(adExecuteNoRecords); } } if (i == 12) { if (useLabel13 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[12])); cmd.Execute(adExecuteNoRecords); } } if (i == 13) { if (useLabel14 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[13])); cmd.Execute(adExecuteNoRecords); } } if (i == 14) { if (useLabel15 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[14])); cmd.Execute(adExecuteNoRecords); } } if (i == 15) { if (useLabel16 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[15])); cmd.Execute(adExecuteNoRecords); } } if (i == 16) { if (useLabel17 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[16])); cmd.Execute(adExecuteNoRecords); } } if (i == 17) { if (useLabel18 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[17])); cmd.Execute(adExecuteNoRecords); } } if (i == 18) { if (useLabel19 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[18])); cmd.Execute(adExecuteNoRecords); } } if (i == 19) { if (useLabel20 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[19])); cmd.Execute(adExecuteNoRecords); } } if (i == 20) { if (useLabel21 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[20])); cmd.Execute(adExecuteNoRecords); } } if (i == 21) { if (useLabel22 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[21])); cmd.Execute(adExecuteNoRecords); } } if (i == 22) { if (useLabel23 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[22])); cmd.Execute(adExecuteNoRecords); } } if (i == 23) { if (useLabel24 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[23])); cmd.Execute(adExecuteNoRecords); } } if (i == 24) { if (useLabel25 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[24])); cmd.Execute(adExecuteNoRecords); } } if (i == 25) { if (useLabel26 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[25])); cmd.Execute(adExecuteNoRecords); } } if (i == 26) { if (useLabel27 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[26])); cmd.Execute(adExecuteNoRecords); } } if (i == 27) { if (useLabel28 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[27])); cmd.Execute(adExecuteNoRecords); } } if (i == 28) { if (useLabel29 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[28])); cmd.Execute(adExecuteNoRecords); } } if (i == 29) { if (useLabel30 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[29])); cmd.Execute(adExecuteNoRecords); } } if (i == 30) { if (useLabel31 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[30])); cmd.Execute(adExecuteNoRecords); } } if (i == 31) { if (useLabel32 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[31])); cmd.Execute(adExecuteNoRecords); } } if (i == 32) { if (useLabel33 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[32])); cmd.Execute(adExecuteNoRecords); } } if (i == 33) { if (useLabel34 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[33])); cmd.Execute(adExecuteNoRecords); } } if (i == 34) { if (useLabel35 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[34])); cmd.Execute(adExecuteNoRecords); } } if (i == 35) { if (useLabel36 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[35])); cmd.Execute(adExecuteNoRecords); } } if (i == 36) { if (useLabel37 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[36])); cmd.Execute(adExecuteNoRecords); } } if (i == 37) { if (useLabel38 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[37])); cmd.Execute(adExecuteNoRecords); } } if (i == 38) { if (useLabel39 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[38])); cmd.Execute(adExecuteNoRecords); } } if (i == 39) { if (useLabel40 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[39])); cmd.Execute(adExecuteNoRecords); } } if (i == 40) { if (useLabel41 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[40])); cmd.Execute(adExecuteNoRecords); } } if (i == 41) { if (useLabel42 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[41])); cmd.Execute(adExecuteNoRecords); } } if (i == 42) { if (useLabel43 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[42])); cmd.Execute(adExecuteNoRecords); } } if (i == 43) { if (useLabel44 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[43])); cmd.Execute(adExecuteNoRecords); } } if (i == 44) { if (useLabel45 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[44])); cmd.Execute(adExecuteNoRecords); } } if (i == 45) { if (useLabel46 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[45])); cmd.Execute(adExecuteNoRecords); } } if (i == 46) { if (useLabel47 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[46])); cmd.Execute(adExecuteNoRecords); } } if (i == 47) { if (useLabel48 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[47])); cmd.Execute(adExecuteNoRecords); } } if (i == 48) { if (useLabel49 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[48])); cmd.Execute(adExecuteNoRecords); } } if (i == 49) { if (useLabel50 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[49])); cmd.Execute(adExecuteNoRecords); } } if (i == 50) { if (useLabel51 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[50])); cmd.Execute(adExecuteNoRecords); } } if (i == 51) { if (useLabel52 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[51])); cmd.Execute(adExecuteNoRecords); } } if (i == 52) { if (useLabel53 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[52])); cmd.Execute(adExecuteNoRecords); } } if (i == 53) { if (useLabel54 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[53])); cmd.Execute(adExecuteNoRecords); } } if (i == 54) { if (useLabel55 == 'checked') { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="insert into viewDeflabel (viewId, labelId) values (?, ?) "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@labelId", labelArray[54])); cmd.Execute(adExecuteNoRecords); } } } } // set the selected view for this admin to the new activeViewId saveDbView(activeViewId); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="UPDATE adminMachFil SET activeViewId=? WHERE adminId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@activeViewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@adminId", sessionAdminId)); cmd.Execute(adExecuteNoRecords); reloadCmd = "opener.document.location.href.indexOf('#') > -1?opener.document.location = opener.document.location.href.replace('#', '&reload=true#'):opener.document.location = opener.document.location.href+'&reload=true'; "; if (reloadCmd.indexOf("?") < 0) reloadCmd = reloadCmd.replace(/\&/,"?"); lastViewId = -1; break; case 3: // delete hit // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="DELETE FROM viewDef WHERE viewId=?; "+ "DELETE FROM viewAcl WHERE viewId=?; "+ "DELETE FROM viewDefApp WHERE viewId=?; "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Execute(adExecuteNoRecords); dropDbView(activeViewId); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="if exists (select id from partnerApp where id = 44 and partitionId = ?) " + " insert into policy.event (id, partitionId, policyEventType, contextFK, policyEventGuid) values " + " (dbo.fn_GenerateKid(),?,23,1,?)"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@partitionid", sessionPartition)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@partitionid", sessionPartition)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@policyEventGuid", activeViewId)); cmd.Execute(adExecuteNoRecords); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="UPDATE adminMachFil SET activeViewId=0 WHERE activeViewId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@activeViewId", activeViewId)); cmd.Execute(adExecuteNoRecords); activeViewId = 0; reloadCmd = "opener.document.location.href.indexOf('#') > -1?opener.document.location = opener.document.location.href.replace('#', '&reload=true#'):opener.document.location = opener.document.location.href+'&reload=true'; "; if (reloadCmd.indexOf("?") < 0) reloadCmd = reloadCmd.replace(/\&/,"?"); break; } appInt = 0; var appArrayOn = new Array(); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="select isNull(va.viewId,0) AS viewId from partnerApp pa LEFT OUTER JOIN viewDefApp va ON pa.id = va.appId and va.viewId = ? where usageCountsAvail = 1 and partitionId = ? "; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@partitionid", sessionPartition)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); while (recSet.EOF == false) { appArrayOn[appInt] = new Number(recSet("viewId")); if (appInt == 0) { useApp1 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 1) { useApp2 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 2) { useApp3 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 3) { useApp4 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 4) { useApp5 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 5) { useApp6 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 6) { useApp7 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 7) { useApp8 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 8) { useApp9 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 9) { useApp10 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 10) { useApp11 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 11) { useApp12 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 12) { useApp13 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 13) { useApp14 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 14) { useApp15 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 15) { useApp16 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 16) { useApp17 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 17) { useApp18 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 18) { useApp19 = (appArrayOn[appInt] != 0) ? "checked" : ""; } if (appInt == 19) { useApp20 = (appArrayOn[appInt] != 0) ? "checked" : ""; } appInt++; recSet.MoveNext(); } recSet.Close(); labelInt = 0; var labelArrayOn = new Array(); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="select isNull(va.viewId,0) AS viewId from agentlabel al LEFT OUTER JOIN viewDeflabel va ON al.id = va.labelId and va.viewId = ? where partitionId = ? OR internalCode = 1 ORDER BY al.ref"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); cmd.Parameters.Append( createKaseyaNumericAdoInputParameter(cmd, "@partitionid", sessionPartition)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); while (recSet.EOF == false) { labelArrayOn[labelInt] = new Number(recSet("viewId")); if (labelInt == 0) { useLabel1 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 1) { useLabel2 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 2) { useLabel3 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 3) { useLabel4 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 4) { useLabel5 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 5) { useLabel6 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 6) { useLabel7 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 7) { useLabel8 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 8) { useLabel9 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 9) { useLabel10 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 10) { useLabel11 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 11) { useLabel12 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 12) { useLabel13 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 13) { useLabel14 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 14) { useLabel15 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 15) { useLabel16 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 16) { useLabel17 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 17) { useLabel18 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 18) { useLabel19 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 19) { useLabel20 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 20) { useLabel21 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 21) { useLabel22 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 22) { useLabel23 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 23) { useLabel24 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 24) { useLabel25 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 25) { useLabel26 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 26) { useLabel27 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 27) { useLabel28 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 28) { useLabel29 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 29) { useLabel30 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 30) { useLabel31 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 31) { useLabel32 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 32) { useLabel33 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 33) { useLabel34 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 34) { useLabel35 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 35) { useLabel36 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 36) { useLabel37 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 37) { useLabel38 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 38) { useLabel39 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 39) { useLabel40 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 40) { useLabel41 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 41) { useLabel42 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 42) { useLabel43 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 43) { useLabel44 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 44) { useLabel45 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 45) { useLabel46 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 46) { useLabel47 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 47) { useLabel48 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 48) { useLabel49 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 49) { useLabel50 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 50) { useLabel51 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 51) { useLabel52 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 52) { useLabel53 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 53) { useLabel54 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } if (labelInt == 54) { useLabel55 = (labelArrayOn[labelInt] != 0) ? "checked" : ""; } labelInt++; recSet.MoveNext(); } recSet.Close(); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="SELECT v.*,ISNULL(s.scriptName,N'') AS scriptName, ISNULL(m.displayName, '') as patchFileShareAgentDisplayName FROM viewDef v LEFT OUTER JOIN "+ "scriptIdTab s ON s.scriptId=v.scriptId LEFT OUTER JOIN machNameTab m ON v.patchFileShareAgentGuid = m.agentGuid WHERE viewId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); if (recSet.EOF == false) { editTitle = String(recSet("viewName")); ownerId = Number(recSet("adminId")); readWrite = Number(recSet("readWrite")); if (Number(recSet("useMachFil")) == 1) useMachFil = "checked"; else useMachFil = ""; overMachFil = String(recSet("overMachFil")); if (Number(recSet("useGroupFil")) == 1) useGroupFil = "checked"; else useGroupFil = ""; groupIdFil = String(recSet("groupIdFil")); if (Number(recSet("useViewColFil")) == 1) useViewColFil = "checked"; else useViewColFil = ""; if ((Number(recSet("useColFil")) > 0)&&(showCollections == true)) { useColFil = "checked"; if (Number(recSet("useColFil")) == 1) { radioSet += "showHideCollection[0].checked=true; showHideCollection[1].checked=false; "; } else { radioSet += "showHideCollection[0].checked=false; showHideCollection[1].checked=true; "; } } else { useColFil = ""; if (showCollections == true) { radioSet += "showHideCollection[0].checked=true; showHideCollection[1].checked=false; "; } } colIdFil = Number(recSet("colIdFil")); if (Number(recSet("showCheckin")) == 0) { showCheckin = ""; radioSet += "checkinStat[0].checked=false; checkinStat[1].checked=true; setOnlineStat(); "; } else { showCheckin = "checked"; if (Number(recSet("showCheckin")) == 1) { radioSet += "checkinStat[0].checked=true; checkinStat[1].checked=false; checkinStat[2].checked=false; setOnlineStat(); "; } else if (Number(recSet("showCheckin")) == 2) { radioSet += "checkinStat[0].checked=false; checkinStat[1].checked=true; checkinStat[2].checked=false; setOnlineStat(); "; } else { radioSet += "checkinStat[0].checked=false; checkinStat[1].checked=false; checkinStat[2].checked=true; setOnlineStat(); "; } } onLineMin = Number(recSet("onLineMin")); // convert to hour or day onLineHr = onLineMin / 60; onLineDay = onLineHr / 24; if (Math.round(onLineDay) == onLineDay) { onLineMin = onLineDay; onLineMinUnit = "Day"; } else if (Math.round(onLineHr) == onLineHr) { onLineMin = onLineHr; onLineMinUnit = "Hr"; } else { onLineMinUnit = "Min"; } if (Number(recSet("showSuspended")) == 0) { showSuspended = ""; radioSet += "suspendedStat[0].checked=false; suspendedStat[1].checked=true; "; } else { showSuspended = "checked"; if (Number(recSet("showSuspended")) == 1) { radioSet += "suspendedStat[0].checked=true; suspendedStat[1].checked=false; "; } else { radioSet += "suspendedStat[0].checked=false; suspendedStat[1].checked=true; "; } } if (Number(recSet("showReboot")) == 0) { showReboot = ""; radioSet += "rebootStat[0].checked=false; rebootStat[1].checked=true; "; } else { showReboot = "checked"; if (Number(recSet("showReboot")) == 1) { radioSet += "rebootStat[0].checked=true; rebootStat[1].checked=false; "; } else { radioSet += "rebootStat[0].checked=false; rebootStat[1].checked=true; "; } } rebootMin = Number(recSet("rebootMin")); // convert to hour or day rebootHr = rebootMin / 60; rebootDay = rebootHr / 24; if (Math.round(rebootDay) == rebootDay) { rebootMin = rebootDay; rebootMinUnit = "Day"; } else if (Math.round(rebootHr) == rebootHr) { rebootMin = rebootHr; rebootMinUnit = "Hr"; } else { rebootMinUnit = "Min"; } if (Number(recSet("useAgentCredentialStatus")) == 0) useAgentCredentialStatus = ""; else useAgentCredentialStatus = "checked"; agentCredentialStatus = Number(recSet("agentCredentialStatus")); if (Number(recSet("useGateway")) == 1) useGateway = "checked"; else useGateway = ""; onlyGateway = String(recSet("onlyGateway")); if (Number(recSet("useIpFil")) == 1) useIpFil = "checked"; else useIpFil = ""; ipFil = String(recSet("ipFil")); if (Number(recSet("useOs")) > 0) useOs = "checked"; else useOs = ""; osType = Number(recSet("useOs")); if (Number(recSet("useOsVer")) == 1) useOsVer = "checked"; else useOsVer = ""; osVer = String(recSet("osVer")); if (Number(activeViewId) != Number(lastViewId)) { scriptId = Number(recSet("scriptId")); scriptName = String(recSet("scriptName")); } else { // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="SELECT scriptName FROM scriptIdTab WHERE scriptId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@scriptId", scriptId)); tempSet.CursorType = adOpenStatic; tempSet.Open(cmd); if (tempSet.EOF == false) { scriptName = String(tempSet("scriptName")); needToSave = "true"; } tempSet.Close(); } if (Number(recSet("useScriptPending")) == 0) { useScriptPending = ""; radioSet += "scriptPending[0].checked=false; scriptPending[1].checked=true; "; } else { useScriptPending = "checked"; if (Number(recSet("useScriptPending")) == 1) { radioSet += "scriptPending[0].checked=true; scriptPending[1].checked=false; "; } else { radioSet += "scriptPending[0].checked=false; scriptPending[1].checked=true; "; } } if (Number(recSet("useScriptResult")) == 0) { useScriptResult = ""; radioSet += "scriptResult[0].checked=false; scriptResult[1].checked=true; "; } else { useScriptResult = "checked"; if (Number(recSet("useScriptResult")) == 1) { radioSet += "scriptResult[0].checked=true; scriptResult[1].checked=false; "; } else { radioSet += "scriptResult[0].checked=false; scriptResult[1].checked=true; "; } } if (Number(recSet("useScriptSince")) == 0) { useScriptSince = ""; radioSet += "scriptSince[0].checked=false; scriptSince[1].checked=true; "; } else { useScriptSince = "checked"; if (Number(recSet("useScriptSince")) == 1) { radioSet += "scriptSince[0].checked=true; scriptSince[1].checked=false; "; } else { radioSet += "scriptSince[0].checked=false; scriptSince[1].checked=true; "; } } scriptMin = Number(recSet("scriptMin")); // convert to hour or day scriptHr = scriptMin / 60; scriptDay = scriptHr / 24; if (Math.round(scriptDay) == scriptDay) { scriptMin = scriptDay; scriptMinUnit = "Day"; } else if (Math.round(scriptHr) == scriptHr) { scriptMin = scriptHr; scriptMinUnit = "Hr"; } else { scriptMinUnit = "Min"; } if (Number(recSet("useAppName")) == 0) { useAppName = ""; radioSet += "appContainMiss[0].checked=true; appContainMiss[1].checked=false; "; } else { useAppName = "checked"; if (Number(recSet("useAppName")) == 1) { radioSet += "appContainMiss[0].checked=true; appContainMiss[1].checked=false; "; } else { radioSet += "appContainMiss[0].checked=false; appContainMiss[1].checked=true; "; } } appFilter = String(recSet("appFilter")); if (String(appFilter) == "null") appFilter = "*"; if (Number(recSet("useAppVer")) == 0) { useAppVer = ""; radioSet += "verCompare[0].checked=true; verCompare[1].checked=false; verCompare[2].checked=false; verCompare[3].checked=false; "; } else { useAppVer = "checked"; if (Number(recSet("useAppVer")) == 1) { radioSet += "verCompare[0].checked=true; verCompare[1].checked=false; verCompare[2].checked=false; verCompare[3].checked=false; "; } else if (Number(recSet("useAppVer")) == 2) { radioSet += "verCompare[0].checked=false; verCompare[1].checked=true; verCompare[2].checked=false; verCompare[3].checked=false; "; } else if (Number(recSet("useAppVer")) == 3) { radioSet += "verCompare[0].checked=false; verCompare[1].checked=false; verCompare[2].checked=true; verCompare[3].checked=false; "; } else { radioSet += "verCompare[0].checked=false; verCompare[1].checked=false; verCompare[2].checked=false; verCompare[3].checked=true; "; } } verFilter = String(recSet("verFilter")); if (String(verFilter) == "null") verFilter = "0"; if (Number(recSet("usePatchFil")) == 1) usePatchFil = "checked"; else usePatchFil = ""; missingPatches = Number(recSet("missingPatches")); if (Number(recSet("usePatchPolicy")) == 1) usePatchPolicy = "checked"; else usePatchPolicy = ""; if (Number(recSet("usePatchScanPending")) == 0) { usePatchScanPending = ""; radioSet += "patchScanPending[0].checked=false; patchScanPending[1].checked=true; "; } else { usePatchScanPending = "checked"; if (Number(recSet("usePatchScanPending")) == 1) { radioSet += "patchScanPending[0].checked=true; patchScanPending[1].checked=false; "; } else { radioSet += "patchScanPending[0].checked=false; patchScanPending[1].checked=true; "; } } if (Number(recSet("useDefaultPatchScanSource")) == 0) { useDefaultPatchScanSource = ""; radioSet += "defaultPatchScanSource[0].checked=true; defaultPatchScanSource[1].checked=false; "; } else { useDefaultPatchScanSource = "checked"; if (Number(recSet("useDefaultPatchScanSource")) == 1) { radioSet += "defaultPatchScanSource[0].checked=true; defaultPatchScanSource[1].checked=false; "; } else { radioSet += "defaultPatchScanSource[0].checked=false; defaultPatchScanSource[1].checked=true; "; } } if (Number(recSet("usePatchScanResult")) == 0) { usePatchScanResult = ""; radioSet += "patchScanResult[0].checked=false; patchScanResult[1].checked=true; "; } else { usePatchScanResult = "checked"; if (Number(recSet("usePatchScanResult")) == 1) { radioSet += "patchScanResult[0].checked=true; patchScanResult[1].checked=false; "; } else { radioSet += "patchScanResult[0].checked=false; patchScanResult[1].checked=true; "; } } if (Number(recSet("usePatchScanSince")) == 0) { usePatchScanSince = ""; radioSet += "patchScanSince[0].checked=false; patchScanSince[1].checked=true; "; } else { usePatchScanSince = "checked"; if (Number(recSet("usePatchScanSince")) == 1) { radioSet += "patchScanSince[0].checked=true; patchScanSince[1].checked=false; "; } else { radioSet += "patchScanSince[0].checked=false; patchScanSince[1].checked=true; "; } } patchScanMin = Number(recSet("patchScanMin")); // convert to hour or day patchScanHr = patchScanMin / 60; patchScanDay = patchScanHr / 24; if (Math.round(patchScanDay) == patchScanDay) { patchScanMin = patchScanDay; patchScanMinUnit = "Day"; } else if (Math.round(patchScanHr) == patchScanHr) { patchScanMin = patchScanHr; patchScanMinUnit = "Hr"; } else { patchScanMinUnit = "Min"; } if (Number(recSet("usePatchRebootPending")) == 0) usePatchRebootPending = ""; else usePatchRebootPending = "checked"; if (Number(recSet("usePatchInstallFailures")) == 0) usePatchInstallFailures = ""; else usePatchInstallFailures = "checked"; if (Number(recSet("usePatchWuauservFailures")) == 0) usePatchWuauservFailures = ""; else usePatchWuauservFailures = "checked"; if (Number(recSet("usePatchTestStatus")) == 0) usePatchTestStatus = ""; else usePatchTestStatus = "checked"; patchTestStatus = Number(recSet("patchTestStatus")); if (Number(recSet("usePatchAutoUpdateConfig")) == 0) usePatchAutoUpdateConfig = ""; else usePatchAutoUpdateConfig = "checked"; patchAutoUpdateConfig = Number(recSet("patchAutoUpdateConfig")); if (Number(recSet("usePatchRebootConfig")) == 0) usePatchRebootConfig = ""; else usePatchRebootConfig = "checked"; patchRebootConfig = Number(recSet("patchRebootConfig")); if (Number(recSet("usePatchFileSrcConfig")) == 0) usePatchFileSrcConfig = ""; else usePatchFileSrcConfig = "checked"; patchFileSrcConfig = String(recSet("patchFileSrcConfig")); if (Number(recSet("usePatchUnscanned")) == 0) usePatchUnscanned = ""; else usePatchUnscanned = "checked"; if (Number(recSet("usePatchFileShare")) == 0) usePatchFileShare = ""; else usePatchFileShare = "checked"; if (Number(recSet("usePatchFileShareSet")) == 0) usePatchFileShareSet = ""; else usePatchFileShareSet = "checked"; patchFileShareAgentGuid = String(recSet("patchFileShareAgentGuid")); if (patchFileShareAgentGuid.length == 0) patchFileShareAgentGuid = null; patchFileShareAgentDisplayName = String(recSet("patchFileShareAgentDisplayName")); if (Number(recSet("usePatchOnlineScanFail")) == 0) usePatchOnlineScanFail = ""; else usePatchOnlineScanFail = "checked"; if (Number(recSet("usePatchMissingKB")) == 0) usePatchMissingKB = ""; else usePatchMissingKB = "checked"; patchMissingKB = String(recSet("patchMissingKB")); if (Number(recSet("usePatchInstalledKB")) == 0) usePatchInstalledKB = ""; else usePatchInstalledKB = "checked"; patchInstalledKB = String(recSet("patchInstalledKB")); if (Number(recSet("useWuaDisabled")) == 0) { useWuaDisabled = ""; radioSet += "wuaDisabled[0].checked=true; wuaDisabled[1].checked=false; "; } else { useWuaDisabled = "checked"; if (Number(recSet("useWuaDisabled")) == 1) { radioSet += "wuaDisabled[0].checked=true; wuaDisabled[1].checked=false; "; } else { radioSet += "wuaDisabled[0].checked=false; wuaDisabled[1].checked=true; "; } } if (Number(recSet("andMachineLabelsFlag")) == 1) { radioSet += "andMachineLabelsFlag[0].checked=true; andMachineLabelsFlag[1].checked=false; "; } else { radioSet += "andMachineLabelsFlag[0].checked=false; andMachineLabelsFlag[1].checked=true; "; } if (Number(recSet("advFilter")) == 0) advFilter = ""; else advFilter = "checked"; advFilterId = Number(recSet("advFilterId")); if (advFilterId == 0) advFilterId = Number(String(Math.random()).substr(2,8)); if (Number(recSet("useMonsetFilter")) == 0) useMonitorset = ""; else useMonitorset = "checked"; useMonitorsetID = Number(recSet("MonsetID")); if (Number(recSet("useSNMPsetFilter")) == 0) useSNMPMonitorset = ""; else useSNMPMonitorset = "checked"; useSNMPMonitorsetID = Number(recSet("SNMPsetID")); } else { editTitle = ""; ownerId = sessionAdminId; readWrite = 0; useMachFil = ""; overMachFil = "*"; useGroupFil = ""; useViewColFil = ""; useColFil = 0; groupIdFil = ""; if (showCollections == true) { radioSet += "showHideCollection[0].checked=true; showHideCollection[1].checked=false; "; } showCheckin = ""; radioSet += "checkinStat[0].checked=false; checkinStat[1].checked=true; checkinStat[2].checked=false; setOnlineStat(); "; onLineMin = 1; onLineMinUnit = "Min"; showSuspended = ""; radioSet += "suspendedStat[0].checked=false; suspendedStat[1].checked=true; "; showReboot = ""; radioSet += "rebootStat[0].checked=false; rebootStat[1].checked=true; "; rebootMin = 1; rebootMinUnit = "Min"; useAgentCredentialStatus = ""; agentCredentialStatus = -1; useGateway = ""; onlyGateway = ""; useIpFil = ""; ipFil = ""; useOs = ""; osType = 0; useOsVer = ""; osVer = "*"; scriptId = 0; scriptName = ""; useScriptPending = ""; radioSet += "scriptPending[0].checked=false; scriptPending[1].checked=true; "; useScriptResult = ""; radioSet += "scriptResult[0].checked=false; scriptResult[1].checked=true; "; useScriptSince = ""; radioSet += "scriptSince[0].checked=false; scriptSince[1].checked=true; "; scriptMin = 1; scriptMinUnit = "Day"; useAppName = ""; radioSet += "appContainMiss[0].checked=true; appContainMiss[1].checked=false; "; appFilter = "*"; useAppVer = ""; radioSet += "verCompare[0].checked=true; verCompare[1].checked=false; verCompare[2].checked=false; verCompare[3].checked=false; "; verFilter = "0"; usePatchFil = ""; missingPatches = 0; usePatchPolicy = ""; usePatchScanPending = ""; radioSet += "patchScanPending[0].checked=false; patchScanPending[1].checked=true; "; useDefaultPatchScanSource = ""; radioSet += "defaultPatchScanSource[0].checked=true; defaultPatchScanSource[1].checked=false; "; radioSet += "andMachineLabelsFlag[0].checked=false; andMachineLabelsFlag[1].checked=true; "; usePatchScanResult = ""; radioSet += "patchScanResult[0].checked=false; patchScanResult[1].checked=true; "; usePatchScanSince = ""; radioSet += "patchScanSince[0].checked=false; patchScanSince[1].checked=true; "; patchScanMin = 1; patchScanMinUnit = "Day"; usePatchRebootPending = ""; usePatchInstallFailures = ""; usePatchWuauservFailures = ""; usePatchTestStatus = ""; patchTestStatus = -2; usePatchAutoUpdateConfig = ""; patchAutoUpdateConfig = 0; usePatchRebootConfig = ""; patchRebootConfig = 0; usePatchFileSrcConfig = ""; patchFileSrcConfig = "0,4"; usePatchUnscanned = ""; usePatchFileShare = ""; usePatchFileShareSet = ""; patchFileShareAgentGuid = ""; usePatchOnlineScanFail = ""; usePatchMissingKB = ""; patchMissingKB = ""; usePatchInstalledKB = ""; patchInstalledKB = ""; useWuaDisabled = ""; radioSet += "wuaDisabled[0].checked=true; wuaDisabled[1].checked=false; "; advFilter = ""; advFilterId = Number(String(Math.random()).substr(2,8)); useMonitorset = ""; useMonitorsetID = 0; useSNMPMonitorset = ""; useSNMPMonitorsetID = 0; } recSet.Close(); if (scriptName.length == 0) scriptName = "select agent procedure"; if ((Number(activeViewId) == 0)|| ((Number(readWrite)!=1)&&(Number(ownerId)!=Number(sessionAdminId)))) { shareDisabled = "disabled"; } else { shareDisabled = ""; } %> View Definitions <% if ((Number(readWrite) == 2)&&(Number(ownerId)!=Number(sessionAdminId))) { // execute only for this view. Do not let anyone other than the owner view or edit %> <% if (Number(sessionAdminType) == 2) { %> <% } %>
<%Response.Write(xlate("You do not have rights to view or edit this view",false)+". "+ xlate("You may only use this view",false))%>.
  <%Response.Write(xlate("Take Ownership",false))%>  
<% } else { %>
<% var sectionMachineFilterOn = false; if (useMachFil == "checked" || useGroupFil == "checked" || useViewColFil == "checked") { sectionMachineFilterOn = true; } var sectionMachineStatusOn = false; if (showCheckin == "checked" || showSuspended == "checked" || showReboot == "checked" || useAgentCredentialStatus == "checked" || useGateway == "checked" || useIpFil == "checked") { sectionMachineStatusOn = true; } var sectionOSInfoOn = false; if (useOs == "checked" || useOsVer == "checked") { sectionOSInfoOn = true; } var sectionAgentProcOn = false; if (useScriptPending == "checked" || useScriptResult == "checked" || useScriptSince == "checked") { sectionAgentProcOn = true; } var sectionAppOn = false; if (useAppName == "checked" || useAppVer == "checked") { sectionAppOn = true; } var sectionAddOnOn = false; if (useApp1 == "checked" || useApp2 == "checked" || useApp3 == "checked" || useApp4 == "checked" || useApp5 == "checked" || useApp6 == "checked" || useApp7 == "checked" || useApp8 == "checked" || useApp9 == "checked" || useApp10 == "checked" || useApp11 == "checked" || useApp12 == "checked" || useApp13 == "checked" || useApp14 == "checked" || useApp15 == "checked" || useApp16 == "checked" || useApp17 == "checked" || useApp18 == "checked" || useApp19 == "checked" || useApp20 == "checked") { sectionAddOnOn = true; } var sectionLabelOn = false; if (useLabel1 == "checked" || useLabel2 == "checked" || useLabel3 == "checked" || useLabel4 == "checked" || useLabel5 == "checked" || useLabel6 == "checked" || useLabel7 == "checked" || useLabel8 == "checked" || useLabel9 == "checked" || useLabel10 == "checked" || useLabel11 == "checked" || useLabel12 == "checked" || useLabel13 == "checked" || useLabel14 == "checked" || useLabel15 == "checked" || useLabel16 == "checked" || useLabel17 == "checked" || useLabel18 == "checked" || useLabel19 == "checked" || useLabel20 == "checked" || useLabel21 == "checked" || useLabel22 == "checked" || useLabel23 == "checked" || useLabel24 == "checked" || useLabel25 == "checked" || useLabel26 == "checked" || useLabel27 == "checked" || useLabel28 == "checked" || useLabel29 == "checked" || useLabel30 == "checked" || useLabel31 == "checked" || useLabel32 == "checked" || useLabel33 == "checked" || useLabel34 == "checked" || useLabel35 == "checked" || useLabel36 == "checked" || useLabel37 == "checked" || useLabel38 == "checked" || useLabel39 == "checked" || useLabel40 == "checked" || useLabel41 == "checked" || useLabel42 == "checked" || useLabel43 == "checked" || useLabel44 == "checked" || useLabel45 == "checked" || useLabel46 == "checked" || useLabel47 == "checked" || useLabel48 == "checked" || useLabel49 == "checked" || useLabel50 == "checked" || useLabel51 == "checked" || useLabel52 == "checked" || useLabel53 == "checked" || useLabel54 == "checked" || useLabel55 == "checked") { sectionLabelOn = true; } var sectionPatchOn = false; if (useColFil == "checked" || usePatchUnscanned == "checked" || usePatchFil == "checked" || usePatchScanPending == "checked" || useDefaultPatchScanSource == "checked" || usePatchScanResult == "checked" || usePatchScanSince == "checked" || usePatchRebootPending == "checked" || usePatchInstallFailures == "checked" || usePatchWuauservFailures == "checked" || usePatchTestStatus == "checked" || usePatchAutoUpdateConfig == "checked" || usePatchRebootConfig == "checked" || usePatchFileSrcConfig == "checked" || usePatchMissingKB == "checked" || usePatchInstalledKB == "checked" || useWuaDisabled == "checked" || usePatchFileShare == "checked" || usePatchFileShareSet == "checked" || usePatchOnlineScanFail == "checked") { sectionPatchOn = true; } var sectionAdvancedOn = false; if (advFilter == "checked") { sectionAdvancedOn = true; } var sectionMonitorOn = false; if (useMonitorset == "checked" || useSNMPMonitorset == "checked") { sectionMonitorOn = true; } %>
" style="width: 550px;"> <%=xlate("Machine Filter", false)%>
; padding-left: 5px;">

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Set machine ID",false))%>

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Set group ID",false))%>

."> ID="Checkbox4" onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Only show selected machine IDs",false))%>   <% if (Number(activeViewId) > 0) { // remove any agentGuids that were deleted but the system has not cleaned the db yet. dbConn.Execute("DELETE FROM viewCollection WHERE agentGuid IN "+ "(SELECT v.agentGuid FROM viewCollection v LEFT OUTER JOIN machNameTab m "+ "ON v.agentGuid=m.agentGuid WHERE m.agentGuid IS NULL)",0,128); // SQL-SCRUB # Prince # Changed concatenated query string to parametrized query sql ="SELECT COUNT(*) FROM viewCollection WHERE viewId=?"; cmd = createAdoCommand(dbConn,sql,adCmdText); cmd.Parameters.Append( createAdoInputParamInteger(cmd, "@viewId", activeViewId)); recSet.CursorType = adOpenStatic; recSet.Open(cmd); memberCnt = Number(recSet(0)); recSet.Close(); %> " onclick="javascript:needToSave=true;"><%Response.Write(""+memberCnt+" "+xlate("machines selected",true))%>

<% } else { Response.Write("   "+xlate("Save view before assigning machines",true)+""); } %>
" style="width: 550px;"> <%=xlate("Machine Status", false)%>

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Show machines that",false))%>   <%Response.Write(xlate("have",false))%>    <%Response.Write(xlate("have not",false))%>    <%Response.Write(xlate("have never",false))%>
<%Response.Write(xlate("been online in the last",false))%>  

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Show machines that are",false))%>   <%Response.Write(xlate("suspended",false))%>    <%Response.Write(xlate("not suspended",false))%>

."> ID="Checkbox1" onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Show machines that",false))%>   <%Response.Write(xlate("have",false))%>    <%Response.Write(xlate("have not",false))%>
<%Response.Write(xlate("rebooted in the last",false))%>  

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Machines with Credential status",false))%>

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Connection gateway filter",false))%>

"> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("IP address filter",false))%>

" style="width: 550px;"> <%=xlate("OS Info", false)%>

."> > <%Response.Write(xlate("OS Type",false))%>

"> > <%Response.Write(xlate("OS version filter",false))%>

" style="width: 550px;"> <%=xlate("Agent Procedure", false)%>

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("With agent procedure",false))%>     <%Response.Write(xlate("scheduled",false))%>    <%Response.Write(xlate("not scheduled",false))%>

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Last execution status for",false))%>     <%Response.Write(xlate("success",false))%>    <%Response.Write(xlate("failed",false))%>

."> onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Agent Procedure",false))%>     <%Response.Write(xlate("has",false))%>    <%Response.Write(xlate("has not",false))%>
<%Response.Write(xlate("executed in the last",false))%>  

" style="width: 550px;"> <%=xlate("Applications", false)%>

."> ID="Checkbox2" onclick="javascript:needToSave=true;">  <%Response.Write(xlate("Contains",false))%>  <%Response.Write(xlate("Missing",false))%> <%Response.Write(xlate("application",false))%>

."> style="margin-left:24px;" onclick="javascript:needToSave=true;"> <%Response.Write(xlate("Version string is",false))%>  >    <    =    Like

<% if(appsCount > 0) { %>
" style="width: 550px;"> <%=xlate("Add-On Modules", false)%>
<% Response.Write(xlate("Show machines with the following modules installed",false)); %> <%for(i = 0;i < appsCount; i++) { if(i == 0) { %>
><% } else if (i == 1) {%>
><% } else if (i == 2) {%>
><% } else if (i == 3) {%>
><% } else if (i == 4) {%>
><% } else if (i == 5) {%>
><% } else if (i == 6) {%>
><% } else if (i == 7) {%>
><% } else if (i == 8) {%>
><% } else if (i == 9) {%>
><% } else if (i == 10) {%>
><% } else if (i == 11) {%>
><% } else if (i == 12) {%>
><% } else if (i == 13) {%>
><% } else if (i == 14) {%>
><% } else if (i == 15) {%>
><% } else if (i == 16) {%>
><% } else if (i == 17) {%>
><% } else if (i == 18) {%>
><% } else if (i == 19) {%>
><% } Response.Write(" "+xlate(appArrayStr[i],false)); } %>
<% } %> <% if(labelsCount > 0) { %>
" style="width: 550px;"> <%=xlate("Label", false)%>
<% Response.Write(xlate("Show machines with ",false)); %>  <%Response.Write(xlate("all",false))%>   <%Response.Write(xlate("any ",false))%> <% Response.Write(xlate("of the following labels",false)); %>
<%for(i = 0;i < labelsCount; i++) { if(i == 0) { %>
><% } else if (i == 1) {%>
><% } else if (i == 2) {%>
><% } else if (i == 3) {%>
><% } else if (i == 4) {%>
><% } else if (i == 5) {%>
><% } else if (i == 6) {%>
><% } else if (i == 7) {%>
><% } else if (i == 8) {%>
><% } else if (i == 9) {%>
><% } else if (i == 10) {%>
><% } else if (i == 11) {%>
><% } else if (i == 12) {%>
><% } else if (i == 13) {%>
><% } else if (i == 14) {%>
><% } else if (i == 15) {%>
><% } else if (i == 16) {%>
><% } else if (i == 17) {%>
><% } else if (i == 18) {%>
><% } else if (i == 19) {%>
><% } else if (i == 20) {%>
><% } else if (i == 21) {%>
><% } else if (i == 22) {%>
><% } else if (i == 23) {%>
><% } else if (i == 24) {%>
><% } else if (i == 25) {%>
><% } else if (i == 26) {%>
><% } else if (i == 27) {%>
><% } else if (i == 28) {%>
><% } else if (i == 29) {%>
><% } else if (i == 30) {%>
><% } else if (i == 31) {%>
><% } else if (i == 32) {%>
><% } else if (i == 33) {%>
><% } else if (i == 34) {%>
><% } else if (i == 35) {%>
><% } else if (i == 36) {%>
><% } else if (i == 37) {%>
><% } else if (i == 38) {%>
><% } else if (i == 39) {%>
><% } else if (i == 40) {%>
><% } else if (i == 41) {%>
><% } else if (i == 42) {%>
><% } else if (i == 43) {%>
><% } else if (i == 44) {%>
><% } else if (i == 45) {%>
><% } else if (i == 46) {%>
><% } else if (i == 47) {%>
><% } else if (i == 48) {%>
><% } else if (i == 49) {%>
><% } else if (i == 50) {%>
><% } else if (i == 51) {%>
><% } else if (i == 52) {%>
><% } else if (i == 53) {%>
><% } else if (i == 54) {%>
><% } Response.Write(" "+xlate(labelArrayStr[i],false)); } %>
<% } %>
" style="width: 550px;"> <%=xlate("Patch Management", false)%>
<%if (showCollections == true) { %>

."> >  <%Response.Write(xlate("Show",false))%>    <%Response.Write(xlate("Hide",false))%>   <%Response.Write(xlate("members of patch policy",false))%>

<% } %>

."> > <%Response.Write(xlate("Machines that have no patch scan results (unscanned)",false))%>

."> > <%Response.Write(xlate("Machines missing greater than or equal to",true))%> <%Response.Write(xlate("patches",true))%>.  ( ."> > <%Response.Write(xlate("Use Patch Policy",true))%> )

."> > <%Response.Write(xlate("Patch scan",false))%>  <%Response.Write(xlate("scheduled",false))%>    <%Response.Write(xlate("not scheduled",false))%>

."> > <%Response.Write(xlate("Default patch scan source",false))%>  <%Response.Write(xlate("Offline",false))%>    <%Response.Write(xlate("Online",false))%>

."> > <%Response.Write(xlate("Last execution status for patch scan",false))%>    <%Response.Write(xlate("success",false))%>    <%Response.Write(xlate("failed",false))%>

."> > <%Response.Write(xlate("Patch scan",false))%>  <%Response.Write(xlate("has",false))%>    <%Response.Write(xlate("has not",false))%>   <%Response.Write(xlate("executed in the last",false))%>

."> > <%Response.Write(xlate("Machines with Reboot Pending for patch installations",false))%>

."> > <%Response.Write(xlate("Machines with patch installation failures",false))%>

."> > <%Response.Write(xlate("Machines with Windows service WUAUSERV not running",false))%>

."> > <%Response.Write(xlate("Machines with Patch Test Result",false))%>

."> > <%Response.Write(xlate("Machines with Patch Automatic Update configuration",false))%>

."> > <%Response.Write(xlate("Machines with Patch Reboot Action configuration",false))%>

."> > <%Response.Write(xlate("Machines with Patch File Source configuration",false))%>

."> > <%Response.Write(xlate("Machines missing patch (use KB Article ID - digits only)",false))%>

."> > <%Response.Write(xlate("Machines with installed patch (use KB Article ID - digits only)",false))%>

."> > <%Response.Write(xlate("Machines being used as file share",false))%>

."> > <%Response.Write(xlate("Machines with file share located at",false))%> "><%=xlate("select a machine",true)%>

."> > <%Response.Write(xlate("Machines with patch scan source set to online but offline scan ran last",false))%>

."> > <%Response.Write(xlate("Windows Automatic Update",false))%>  <%Response.Write(xlate("is disabled",false))%>    <%Response.Write(xlate("is not disabled",false))%>

" style="width: 550px;"> <%=xlate("Monitoring", false)%>

."> > <%Response.Write(xlate("Only show machines with monitorset assigned",false))%>

."> > <%Response.Write(xlate("Only show machines with monitorset assigned",false))%>

ID="Checkbox5"> <%Response.Write(xlate("Advanced agent data filter",false))%> ..." class="tinyButton" onclick="openAdvanced(<%=advFilterId%>)" <% = (Number(activeViewId) > 0 ? "":"disabled='disabled'") %> /> <% if (Number(activeViewId) == 0) { %> <% = xlate("Save view before defining filter",true) %> <% } %>
<% } %>