<!DOCTYPE html>

<%@ include file = "EgTrackerA.jsp" %>
<%@ taglib prefix = "egui" uri="../WEB-INF/eg-taglib.tld" %> 
<%@ page language = "java" contentType = "text/html; charset=UTF-8" pageEncoding = "UTF-8" %>
<%@ include file="listSearchJson.jsp"%>

<%@ page import = "java.util.*"%>
<%@ page import = "com.eg.EgCrypt"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "com.eg.EgMemInfo"%>
<%@ page import = "com.eg.EgInstallInfo"%>
<%@ page import = "com.egurkha.EgConstants"%>
<%@ page import = "com.egurkha.ini.IniUI"%>
<%@ page import = "com.egurkha.util.StringUtils"%>
<%@ page import="egurkha.TransactionBean"%>

<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader("Expires", -1);
	String selectedNode = request.getParameter("selectedNode");
	String select = request.getParameter("select");
	String choose = request.getParameter("choose");
	if (choose != null && !choose.equalsIgnoreCase("null") && choose.length() > 0)
	{
		select = choose;
	}
	if (select != null && select.equalsIgnoreCase("twofa"))
	{
		selectedNode = "twofa";
	}
	else if (select != null && select.equalsIgnoreCase("enabletwofa"))
	{
		selectedNode = "twofa";
	}
	else if (select != null && select.equalsIgnoreCase("egmgrmodel"))
	{
		selectedNode = "egmgrmodel";
	}
	String isCallToEnableCPFromReporter = request.getParameter("isCallToEnableCPFromReporter");
	if (selectedNode == null || selectedNode.equals("null") || selectedNode.length() == 0) selectedNode = "generalId";
	if (isCallToEnableCPFromReporter == null || isCallToEnableCPFromReporter.equals("null")) isCallToEnableCPFromReporter = "";
	String fromPage = request.getParameter("fromPage");
	fromPage = (fromPage == null)?"":fromPage;
	
	String adminLastAccessedURL  =(String)session.getAttribute("adminLastAccessedURL");
	boolean isLastAccessedURL = false; 
	if (adminLastAccessedURL == null) 
	{
		isLastAccessedURL = true;
	}

	boolean isMsp = false;
	IniFile ServicesIni = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_services.ini");
	String eGMgrModel = ServicesIni.getValue("MISC_ARGS","eGMgrModel");
	if (eGMgrModel != null && eGMgrModel.equalsIgnoreCase("msp"))
	{
		isMsp = true;
	}

	IniFile mailIni =  new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_services.ini");
	String mailSender = mailIni.getValue("MISC_ARGS","MailSender");
	String enableCloudRegistration = mailIni.getValue("MISC_ARGS","enableCloudRegistration");
	boolean isMailSettingsConfiguredForMSP = true;
	if (enableCloudRegistration != null && (enableCloudRegistration.equalsIgnoreCase("true") || enableCloudRegistration.equalsIgnoreCase("yes")) && (mailSender == null || mailSender.trim().length() <= 0))
	{
		isMailSettingsConfiguredForMSP = false;
	}
	
	TransactionBean dbconfig = new TransactionBean();
	dbconfig.createFile("eg_db.ini");
	int measurementCleanPeriod=42;
	try
	{
		String strVal1 = dbconfig.getStrValue("MANAGER_SETTINGS","MeasurementCleanPeriod");
		if(strVal1 != null)
		{
			measurementCleanPeriod = Integer.parseInt(strVal1);
		}
	}
	catch(Exception e)
	{
		measurementCleanPeriod=42;
		e.printStackTrace();
	}

	IniFile mgrHost =  new IniFile(EgInstallInfo.getInstallDir() + "/manager/config/eg_specs.ini");
	String server= mgrHost.getValue("SETTINGS","EG_SERVER");
	boolean isIPV4 = com.eg.IPV6Helper.validateIPV4(server);
	boolean isIPV6 = com.eg.IPV6Helper.validateIPV6(server);
	boolean isIpBasedInstallation = false;
	if (isIPV4 || isIPV6)
	{
		isIpBasedInstallation = true;
	}

%>

<%!
	String subject = "MISC_ARGS";
	String adminCommon="admin.common.";
%>

