<!DOCTYPE html>

<%@ include file = "EgTrackerA.jsp"%>
<%@ page import = "com.egurkha.*"%>
<%@ page import = "com.egurkha.ini.*"%>
<%@ page import = "com.egurkha.util.*"%>
<%@ page import = "com.egurkha.monitor.alarms.*"%>
<%@ page import = "com.egurkha.EgConstants" %>
<%@ page import = "egurkha.ConfigSiteBean"%>
<%@ page import = "egurkha.EgDbAdapterUI"%>
<%@ page import = "com.eg.EgDbAdapterTypeUI"%>
<%@ page import = "com.eg.EgMemInfo"%>
<%@ page import = "com.eg.EgCrypt"%>
<%@ page import = "com.eg.EgInstallInfo" %>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "com.eg.EgURLEncoder"%>
<%@ page import = "com.eg.EgCrypt"%>
<%@ page import = "com.eg.EgDateInfo"%>
<%@ page import = "com.eg.EgServicesInfo"%>
<%@ page import = "com.eg.EgDbInfo"%>
<%@ page import ="com.egurkha.util.EgSorter"%>
<%@ page import = "com.eg.EgMemCheck"%>
<%@ page import = "java.sql.*"%>
<%@ page import = "java.util.*"%>
<%@ page import = "java.text.*"%>
<%@ page import = "com.egurkha.User"%>
<%@ page import = "com.egurkha.UserRegistry"%>
<%@ page import = "com.egurkha.EgUserRole"%>
<%@ 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"%>

<%
	response.setHeader("Cache-Control", "no-store");
	response.setHeader("Pragma", "no-cache");
	response.setDateHeader("Expires", -1);

	boolean isDouble=EgDbInfo.doubleByteEnabled;
	ResultSet rs = null;
	ResultSet rs_uname = null;
	boolean b_state = false;
	Vector users = new Vector();
	Vector usersexist = new Vector();
	Vector all_Users = new Vector();
	IniUI iniUI = IniUI.getInstance();
	ArrayList dateFormats;
	String format="";
	User user = registry.getUser(session.getId());

	EgUserRole userRole = _user.getUserRole();
	boolean hasAllComponentAccess = userRole.hasAllComponentAccess();

	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir() + "/manager/config/";
	IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = egUI.getValue("CURRENT_DATE_FORMAT", "selectedDateFormat");
	String currentDateFormat_script = currentDateFormat; // MMM dd, yyyy
	String currentDateFormat_script_later = null;
	String actDomain=request.getParameter("domain");
	String prevDomain="";
	String strSelect2="";
	IniFile userMappinginiFile = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_ui.ini");

	// For find Service Health enabled or disabled
	// By Saravanan.A on 28-2-2012
	String enableServiceHealth = egUI.getValue("SERVICE_HEALTH","enable_services_health");
	enableServiceHealth=(enableServiceHealth==null || enableServiceHealth.trim().length()==0)?"false":enableServiceHealth.toLowerCase();

	boolean isEnableServiceHealth=false;
	if(enableServiceHealth!=null && (enableServiceHealth.equalsIgnoreCase("yes") || enableServiceHealth.equalsIgnoreCase("true")))
		isEnableServiceHealth=true;
	//---end---

	String servicesDir = EgInstallInfo.getInstallDir()+"/manager/config/";
	IniFile ServicesIni = new IniFile(servicesDir+"eg_services.ini");
	String noOfShifts = ServicesIni.getValue("MISC_ARGS","NoOfShiftPeriods");
	Integer intObj = null;
	if (!com.egurkha.util.StringUtils.isNull(noOfShifts) && noOfShifts.length()>0)
	{
		intObj = new Integer(noOfShifts);
	}
	else 
	{
		intObj = new Integer("1");
	}
	int noOfShiftPeriods = intObj.intValue();
	if (noOfShiftPeriods > 10)
	{
		noOfShiftPeriods = 10;
	}
	else if (noOfShiftPeriods < 1)
	{
		noOfShiftPeriods = 1;
	}

	String enableCommand = ServicesIni.getValue("EXEC_MAILMANAGER","EnableCommandExec");
	if (com.egurkha.util.StringUtils.isNull(enableCommand))
	{
		enableCommand = "";
	}

	/*if(currentDateFormat.indexOf("MMM") >= 0)
	{
		for(int i=0; i < currentDateFormat.length();i++)
		{
			if(String.valueOf(currentDateFormat.charAt(i)).equals("M"))
			{
				currentDateFormat_script = currentDateFormat.replace('M','N');
			}
		}
	}*/

	String urname =  request.getParameter("qctr");
	String reqFrom = request.getParameter("reqfrom");
	String selectedTab = request.getParameter("selectedTab");
	String userName = request.getParameter("username");
	userName = com.egurkha.util.StringUtils.decodeSecurityChar(userName);
	String needLanguageEntires = request.getParameter("needLanguageEntires");
	String showAlert = request.getParameter("showAlert");
	if (urname == null)
	{
		urname = "0";
	}
	reqFrom = (reqFrom !=null && reqFrom.length()>0)?reqFrom:"navlink";
	selectedTab = (selectedTab !=null && selectedTab.length()>0)?selectedTab:"1";
	if (userName == null || userName.length() == 0)
	{
		userName = "-1";
		urname = "0";
	}
	else
	{
		urname = "1";
	}
	String urlStr = "EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?needLanguageEntires=yes&qctr="+urname+"&reqfrom="+reqFrom;
	if (!userName.equals("-1"))
	{
		String temp_userName = com.egurkha.util.StringUtils.encodeSecurityChar(userName);
		String userStatus = "active";
		EgUuidInfo egUuidInfo = new EgUuidInfo();
		String uvalidtill = egUuidInfo.getExpiryDateOfUser(com.egurkha.util.StringUtils.decodeSecurityChar(userName));

		if (uvalidtill != null)
		{
			if (uvalidtill.indexOf("9999-12-12 23:59:59") == -1)
			{
				uvalidtill = uvalidtill.substring(0,10);
				uvalidtill = com.egurkha.util.DateUtil.changeDateFormat(uvalidtill,"yyyy-MM-dd","MM/dd/yyyy");
			}
			else
			{
				uvalidtill = "12/12/9999";
			}

			java.util.Date today = new java.util.Date();
			SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
			java.util.Date uvalidtilldate = new java.util.Date();
			
			try
			{
				uvalidtilldate = formatter.parse(uvalidtill+" 23:59:59");
			}
			catch(Exception e){}

			if (!uvalidtill.equalsIgnoreCase("12/12/9999") && uvalidtilldate.compareTo(today) < 0)
			{
				userStatus = "expired";
			}
		}
		urlStr = urlStr + "&username="+EgURLEncoder.encode(temp_userName,"UTF-8")+"&userStatus="+userStatus;
	}
	EgServicesInfo servicesInfo = new EgServicesInfo("manager");
	boolean isFilterMailAlertsEnabled = servicesInfo.isFilterMailAlertsEnabled();
	servicesInfo = null;
	String usrCache = userName;
	if (usrCache.indexOf("\\") != -1)
	{
		usrCache = StringUtils.replace(usrCache,"\\","\\\\");
	}

	boolean isEnterpriseModel = true;
	String eGMgrModel = ServicesIni.getValue("MISC_ARGS","eGMgrModel");
	if (eGMgrModel != null && eGMgrModel.equalsIgnoreCase("msp"))
	{
		isEnterpriseModel = false;
	}

	String fromWizard = request.getParameter("fromWizard");
	if(com.egurkha.util.StringUtils.isNull(fromWizard))
	{
		fromWizard = "";
	}
%>

<html>
<head>
<title>Change user profile</title>
<meta charset="utf-8">

<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"/>

<script language="JavaScript1.2" src="/final/scripts/eg_DateUtil.js"></script>
<script language="javascript1.2" src="eg_scripts/ajaxutils.js"></script>
<script language="Javascript1.2" src="eg_scripts/date.js"></script>
<script language="javascript1.2" src="eg_scripts/validate.js"></script>
<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>

<style>
	.disabledNode {
		opacity: .5;
		cursor: default !important;
	}
	.disabledNode div.x-grid-cell-inner 
	{
		cursor: default !important;
	}