<html>
<head>
	<meta charset="utf-8">
	<title>MANAGER SETTINGS</title>

	<!--Skin color--------->
	<egui:skin ui = "admin"/>

	<!---Components, icons, skin and Core ext script--->
	<script type="text/javascript" src="../extjs/ext-all.js"></script>

	<!-- Fancy Scroll-->
	<script src="/final/jquery/jquery.js"></script>
	<script src="/final/styles/jscrollpane/jquery.jscrollpane.js" ></script>
	<script src="/final/styles/jscrollpane/jquery.mousewheel.js" ></script>
	<script src="/final/styles/jscrollpane/mwheelIntent.js" ></script>
	<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>
	
	<style type="text/css">
	.img_removeShift{
		background-image : url('/final/admin/eg_images/minus.gif');background-repeat : no-repeat;
	}
	</style>

	<script type="text/javascript">
		var isMsp = <%=isMsp%>;
		var isIpBasedInstallation = <%=isIpBasedInstallation%>;
		var switchtoMspMsg = '<egui:intnl text="admin.settings.Switch to MSP message"/>';
		var isMailSettingsConfiguredForMSP = <%=isMailSettingsConfiguredForMSP%>;
		var tfaJsonData = '';
		var csrfToken = '<%=strCsrfToken%>';
		var select = '<%=select%>';
		var ssoLoginJson = '';
		var alertForAlreadyExists = '<egui:intnl text="admin.minmax.Measure with chosen Display already exists"/>';
		var alertForNoDisplay = '<egui:intnl text="admin.minmax.Please choose the Display"/>';
		var alertForNoMeasure = '<egui:intnl text="admin.minmax.Please choose the Measure"/>';
		var alertForTestType = '<egui:intnl text="admin.minmax.Please choose the Test type"/>';
		var alertForEnableMetricsComp = '<egui:intnl text="admin.minmax.Please enable metrics computation"/>';
		var alertForNoMeasuresConfigured = '<egui:intnl text="admin.minmax.No measures configured"/>';
		var alertForNotIntegerThreshold = '<egui:intnl text="admin.settings.How frequently thresholds are computed (mins) should be a valid positive integer"/>';

		var alertForTrendComp = '<egui:intnl text="admin.settings.Number of threads for trend computation should be a valid positive integer"/>';
		var alertForThreshComp = '<egui:intnl text="admin.settings.Number of threads for threshold computation should be a valid positive integer"/>';
		var alertForFreqThresh = '<egui:intnl text="admin.settings.How frequently thresholds are computed (mins) should be a valid positive integer"/>';
		var alertForDataPeriod = '<egui:intnl text="admin.settings.Data period that is used for sliding-window thresholds should be a valid positive integer"/>';

		var pageTitle = '<egui:intnl text="admin.managersettings.ITSM/COLLABORATION INTEGRATION"/>';
		var itsmTitle = '<egui:intnl text="admin.managersettings.ITSM/Collaboration Integration"/>';
		var generalPageTitle = '<egui:intnl text="admin.managersettings.General Settings"/>';
		var discoveredCompPageTitle = '<egui:intnl text="admin.managersettings.Discovered Components Pop-up Time"/>';
		var testConfigPageTitle = '<egui:intnl text="admin.managersettings.Test configuration settings"/>';
		var commandExecPageTitle = '<egui:intnl text="admin.managersettings.Command execution settings"/>';
		var threshConfigPageTitle = '<egui:intnl text="admin.managersettings.Threshold Configuration settings"/>';
		var logSettingsPageTitle = '<egui:intnl text="admin.managersettings.Log settings"/>';
		var advSettingsPageTitle = '<egui:intnl text="admin.managersettings.Advance settings"/>';
		var capacityPlanPageTitle = '<egui:intnl text="admin.managersettings.Capacity Planning settings"/>';
		var virtualTopoPageTitle = '<egui:intnl text="admin.managersettings.Virtual topology settings"/>';
		var auditingPageTitle = '<egui:intnl text="admin.managersettings.Auditing settings"/>';
		var scriptTypes = '<egui:intnl text="admin.settings.Allowed script types"/>';

		var uploadBtnText = '<egui:intnl text="admin.settings.Upload"/>';
		var updateBtnText = '<egui:intnl text="admin.settings.Update"/>';
		var yesRadioOption = '<egui:intnl text="admin.common.Yes"/>';
		var noRadioOption = '<egui:intnl text="admin.common.No"/>';
		var genRadioOption = '<egui:intnl text="admin.common.Generic"/>';
		var specRadioOption = '<egui:intnl text="admin.common.Specific"/>';
		var criticalCheckboxOption = '<egui:intnl text="admin.common.Critical"/>';
		var majorCheckboxOption = '<egui:intnl text="admin.common.Major"/>';
		var minorCheckboxOption = '<egui:intnl text="admin.common.Minor"/>';
		var normalCheckboxOption = '<egui:intnl text="admin.common.Normal"/>';
		var onRadioOption = '<egui:intnl text="admin.common.On"/>';
		var offRadioOption = '<egui:intnl text="admin.common.Off"/>';
		var overWriteRadioOption = '<egui:intnl text="admin.common.Overwrite"/>';
		var appendRadioOption = '<egui:intnl text="admin.common.Append"/>';
		var autoRadioOption = '<egui:intnl text="admin.common.Auto"/>';
		var manualRadioOption = '<egui:intnl text="admin.common.Manual"/>';
		var uploadSuccessMessage = '<egui:intnl text="admin.settings.Request has been processed successfully"/>';
		var uploadFailureMessage = '<egui:intnl text="admin.settings.Request has not been processed successfully"/>';

		var settingsSuccessUpdate = '<egui:intnl text="admin.common.Settings updated successfully"/>.';
		var settingsNoSuccessUpdate = '<egui:intnl text="admin.common.Settings not updated successfully"/>.';

		var generalSettingsDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the different activities performed by the eG manager"/>' + '.';
		var ipPolicyDesc = '<egui:intnl text="admin.settings.This page helps administrators to restrict the IP addresses from which administrative activities can be performed"/>' + '.';
		var gerneralTitle = '<egui:intnl text="admin.settings.General Settings" />';
		var ttCommonTitle = '<egui:intnl text="admin.settings.Common Settings" />';
		var enableFilterTTLbl = '<egui:intnl text="admin.settings.Filter incidents/tickets" />';
		var generalComputeMetrics = '<egui:intnl text="admin.settings.Compute average/sum of metrics while trending" />';
	//	var sendNormalMailLbl = '<egui:intnl text="admin.settings.Send normal mails" />';
		var sendNormalMailLbl = '<egui:intnl text="admin.settings.Enable automatic alert closure and intimation" />';
		var enableDDLbl = '<egui:intnl text="admin.settings.Enable detailed diagnosis" />';
		var mailopLbl = '<egui:intnl text="admin.settings.Mail output format" />';
		var subjectLbl = '<egui:intnl text="admin.settings.Subject" />';
		var mailIDLbl = '<egui:intnl text="admin.settings.Mail ID" />';
		var includeUserLbl = '<egui:intnl text="admin.settings.Include user details in mail" />';
		var useUniqueIdLbl = '<egui:intnl text="admin.settings.Use unique ID" />';
		var priorasNumLbl = '<egui:intnl text="admin.settings.Priority as numeric" />';
		var applyPriorLbl = '<egui:intnl text="admin.settings.Apply priority for all mails" />';
		var enableTTSnmpLbl = '<egui:intnl text="admin.settings.Enable trouble ticket integration over SNMP trap" />';
		var generalNoOfThreadsTrend = '<egui:intnl text="admin.settings.Number of threads for trend computation" />';
		var generalNoOfThreadsThreshold = '<egui:intnl text="admin.settings.Number of threads for threshold computation" />';
		var generalThresholdFreq = '<egui:intnl text="admin.settings.How frequently thresholds are computed (mins)" />';
		var generalDataPeriod = '<egui:intnl text="admin.settings.Data period that is used for sliding-window thresholds" />';
		var generalThresholdHours = '<egui:intnl text="admin.settings.Hours for which relative thresholds are computed" />';
		var generalAutoMappIpToName = '<egui:intnl text="admin.settings.Automatically map IP address of agents to nick names" />';
		var generalAgentVerify = '<egui:intnl text="admin.settings.Verify if agent is reporting from configured IP" />';
		var authLogin = '<egui:intnl text="admin.settings.Authenticate users for login" />';
		var notificationTitle = '<egui:intnl text="admin.settings.Manager Notification" />';
		var showLicenseExpiryAlert = '<egui:intnl text="admin.settings.Show license expiry alert" />';
		var showExhaustedLicenses = '<egui:intnl text="admin.settings.Show alert when agent licenses are exhausted" />';
		var showNotRunningAgents = '<egui:intnl text="admin.settings.Show not running agents list" />';
		var showNewlyDiscComps = '<egui:intnl text="admin.settings.Show newly discovered components alert" />';
		var showUnconfigAgents = '<egui:intnl text="admin.settings.Show unconfigured agents list" />';
		var showUpgradeTests = '<egui:intnl text="admin.settings.Show alert for new/deprecated tests found after an upgrade" />';
		var notificationSuccessTitle = '<egui:intnl text="admin.settings.MANAGER NOTIFICATION SETTINGS" />';

		var discCompDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var discCompTitle = '<egui:intnl text="admin.settings.Newly discovered components" />';
		var newlyDiscComp = '<egui:intnl text="admin.settings.Show newly discovered components alert in manager notification" />';

		var testConfigDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var testConfigTitle = '<egui:intnl text="admin.settings.Test Configuration" />';
		//var popupListTests = '<egui:intnl text="admin.settings.Pop up list of unconfigured tests" />';
		var isHostEditable = '<egui:intnl text="admin.settings.Is host editable?" />';
		
		var threshConfigDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var threshConfigTitle = '<egui:intnl text="admin.settings.Threshold Configuration" />';
		var autoThreshCompPolicy = '<egui:intnl text="admin.settings.Automatic threshold computation policy" />';
		var loopBackPeriod = '<egui:intnl text="admin.settings.Lookback period to compute automatic thresholds" />';
		var alertForNoLookBackPeriod = '<egui:intnl text="admin.settings.Lookback period to compute automatic thresholds should be a valid positive integer"/>';
		var alertForNotGreaterThanZero = '<egui:intnl text="admin.settings.Lookback period to compute automatic thresholds should be greater than zero"/>';

		var commandExecDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var commandExecTitle = '<egui:intnl text="admin.settings.Command Execution" />';
		var commandExecEnable = '<egui:intnl text="admin.settings.Enable Command Execution" />';
		var logFileSize = '<egui:intnl text="admin.settings.Log file maximum size (MB)" />';
		var logEntriesStdout = '<egui:intnl text="admin.settings.Log entries for stdout also" />';
		var seperateExec = '<egui:intnl text="admin.settings.Separate execution" />';
		var commandLength = '<egui:intnl text="admin.settings.Command length (chars)" />';
		var alertForLogMaximumSize = '<egui:intnl text="admin.ui.Log File Maximum Size should be a valid positive integer"/>';
		var alertForCommandLength = '<egui:intnl text="admin.ui.Command length should be a valid positive integer"/>';

		var ttManagerDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var ttManagerCLI = '<egui:intnl text="admin.settings.CLI" />';
		var ttManagerMail = '<egui:intnl text="admin.settings.Mail" />'; 
		var ttManagerSnmp = '<egui:intnl text="admin.settings.SNMP" />'; 
		var ttManagerWebService = '<egui:intnl text="admin.settings.Web services" />';
		var ttManagerMailSnmp = '<egui:intnl text="admin.settings.Mail and SNMP" />';
		var ttSettings = '<egui:intnl text="admin.settings.ITSM/COLLABORATION INTEGRATION" />';
		var ttIntegrationTitle = '<egui:intnl text="admin.settings.ITSM/COLLABORATION INTEGRATION" />';
		var ttJSONPayloadMsg = '<egui:intnl text="admin.settings.Invalid JSON payload" />';
		var ttConfigureDetailsMsg = '<egui:intnl text="admin.settings.Please configure the details" />';
		
		var ttEnableMailMsg = '<egui:intnl text="admin.settings.Please enable Mail alerts" />';
		var ttEnableSNMPMsg = '<egui:intnl text="admin.settings.Please enable trouble ticket integration over SNMP trap" />';
		var ttEnableCLIMsg = '<egui:intnl text="admin.settings.Please enable CLI" />';
		var ttEnableWebservicsMsg = '<egui:intnl text="admin.settings.Please enable web service integration" />';
		var ttListPageTitle = '<egui:intnl text="admin.settings.ITSM/COLLABORATION INTEGRATION" />';

		var ttEnableCLI = '<egui:intnl text="admin.settings.Enable CLI" />';
		var ttCommand = '<egui:intnl text="admin.settings.Command" />';
		var ttCommandArgs = '<egui:intnl text="admin.settings.Command arguments" />';
		var ttAllowedAlarms = '<egui:intnl text="admin.settings.Alarm preference" />';
		var ttNoFileUpload = '<egui:intnl text="admin.settings.Please upload trouble ticket integration archive file" />';

		var logMaxSize = '<egui:intnl text="admin.settings.Log file maximum size (MB)" />';
		var logMaxSizeNoUnit = '<egui:intnl text="admin.settings.Log file maximum size" />';
		var logMaxFilesLabel = '<egui:intnl text="admin.settings.Maximum number of log files" />';
		var logStdOut = '<egui:intnl text="admin.settings.Enable logging" />';
		var enableGraph = '<egui:intnl text="admin.settings.Send graph in trouble ticket" />';
		var dateFormat = '<egui:intnl text="admin.settings.Date format to be used" />';
		var commandLength = '<egui:intnl text="admin.settings.Command length (chars)" />';
		var probDescLength = '<egui:intnl text="admin.settings.Problem description length (chars)" />';

		var ttIntegration = '<egui:intnl text="admin.settings.Trouble Ticket(TT) Integration" />';
		var enableTTIntegration = '<egui:intnl text="admin.settings.Enable web service integration" />';
		var ttIntegrationSystem = '<egui:intnl text="admin.settings.Trouble ticket system" />';
		var ttName = '<egui:intnl text="admin.settings.Name" />';
		var ttSystemURL = '<egui:intnl text="admin.settings.Trouble ticket system URL" />';
		var ttSystemUser = '<egui:intnl text="admin.settings.Trouble ticket system user name" />';
		var ttSystemPassword = '<egui:intnl text="admin.settings.Trouble ticket system password" />';
		var ttOutputFormat = '<egui:intnl text="admin.settings.Trouble ticket integration output format" />';
		var ttUploadArcheive = '<egui:intnl text="admin.settings.Do you want to upload supporting archives?" />';
		var ttSystemAPI = '<egui:intnl text="admin.settings.Trouble ticket system API key" />';
		var ttSystemAllowedAlarms = '<egui:intnl text="admin.settings.Trouble ticket system allowed alarms" />';
		var ttDeleteConfiguration = '<egui:intnl text="admin.settings.Do you want to delete this configuration" />';
		var ttDeleteAcmeFile = '<egui:intnl text="admin.settings.Do you want to delete " />';
		var jarFile = '<egui:intnl text="admin.settings.jar file" />';
		var onlyJar = '<egui:intnl text="admin.settings.jar" />';
		var ttDeletedSuccess = '<egui:intnl text="admin.settings.Trouble ticket integration settings have been removed successfully" />' + '.';

		var alertForNocommon = '<egui:intnl text="admin.settings.Field cannot be blank"/>';
		var alertForTTSystem = '<egui:intnl text="admin.settings.Please select a trouble ticket system"/>';
		var alertForNoURL = '<egui:intnl text="admin.settings.URL cannot be blank"/>';
		var alertForNoUsername = '<egui:intnl text="admin.settings.Username cannot be blank"/>';
		var alertForNoPassword = '<egui:intnl text="admin.settings.Password cannot be blank"/>';
		var alertForNoOutputFields = '<egui:intnl text="admin.settings.Output fields cannot be blank"/>';
		var alertForNoAPI = '<egui:intnl text="admin.settings.API key cannot be blank"/>';
		var alert6='<egui:intnl text="admin.settings.Please choose the alarm preference" />';

		var logSettingsDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var logSettingsTitle = '<egui:intnl text="admin.settings.Log Settings" />';
		var logSetCleanUp = '<egui:intnl text="admin.settings.Log eG database cleanup operations" />';
		var logSetSchedule = '<egui:intnl text="admin.settings.Log the scheduling of reports" />';
		var logSetTrend = '<egui:intnl text="admin.settings.Log data trending activity" />';
		var logSetThresh = '<egui:intnl text="admin.settings.Log threshold computation activity" />';

		var auditSetDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var auditSetTitle = '<egui:intnl text="admin.settings.Auditing" />';
		var enableAuditing = '<egui:intnl text="admin.settings.Enable auditing" />';
		var includeCLI = '<egui:intnl text="admin.settings.Include activities from the admin command line interface" />';

		var advSetDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var advSetTitle = '<egui:intnl text="admin.settings.Advanced Settings" />';
		var advSetRestart = '<egui:intnl text="admin.settings.Restart the manager?" />';
		var advSetRestart_pri = '<egui:intnl text="admin.settings.Restart the primary manager?" />';
		var advSetRestart_sec = '<egui:intnl text="admin.settings.Restart the secondary manager?" />';
		var advSetOutput = '<egui:intnl text="admin.settings.Manager Output and Error" />';
		var advSetMode = '<egui:intnl text="admin.settings.Output and Error mode" />';
		var advSetUpdFiles = '<egui:intnl text="admin.settings.Update Manual Config Files" />';
		var advSetAggregateComps = '<egui:intnl text="admin.settings.Agents for aggregate components" />';
		var labelRemoteAgent = '<egui:intnl text="admin.settings.Remote" />';
		var labelExternalAgent = '<egui:intnl text="admin.settings.External" />';
		var enableOutputErrorAlert = '<egui:intnl text="admin.settings.Are you sure you want to enable the Output & Error" />';
		var disableOutputErrorAlert = '<egui:intnl text="admin.settings.Are you sure you want to disable the Output & Error" />';

		var capPlanDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var capPlanTitle = '<egui:intnl text="admin.settings.Capacity Planning" />';
		var capPlanEnable = '<egui:intnl text="admin.settings.Enable capacity computation by the manager" />';
		var capReportEnable = '<egui:intnl text="admin.settings.Enable capacity reports" />';

		var virtualTopoDesc = '<egui:intnl text="admin.settings.This page enables the administrator to define the settings for the eG monitor interface" />' + '.';
		var virtualTopoTitle = '<egui:intnl text="admin.settings.Virtual Topology" />';
		var virtualTopoMapping = '<egui:intnl text="admin.settings.Virtual topology mapping" />';
		
		var accountSecurityTitle = '<egui:intnl text="admin.settings.Account Security" />';
		var lockoutTitle = '<egui:intnl text="admin.settings.Account Lockout" />';
		var msgType = '<egui:intnl text="admin.settings.Message Type" />';
		var lckType = '<egui:intnl text="admin.settings.Enable account lockout?" />';
		var nofAttmpt = '<egui:intnl text="admin.settings.Allowed login failure attempts" />';
		var lckStrategy = '<egui:intnl text="admin.settings.Lockout Strategy" />';
		var timeperiod = '<egui:intnl text="admin.settings.Time period (in mins)" />';
		var time = '<egui:intnl text="admin.settings.Time" />';
		var reset = '<egui:intnl text="admin.settings.Reset" />';
		
		var pwdpolicyTitle = '<egui:intnl text="admin.settings.Password Policy" />';
		var pwdComplexityTitle = '<egui:intnl text="admin.settings.Password Complexity" />';
		var pwdHistoryTitle = '<egui:intnl text="admin.settings.Password History" />';
		var minLenText = '<egui:intnl text="admin.settings.Minimum password length" />';
		var defMinLenAlert = '<egui:intnl text="admin.settings.Minimum password length should be greater than or equal to 2" />';
		var minLenAlert = '<egui:intnl text="admin.settings.The password length should be greater than or equal to the number of options you had selected as part of the password complexity" />';
		var pwdCompAlert = '<egui:intnl text="admin.settings.Please select atleast any one of the password complexity" />';
		var maxLenAlert = '<egui:intnl text="admin.settings.Maximum password length should not be greater than 16" />';
		var noLenAlert = '<egui:intnl text="admin.settings.Enter the password length"/>';
		var pwdComplexityText = '<egui:intnl text="admin.settings.Password should contain" />';
		var noComplexityAlert = '<egui:intnl text="admin.settings.Please choose atleast one password complexity"/>';
		var minHistoryEnableText = '<egui:intnl text="admin.settings.Enforce Password History" />';
		var pwdHistoryText1 = '<egui:intnl text="admin.settings.Store upto" />';
		var pwdHistoryText2 = '<egui:intnl text="admin.settings.passwords in the password history" />';
		var minHistoryAlert = '<egui:intnl text="admin.settings.The number of passwords that should be stored in the history should be greater than or equal to 1" />';
		var maxHistoryAlert = '<egui:intnl text="admin.settings.The number of passwords that should be stored in the history should not be greater than 20" />';
		var noHistoryAlert = '<egui:intnl text="admin.settings.Please specify the number of passwords to be stored in password history"/>';

		var secureFilterTitle = '<egui:intnl text="admin.settings.Security Filters" />';
		var secureLbl1 = '<egui:intnl text="admin.settings.Enable Security Filters" />';
		var enableMsg = '<egui:intnl text="admin.settings.Restart your manager to enable security filters" />';
		var disableMsg = '<egui:intnl text="admin.settings.Restart your manager to disable security filters" />';

		var ipPolicyTitle = '<egui:intnl text="admin.settings.Administration Policy" />';
		var noIPPolicyMsg = '<egui:intnl text="admin.settings.Administrative activities can be performed without any restriction" />';
		var ipFieldBlankMsg = '<egui:intnl text="admin.settings.Please enter the IP address" />';
		var ipFieldSpaceMsg = '<egui:intnl text="admin.settings.IP address or IP range should not contain space" />';
		var invalidIPMsg = '<egui:intnl text="admin.settings.Invalid IP in IP range"/>';
		var invalidIPRangeMsg = '<egui:intnl text="admin.settings.IP range is not valid"/>';
		var dblIPRangeMsg = '<egui:intnl text="admin.settings.IP range not allowed in DBL(Chinese,Korean,Japanese)"/>';
		var rangeAndPatternErrMsg = '<egui:intnl text="admin.settings.IP range should not contain pattern"/>';
		var successMsg = '<egui:intnl text="admin.settings.Administration policy has been configured successfully"/>';
		var errorMsg = '<egui:intnl text="admin.settings.Error occured while configuring administration policy"/>';
		var allowAllErrMsg = '<egui:intnl text="admin.settings.You cannot configure this policy along with the existing policies"/>';
		var deleteAllIPMsg = '<egui:intnl text="admin.settings.Are you sure you want to delete all the administration policies"/>';
		var deleteAllIPMsgSuccess = '<egui:intnl text="admin.settings.All the administration policies have been deleted successfully"/>';
		var deleteAllIPMsgFailure = '<egui:intnl text="admin.settings.Error in deleting the administration policies"/>';
		var duplicateIPMsg = '<egui:intnl text="admin.settings.Duplicate administration policies are not allowed"/>';
		var commaRestrictionMsg = '<egui:intnl text="admin.settings.IP address should not contain comma"/>';
		var managerSettingsMsg = '<egui:intnl text="admin.settings.Authentication provider for login"/>';
		var eGEnterprisesMsg = '<egui:intnl text="admin.settings.eG Enterprise"/>';
		var activeDirectoryMsg = '<egui:intnl text="admin.settings.Active Directory"/>';
		var identityProviderMsg = '<egui:intnl text="admin.settings.SAML Identity Provider"/>';
		var addMorePolicyMsg = '<egui:intnl text="admin.settings.Add More Policy"/>';
		var addPolicyMsg = '<egui:intnl text="admin.settings.Add Policy"/>';
		var deleteAllMsg = '<egui:intnl text="admin.settings.Delete All"/>';
		var inputs = 1;


		var alertForNoTTWrapperClass = '<egui:intnl text="admin.settings.Please enter trouble ticket integration class" />';
		var alertForFileExtension = '<egui:intnl text="admin.ui.Please upload a "/>';

		var loginLogoNotUploaded = '<egui:intnl text="admin.logo.Please upload custom logo for login screen"/>';
		var monitorLogoNotUploaded = '<egui:intnl text="admin.logo.Please upload custom logo for monitor interface"/>';
		var reporterLogoNotUploaded = '<egui:intnl text="admin.logo.Please upload custom logo for reporter interface"/>';
		var configLogoNotUploaded = '<egui:intnl text="admin.logo.Please upload custom logo for configuration management interface"/>';
		var alertSoundNotUploaded = '<egui:intnl text="admin.logo.Please upload custom sound files for audible alerts"/>';
		
		var specialCharInMessages = '<egui:intnl text="admin.logo.Special characters not allowed in messages"/>';
		var captionNotAllowedInDBL = '<egui:intnl text="admin.logo.Caption is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
		var noSubscrExpiryMsg = '<egui:intnl text="admin.logo.Please enter subscription expired message"/>';
		var errorMsgNotAllowedInDBL = '<egui:intnl text="admin.logo.Error Message is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
		var warningMsgNotAllowedInDBL = '<egui:intnl text="admin.logo.Warning message is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
		var mailAlertNotAllowedInDBL = '<egui:intnl text="admin.logo.Mail alert is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
		var notValidMailId = '<egui:intnl text="admin.logo.Please enter a valid mail ID"/>';

		var fileNotWithReqExt = '<egui:intnl text="admin.logo.Field is empty or the selected file does not have the extension"/>';
		var fileNameNotSingleByte = '<egui:intnl text="admin.logo.File name is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';

		loginImageUploadStatus = 'NotUploaded';
		monitorImageUploadStatus = 'NotUploaded';
		reporterImageUploadStatus = 'NotUploaded';
		configImageUploadStatus = 'NotUploaded';
		alertSoundUploadStatus = 'NotUploaded';
		fileUploadModule = '';
		var selectedNodeID = '<%=selectedNode%>';
		var isLastAccessedURL = '<%=isLastAccessedURL%>';
		var lastEventMgrSetting = sessionStorage.getItem("lastSelectedEvent");
		if (isLastAccessedURL == "true")
		{
			selectedNodeID = lastEventMgrSetting;
		}
		var isCallToEnableCPFromReporter = '<%=isCallToEnableCPFromReporter%>';
		var fromPage='<%=fromPage%>';

		var probsErrorMessage = '<egui:intnl text="admin.error.Problem encountered while loading the user interface"/>.';
		var requestTimeOut = '<egui:intnl text="admin.error.Response timed out"/>.';
		var errorTitle = '<egui:intnl text="admin.user.Error"/>';
		var mailValid = '<egui:intnl text="admin.settings.Please enter a valid e-mail address"/>';
		var mailSubjectBnk = '<egui:intnl text="admin.settings.Mail subject cannot be blank"/>';
		var mailIDDBL = '<egui:intnl text="admin.settings.Mail ID is not allowed in DBL(Chinese,Korean,Japanese)"/>';
		var mailSubjectValid = '<egui:intnl text="admin.settings.Please do not specify the eG keywords for mail subject value"/>';
		var ssoLoginLbl = '<egui:intnl text="admin.settings.Enable single sign-on (SSO)"/>';
		var idpLogoutLbl = '<egui:intnl text="admin.settings.Allow the user to logout from the SAML Identity Provider (IdP)"/>';
		var successMsgSSOLbl = '<egui:intnl text="admin.settings.Single Sign-On settings have been updated successfully"/>';
		var updateLogoutUrlMsg = '<egui:intnl text="admin.settings.Please update logout URL for configured SAML Identity Providers"/>';
		var SSOTitleLbl = '<egui:intnl text="admin.settings.Single Sign-On"/>';
		
		// for 2fa
		var TFATitle = '<egui:intnl text="admin.settings.2-STEP VERIFICATION"/>';
		var TFATitle2 = '<egui:intnl text="admin.settings.2-Step Verification"/>';
		var enable2FALabel = '<egui:intnl text="admin.settings.Enable 2-Step Verification"/>';
		var enforce2FALabel = '<egui:intnl text="admin.settings.Enforce the feature as a enterprise security standard"/>';
		var otpLabel = '<egui:intnl text="admin.settings.One-Time Password (OTP)"/>';
		var TFAUpdateMsg = '<egui:intnl text="admin.settings.2-step verification settings have been updated successfully"/>';
		var autoLoginAlertMsg1 = "<egui:intnl text='admin.settings.Automatic login feature is enabled'/>";
		var autoLoginAlertMsg2 = "<egui:intnl text='admin.settings.Do you wish to disable this feature to turn on 2-Step Verification'/>";
		var autoLoginAlertMsg3 = "<egui:intnl text='admin.settings.To enable automatic login, you need to turn off the SSO and 2-Step Verification feature'/>";
		var autoLoginAlertMsg4 = "<egui:intnl text='admin.settings.Would you like to continue'/>";
		var autoLoginAlertMsg5 = "<egui:intnl text='admin.settings.Do you wish to disable this feature to turn on Single Sign-On'/>";
		var urlAlertMsg = "<egui:intnl text='admin.settings.Please enter a valid URL, it should start with http:// or https://' />";

		var pageIntnl87 = '<egui:intnl text="admin.service.View excluded elements"/>';
		var pageIntnl84 = '<egui:intnl text="admin.service.Assign and Add More"/>';
		//var pageIntnl82 = '<egui:intnl text="admin.service.Update"/>';
		var pageIntnl82 = '<egui:intnl text="admin.managersettings.TT Manager Settings"/>';
		var pageIntnl90 = '<egui:intnl text="admin.user.Please choose filter by"/>';
		var pageIntnl99 = '<egui:intnl text="admin.user.Trouble ticket filter have been configured successfully"/>';
		var reqFrom = 'navlink';
		var mailFilterOption = '';
		var selectedUserID = 'admin';//default for manager level setting(TT filter)
		var filterMessage = '<egui:intnl text="admin.filter.EXCLUDED ELEMENTS"/>';
		var filterMessage2 = '<egui:intnl text="admin.filter.INCLUDED ELEMENTS"/>';
		
		// for eG manager model
		var mgrModelTitle = '<egui:intnl text="admin.settings.Manager Model" />';
		var mgrModelLabel = '<egui:intnl text="admin.settings.This eG Manager is used for monitoring"/>';
		var issueuuidLabel = '<egui:intnl text="admin.settings.Issue UUID"/>';
		var mgrUpdateSuccessMsg = "<egui:intnl text='admin.settings.Manager model settings updated successfully'/>";
		var mgrUpdateSuccessRestartMsg = "<egui:intnl text='admin.settings.You must restart the eG manager for these changes to be effective'/>";
		var mgrUpdateErrorMsg = "<egui:intnl text='admin.settings.Error in updating the manager model settings'/>";
		var enterpriseLabel = '<egui:intnl text="admin.settings.Our organization (Enterprise)" />';
		var mspLabel = '<egui:intnl text="admin.settings.Our organization and our customers (SaaS)" />';
		var selfRegLabel = '<egui:intnl text="admin.settings.Allow users to self-register"/>';
		var selfRegMailIDsLabel = '<egui:intnl text="admin.settings.Send user registration details to these mail IDs"/>';

		var disablewebservTooltipMsg = "<egui:intnl text='admin.tt.Disable Web Service'/>";
		var enablewebservTooltipMsg = "<egui:intnl text='admin.tt.Enable Web Service'/>";
		var yesMsg = "<egui:intnl text='admin.common.Yes'/>";
		var noMsg = "<egui:intnl text='admin.common.No'/>";
		var viewbyMsg = "<egui:intnl text='admin.tt.View By'/>";
		var serviceMsg = "<egui:intnl text='admin.tt.Service'/>";
		var componentTypeMsg = "<egui:intnl text='admin.common.Component type'/>";
		var testMsg = "<egui:intnl text='admin.common.Test'/>";
		var componentMsg = "<egui:intnl text='admin.tt.Component'/>";
		var searchMsg = "<egui:intnl text='admin.header.Search'/>";
		var disassociateMsg = "<egui:intnl text='admin.common.Disassociate'/>";
		var associateMsg = "<egui:intnl text='admin.common.Associate'/>";
		var excludedAlertsMsg = "<egui:intnl text='admin.tt.Excluded from alerts'/>";
		var includedAlertsMsg = "<egui:intnl text='admin.tt.Included for alerts'/>";
		var notApplicableMsg = "<egui:intnl text='admin.common.Not Applicable'/>";
		var enableMailAlertsMsg = "<egui:intnl text='admin.tt.Enable mail alerts'/>";
		var addNassignMsg = "<egui:intnl text='admin.tt.Changes have been updated successfully'/>.";
		var filterMsg = "<egui:intnl text='admin.filter.Filter by'/>";

		var deleteUseresSetTitle = '<egui:intnl text="admin.settings.Delete User Accounts" />';
		var auto_delete_users_label = '<egui:intnl text="admin.settings.Delete expired users"/>';
		var auto_delete_days_label = '<egui:intnl text="admin.settings.Delete user accounts after"/>';
		var exp_user_auto_delete_days_label = '<egui:intnl text="admin.settings.Auto delete expired user components if not reporting for N days"/>';
		var delete_elements_label = '<egui:intnl text="admin.settings.Delete components, groups, segments, services, service groups and zones"/>';
		var not_reporting_for_label = '<egui:intnl text="admin.settings.Components not reporting for last"/>';
		var result_message = '<egui:intnl text="admin.settings.Settings have been updated successfully"/>';
		var cannotbe = '<egui:intnl text="admin.settings.field cannot be blank"/>';
		var delete_user_comp_label = '<egui:intnl text="admin.settings.Components to be deleted"/>';
		var set_for_auto_del_label_fs = '<egui:intnl text="admin.settings.Auto Delete Expired User Accounts"/>';
		var set_for_auto_del_label = '<egui:intnl text="admin.settings.Do you want to auto delete expired user accounts"/>?';
		var all_label = '<egui:intnl text="admin.settings.All"/>';
		var not_reporting_label = '<egui:intnl text="admin.settings.Not reporting"/>';
		var auto_delete_heading_label = '<egui:intnl text="admin.settings.Activities To Be Performed When Deleting User Accounts"/>';
		var measurement_cleanup_label = '<egui:intnl text="admin.settings.This value should not exceed measurement cleanup period"/>';
		var measurement_cleanup_period = parseInt('<%=measurementCleanPeriod%>');
		var auto_delete_user_after_days_alert = '<egui:intnl text="admin.settings.The field delete user accounts after should contain a value greater than zero"/>';
		var comp_not_reporting_days_alert = '<egui:intnl text="admin.settings.The field components not reporting for last should contain a value between 1 and "/> ' + measurement_cleanup_period;
		var delete_infra_elements = '<egui:intnl text="admin.settings.Choose the infrastructure elements for deletion"/>';
		var delete_confirm_label = '<egui:intnl text="admin.settings.Do you want to delete the infrastructure elements associated with organization/organizational unit"/>?';
		var delete_org_comp_label = '<egui:intnl text="admin.settings.Delete the infrastructure elements associated with"/>';
		var delete_subou_comp_label = '<egui:intnl text="admin.settings.Do you want to delete the infrastructure elements associated with organizational unit"/>?';
		var organizations_label = '<egui:intnl text="admin.settings.Organization"/>';
		var organizational_units_label = '<egui:intnl text="admin.settings.Organizational unit"/>';
		var noneLabel = "<egui:intnl text='admin.common.None'/>";
		var elementSelectionAlert = '<egui:intnl text="admin.settings.Please choose infrastructure elements for deletion"/>';
		var acklockValueFiledAlert1 = '<egui:intnl text="admin.common.Value should be less than"/>'+'&nbsp;';
		var acklockValueFiledAlert2 = '<egui:intnl text="admin.common.Value should be  greater than zero"/>'+'&nbsp;';

		var supermanagerSetTitle = '<egui:intnl text="admin.settings.Supermanager Settings" />';
		var autoRegisterSm_label = '<egui:intnl text="admin.settings.Allow auto registration from eG SuperManager"/>';
		var updatedMsg = '<egui:intnl text="admin.settings.Supermanager settings have been updated sucessfully"/>';
		var smtitle = '<egui:intnl text="admin.settings.SuperManager"/>';

	</script>

	<!-- Application folder -->
	<script type="text/javascript" src="ManagerSettings/app/app.js"></script>
	<script language="JavaScript" src="eg_scripts/validate.js"></script>

	<script language="javascript">
		Ext.onReady(function(){
			Ext.Ajax.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
			Ext.data.Connection.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
			Ext.data.ScriptTagProxy.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};

			Ext.Ajax.on('requestexception', function (conn, response, options) {
				var errorStr = response.responseText;
				if (errorStr != undefined && errorStr != 'undefined' && errorStr.indexOf("customerror") != -1)
				{
					if (errorStr.indexOf("user-session-invalid") != -1)
					{
						callWindow(1);
					}
					else if (errorStr.indexOf("user-deleted") != -1)
					{
						callWindow(2);
					}
					else if (errorStr.indexOf("user-timedout") != -1)
					{
						callWindow(3);
					}
				}
				else
				{
					if (response.status == 302 || (response.timedout != undefined && response.timedout == true))
					{
						Ext.Msg.show({
							title : errorTitle,
							msg : requestTimeOut,
							buttons : Ext.Msg.OK,
							icon : 'iconError'
						});
					}
					else
					{
						console.log(response.responseText);
						Ext.Msg.show({
							title : errorTitle,
							msg : probsErrorMessage,
							buttons : Ext.Msg.OK,
							icon : 'iconError'
						});
					}
				}
			});
		});
	</script>
</head>
<body>
	<div id="loadmask" class="x-mask-msg x-layer x-mask-msg-default" style="z-index: 19001;left:45%;top:35%;"><div class="x-mask-loading" style="position:relative">Loading...</div></div>
</body>
</html>

<%
	if(request.getQueryString()!=null)
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgManagerSettingsTree.jsp?"+request.getQueryString());
	}
	else
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgManagerSettingsTree.jsp");
	}
%>