</style>

<script language="javascript">
	var csrfToken = '<%=strCsrfToken%>';
	var hasAllComponentAccessUser = <%=hasAllComponentAccess%>;
	var isEnterpriseModel = <%=isEnterpriseModel%>;
	var inputs = 0;
	var isFromMainPage = false;
	var mailShiftPeriodsCount = 0;
	var smsShiftPeriodsCount = 0;
	var escShiftPeriodsCount = 0;
	var ExecShiftPeriodsCount=0;
	var publicJSON = '';
	var userCompJSON = '';
	var userElementJSON = '';
	var userMailJSON = '';
	var domainDetailsArray = '';
	var appCnt = '';
	var fileUploadURI = '';
	var filePath = '';
	var mailFilterOption = '';
	var compNameArrTemp = '';
	var currentDFormat = '<%=currentDateFormat%>';
	var mgrDateFormat = getExtjsDateFormat('<%=currentDateFormat%>');
	var noOfShiftPeriods = parseInt('<%=noOfShiftPeriods%>');
	var enableCommand = '<%=enableCommand%>';
	var tmpShiftPeriodsCount = 0;
	var userRoleValidationMsg = '<egui:intnl text="admin.user.Please choose a user role"/>';
	var userDomainValidationMsg = '<egui:intnl text="admin.user.Please choose a domain"/>';
	var userIDValidationMsg = '<egui:intnl text="admin.user.User id already exists"/>';
	var userIDValidationMsg2 = '<egui:intnl text="admin.user.Please choose a user id"/>';
	var userIDValidationMsg3 = '<egui:intnl text="admin.user.Cannot add a user by name"/>';
	var userIDValidationMsg4 = '<egui:intnl text="admin.user.User name should not start with space,dot,hyphen,underscore"/>';
	var userIDValidationMsg5 = '<egui:intnl text="admin.user.User name should not end with space"/>';
	var userIDValidationMsg6 = '<egui:intnl text="admin.user.User ID is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
	var userIDValidationMsg7 = '<egui:intnl text="admin.user.Please enter the password"/>';
	var userIDValidationMsg8 = '<egui:intnl text="admin.user.Password length should be greater than one"/>';
	var userIDValidationMsg9 = '<egui:intnl text="admin.user.Password is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
	var userIDValidationMsg10 = '<egui:intnl text="admin.user.Please retype password"/>';
	var userIDValidationMsg11 = '<egui:intnl text="admin.user.Passwords do not match"/>';
	var userIDValidationMsg12 = '<egui:intnl text="admin.user.Please choose a group name"/>';
	var userIDValidationMsg13 = '<egui:intnl text="admin.user.Please enter a validity date for the User"/>!!';
	var userIDValidationMsg14 = '<egui:intnl text="admin.user.Validity date should be greater than current date"/>';
	var userIDValidationMsg15 = '<egui:intnl text="admin.user.Please enter valid To mail ID and/or mobile number"/>';
	var userIDValidationMsg16 = '<egui:intnl text="admin.user.To mail id is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var userIDValidationMsg17 = '<egui:intnl text="admin.user.Please enter valid Cc mail id and/or mobile number"/>';
	var userIDValidationMsg18 = '<egui:intnl text="admin.user.Cc mail id is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var userIDValidationMsg19 = '<egui:intnl text="admin.user.Please enter valid Bcc mail id and/or mobile number"/>';
	var userIDValidationMsg20 = '<egui:intnl text="admin.user.Bcc mail id is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var userIDValidationMsg21 = '<egui:intnl text="admin.user.Escalation mail id is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var userIDValidationMsg22 = '<egui:intnl text="admin.user.Please enter valid Escalation mail id and/or mobile number"/>';
	var userIDValidationMsg23 = '<egui:intnl text="admin.user.Please enter valid mail id"/>';
	var userIDValidationMsg24 = '<egui:intnl text="admin.user.disable the option"/> ';
	var userIDValidationMsg25 = '<egui:intnl text="admin.user.Email alerts only during shift periods"/>';
	var userIDValidationMsg26 = '<egui:intnl text="admin.user.Please enter valid mobile number"/>';
	var userIDValidationMsg27 = '<egui:intnl text="admin.user.SMS alerts only during shift periods"/>';
	var userIDValidationMsg28 = '<egui:intnl text="admin.user.Please enter Escalation Level 1 mail id and/or mobile number"/>';
	var userIDValidationMsg29 = '<egui:intnl text="admin.user.Escalation Level 1 mail id is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var userIDValidationMsg30 = '<egui:intnl text="admin.user.Please enter Escalation Level"/> ';
	var userIDValidationMsg31 = ' <egui:intnl text="admin.user.mail id and/or mobile number"/>';
	var userIDValidationMsg32 = '  <egui:intnl text="admin.user.mail id is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var userIDValidationMsg33 = '<egui:intnl text="admin.user.Please choose the type of notification"/>';
	var userIDValidationMsg34 = '<egui:intnl text="admin.user.Please choose the message mode"/>';
	var userIDValidationMsg35 = '<egui:intnl text="admin.user.Please choose an alarm display"/>';
	var userIDValidationMsg36 = '<egui:intnl text="admin.user.Mail days and shifts should not be blank"/>';
	var userIDValidationMsg37 = '<egui:intnl text="admin.user.SMS days and shifts should not be blank"/>';
	var userIDValidationMsg38 = '<egui:intnl text="admin.user.Escalation alerts only during shift periods"/>';
	var userIDValidationMsg39 = '<egui:intnl text="admin.user.Escalation days and shifts should not be blank"/>';
	var userIDValidationMsg40 = '<egui:intnl text="admin.user.Please enter valid command"/>';
	var userIDValidationMsg41 = '<egui:intnl text="admin.user.Execute alerts only during shift periods"/>';
	var userIDValidationMsg42 = '<egui:intnl text="admin.user.Command execution days and shifts should not be blank"/>';
	var userIDValidationMsg43 = '<egui:intnl text="admin.user.Please enter either"/> ';
	var userIDValidationMsg44 = '<egui:intnl text="admin.user.To Mail ID/Mobile No"/>';
	var userIDValidationMsg45 = '<egui:intnl text="admin.user.Command"/>';
	var userIDValidationMsg46 = '<egui:intnl text="admin.user.limited level, upto level 5"/>';
	var userIDValidationMsg47 = '<egui:intnl text="admin.user.You are exceeding the configured shift limit"/>';
	var userIDValidationMsg48 = '<egui:intnl text="admin.user.You cannot configure more than 5 time periods"/>';
	var userIDValidationMsg49 = "<egui:intnl text='admin.user.\'To\' time must be greater than \'From\' time'/>";
	var userIDValidationMsg50 = '<egui:intnl text = "admin.user.Level"/>';
	var userIDValidationMsg51 = '<egui:intnl text="admin.user.How would you like to add a user" />';
	var userIDValidationMsg52 = '<egui:intnl text="admin.user.Days" />';
	var userIDValidationMsg53 = '<egui:intnl text="admin.user.Shifts" />';
	var userIDValidationMsg54 = '<egui:intnl text="admin.service.Disassociate"/>';
	var userIDValidationMsg55 = '<egui:intnl text="admin.service.Associate"/>';
	var userIDValidationMsg56 = '<egui:intnl text="admin.user.Auto-associate segments/services/service groups/zones/components to other users"/>';
	var userIDValidationMsg57 = '<egui:intnl text="admin.user.Apply the chosen logo for other modules"/>';
	var userIDValidationMsg58 = '<egui:intnl text="admin.title.MAIL ALERTS FILTERING"/>';
	var userIDValidationMsg59 = '<egui:intnl text="admin.user.ID"/>';
	var userIDValidationMsg60 = '<egui:intnl text="admin.user.Choose a user"/>';
	var userIDValidationMsg61 = '<egui:intnl text="admin.user.Please Choose a day"/>';
	var userIDValidationMsg62 = '<egui:intnl text="admin.logo.File name is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>';
	var userIDValidationMsg63 = '<egui:intnl text="admin.logo.Field is empty or the selected File does not have the extension"/>';
	var userIDValidationMsg64 = '<egui:intnl text="admin.user.Please enter valid Mail ID/Mobile number"/>';
	var userIDValidationMsg65 = '<egui:intnl text="admin.user.2-Step verification feature has been enabled"/>';
	var userIDValidationMsg66 = '<egui:intnl text="admin.user.Please provide a vaild To Mail ID for this user or group"/>';
	
	var userIDValidationMsg69 = '<egui:intnl text="admin.user.a lowercase alphabet"/>';
	var userIDValidationMsg70 = '<egui:intnl text="admin.user.an uppercase alphabet"/>';
	var userIDValidationMsg71 = '<egui:intnl text="admin.user.a number"/>';
	var userIDValidationMsg72 = '<egui:intnl text="admin.user.a special character other than double quotes"/>';
	var userIDValidationMsg73 = '<egui:intnl text="admin.user.Password policy requirements are not satisfied"/>';

	var userIDValidationMsg74 = '<egui:intnl text="admin.user.Please choose an organization"/>';
	var orgTypeLabel = '<egui:intnl text="admin.user.Organization"/>';

	var radioOptionYes = '<egui:intnl text="admin.common.Yes"/>';
	var radioOptionNo = '<egui:intnl text="admin.common.No"/>';
	var NextBtn = '<egui:intnl text="admin.user.Next"/>';
	var submitBtn = '<egui:intnl text="admin.user.Submit"/>';
	var validateBtn = '<egui:intnl text="admin.user.Validate"/>';
	var label_1 = '<egui:intnl text="admin.service.Associated elements"/>';
	var isDoubleByteEnabled = '<%=isDouble%>'

	var passLabel1 = '<egui:intnl text="admin.user.Password should contain atleast"/>';
	var passLabel2 = '<egui:intnl text="admin.user.characters"/>';
	var passStr = '<egui:intnl text="admin.user.Password strength"/>';
	var Good = '<egui:intnl text="admin.user.Good"/>';
	var Strong = '<egui:intnl text="admin.user.Strong"/>';
	var Weak = '<egui:intnl text="admin.user.Weak"/>';
	var Fair = '<egui:intnl text="admin.user.Fair"/>';

	var radioOptionYes = '<egui:intnl text="admin.common.Yes"/>';
	var radioOptionNo = '<egui:intnl text="admin.common.No"/>';
	var radioOptionEnable = '<egui:intnl text="admin.user.Enable"/>';
	var radioOptionDisable = '<egui:intnl text="admin.user.Disable"/>';
	var radioOptionCritical = '<egui:intnl text="admin.user.Critical"/>';
	var radioOptionMajor = '<egui:intnl text="admin.user.Major"/>';
	var radioOptionMinor = '<egui:intnl text="admin.user.Minor"/>';
	var radioOptionHtml = '<egui:intnl text="admin.user.Html"/>';
	var radioOptionText = '<egui:intnl text="admin.user.Text"/>';
	var NextBtn = '<egui:intnl text="admin.user.Next"/>';
	var filterMessage = '<egui:intnl text="admin.filter.EXCLUDED ELEMENTS FOR"/>';
	var filterMessage2 = '<egui:intnl text="admin.filter.INCLUDED ELEMENTS FOR"/>';
	var New = '<egui:intnl text="admin.user.New"/>';
	var alarmNotifyComplete = '<egui:intnl text="admin.user.Complete List"/>';

	var assoLabel = '<egui:intnl text="admin.user.Auto associate component types"/>';
	var autoAssoLabel = '<egui:intnl text="admin.user.Auto-associate to other users"/>';
	var intnlLabel7 = '<egui:intnl text="admin.user.No servers found"/>';
	var homePageLabel = '<egui:intnl text="admin.user.Monitor home page"/>';
	var homePageOpt1 = '<egui:intnl text="admin.user.Default"/>';
	var homePageOpt2 = '<egui:intnl text="admin.user.Domain Dashboard"/>';
	var avlLbl = '<egui:intnl text="admin.user.Available user(s)"/>';
	
	var associatedUserIDs = '';
	var appURL = '<%=urlStr%>';
	var selectedUserID = '<%=usrCache%>';
	var selectedTab = '<%=selectedTab%>';
	var reqFrom = '<%=reqFrom%>';
	var isFilterMailAlertsEnabled;
	if ('<%=isFilterMailAlertsEnabled%>' == 'true' || '<%=isFilterMailAlertsEnabled%>' == true)
	{
		isFilterMailAlertsEnabled = true;
	}
	else
	{
		isFilterMailAlertsEnabled = false;
	}
	var isAlarmEnabled = false;

	var pageDiscription = '';
	if (reqFrom == "adduser")
	{
		pageDiscription = '<egui:intnl description="EgAddUser.jsp"/>.';
	}
	else
	{
		pageDiscription = '<egui:intnl description="EgChangeUserProfile.jsp"/>.';
	}
	var pageTitle = '';
	var pageTitle2 = '<egui:intnl text="admin.title.Modify User"/>';
	var pageTitle3 = '<egui:intnl text="admin.title.Element Association For"/>';
	var pageTitle4 = '<egui:intnl text="admin.title.Mail/Sms Alerts Filtering For"/>';
	var pageTitle5 = '<egui:intnl text="admin.title.Modify User"/>';
	if (reqFrom == "adduser")
	{
		if (selectedTab == "3")
		{
			pageTitle = '<egui:intnl text="admin.title.Element Association For "/> \''+selectedUserID+"'";
		}
		else
		{
			pageTitle = '<egui:intnl text="admin.title.Mail/Sms Alerts Filtering For "/> \''+selectedUserID+"'";
		}
	}
	else
	{
		pageTitle = '<egui:intnl text="admin.title.Modify User"/>';
	}
	var pageTitle6 = '<egui:intnl text="admin.user.User Preferences For"/>';

	var intnlLabel1 = '<egui:intnl text="admin.user.No users have been configured"/>';
	var expiredAccMsg = '<egui:intnl text="admin.user.No expired users accounts found"/>.';
	var activeAccMsg = '<egui:intnl text="admin.user.No active users accounts found"/>.';
	var intnlLabel2 = '<egui:intnl text="admin.common.Domain"/>';
	var intnlLabel3 = '<egui:intnl text="admin.common.Local"/>';
	var intnlLabel4 = '<egui:intnl text="admin.user.Domain" />';
	var intnlLabel5 = '<egui:intnl text="No components have been associated with this user" />';
	var intnlLabel6 = '<egui:intnl text="admin.service.Associated elements"/>';
	var backHref = '<%=backHref%>';
	var reqfrom = '<%=reqFrom%>';
	var backText = '<egui:intnl text="admin.header.Back"/>';
	var updateBtn = '<egui:intnl text="admin.user.Update"/>';
	var pageIntnl80 = '<egui:intnl text="admin.user.User Preferences"/>';
	var pageIntnl81 = '<egui:intnl text="admin.user.Elements Association"/>';
	var pageIntnl82 = '<egui:intnl text="admin.user.Mail/Sms Alerts Filtering"/>';
	var pageIntnl83 = '<egui:intnl text="admin.user.Basic Information"/>';
	var pageIntnl84 = '<egui:intnl text="admin.service.Assign and Add More"/>';
	var pageIntnl85 = '<egui:intnl text="admin.service.Finish"/>';
	var pageIntnl86 = '<egui:intnl text="admin.service.View associated elements"/>';
	var pageIntnl87 = '<egui:intnl text="admin.service.View excluded elements"/>';
	var pageIntnl88 = '<egui:intnl text="admin.user.Next"/>';
	var pageIntnl89 = '<egui:intnl text="admin.user.Please choose an associate type"/>';
	var pageIntnl90 = '<egui:intnl text="admin.user.Please choose filter by"/>';
	var pageIntnl91 = '<egui:intnl text="admin.user.Previous"/>';
	var pageIntnl92 = '<egui:intnl text="admin.user.New user has been created"/>';
	var pageIntnl93 = '<egui:intnl text="admin.common.All elements"/>';
	var pageIntnl94 = '<egui:intnl text="admin.common.Descriptors only"/>';
	var pageIntnl95 = '<egui:intnl text="admin.common.DESCRIPTORS INCLUDED FOR ALERTS"/>';
	var pageIntnl96 = '<egui:intnl text="admin.common.DESCRIPTORS EXCLUDED FROM ALERTS"/>';
	var showAlert = "<%=showAlert%>";
	var pageIntnl97 = '<egui:intnl text="admin.service.View included elements"/>';
	var pageIntnl98 = '<egui:intnl text="admin.user.The elements have been associated/disassociated successfully"/>';
	var pageIntnl99 = '<egui:intnl text="admin.user.Mail/SMS alert filters have been configured successfully"/>';
	var pageIntn200 = '<egui:intnl text="admin.user.Do you want to update the changes"/>?';
	var pageIntn201 = '<egui:intnl text="admin.user.Please associate/dissociate the elements"/>';
	var pageIntnl100 = '<egui:intnl text="admin.user.Request has been processed successfully"/>';

	var isLoginImgUpdated = false;
	var isAdminMonImgUpdated = false;
	var isRepImgUpdated = false;
	var isConfigImgUpdated = false;
	var isConfigEnabled = '<%=EgInstallInfo.isConfigSupported%>';
	var uploadImgMsg = '<egui:intnl text="admin.user.Please upload a custom logo for"/>';
	var uploadImgMsg1 = '<egui:intnl text="admin.user.module"/>.';
	var uploadImgMsg4 = '<egui:intnl text="admin.user.Login page"/>';
	var uploadImgMsg5 = '<egui:intnl text="admin.user.Admin/Monitor"/>';
	var uploadImgMsg6 = '<egui:intnl text="admin.user.Reporter"/>';
	var uploadImgMsg7 = '<egui:intnl text="admin.user.Configuration"/>';

	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 intnlLabel42 = '<egui:intnl text="admin.common.Selected component types"/>';
	var intnlLabel43 = '<egui:intnl text="admin.common.Available component types"/>';
	var intnlLabel45 = '<egui:intnl text="admin.common.Select / Deselect Component Types"/>';
	var intnlLabel44 = '<egui:intnl text="admin.common.Category"/>';
	var intnlLabel46 = '<egui:intnl text="admin.common.Add to available component types"/>';
	var intnlLabel47 = '<egui:intnl text="admin.common.Remove from available component types"/>';
	var label14 = '<egui:intnl text="admin.common.Apply"/>';
	var intnlLabel13 = '<egui:intnl text="admin.common.Please select a component type"/>';
	var usrModWarn1 = '<egui:intnl text="admin.user.The"/>';
	var usrModWarn2 = '<egui:intnl text="admin.user.user is not allowed to be modified"/>';
	var orgChangePrompt = '<egui:intnl text="admin.user.Organization modify prompt"/>';
	
	// wizard design starts...
	var fromWizard = '<%=fromWizard%>';
	var homeTitle = '<div>'+pageTitle+' <img src="/final/images/spacer.gif" id="homeTitle" class="iconInfoCircle" style="vertical-align:text-top;position:relative;top:2px"/></div>';
	// wizard design ends..
	var changePwdLabel = '<egui:intnl text="admin.user.Allow user to modify password"/>';
	var userpassMsg = '<egui:intnl text="admin.user.Password cannot be same as user name"/>.';

	var noUserSearchAlert = '<egui:intnl text="admin.user.No user found for your current search"/>';
	var LoadSearchAlert = '<table border="0" width="100%" height="100px"><tr><td align="center" valign="middle"><div class="iconInformation"></div><div class="commonErrorMsgText" id="noCompAlrtDiv">'+noUserSearchAlert+'</div></td></tr></table>';
	
	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>
<egui:skin ui="admin"/>
<script src="../admin/EgChangeUserProfile/app/app.js"></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/EgChangeUserProfile.jsp?"+request.getQueryString());
	//	session.setAttribute("adminLastAccessedURL","/final/admin/EgChangeUserProfile.jsp?qctr=0&reqfrom=navlink");
	//}
	//else
	//{
	if(com.egurkha.util.StringUtils.isNull(fromWizard))
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgChangeUserProfile.jsp?qctr=0&reqfrom=navlink");
	}
	//}
%>



