Ext.Msg.bodyPadding="10 0";Ext.Msg.cls="adminAlert";var isEmailId=false;Ext.define("EgAddUser.controller.Main",{extend:"Ext.app.Controller",requires:["EgAddUser.view.FileUpload","EgAddUser.view.UserFormContainer","EgAddUser.view.ShiftsPicker","EgAddUser.view.ElementAssociationForm","EgAddUser.view.EgMailAlertSuppress","EgAddUser.view.UserGridPanel","Ext.ux.form.MultiSelectSI","Ext.ux.form.ItemSelectorSI","utilities.ScrollCombo",],views:["Main","EmptyPanel","ComponentGroupedSummaryGrid","EgDomainGroupTree","ConfigureComponentTypes"],refs:[{selector:"main",ref:"main"},{selector:"fileupload",ref:"fileupload"},{selector:"userformcontainer",ref:"userformcontainer"},{selector:"userformcontainer #domainName",ref:"domainName"},{selector:"userformcontainer #uname",ref:"uname"},{selector:"userformcontainer #eGShiftPeriods",ref:"shifPeroidsCt"},{selector:"userformcontainer #validate",ref:"btnValidate"},{selector:"elementassociationform",ref:"elementassociationform"},{selector:"egmailalertsuppress",ref:"egmailalertsuppress"},{selector:"shiftspicker",ref:"shiftspicker"},{selector:"configurecomponenttypes",ref:"configurecomponenttypes"}],init:function(){appCnt=this;
this.buildMainData();this.control({"main":{"boxready":this.afterMainRender},'main button[id="backButton"]':{"click":this.goBack},'main button[id="cloneUser"]':{"click":this.cloneExistingUser},'userformcontainer combo[id="userModel"]':{"select":this.onUserModelChange},'userformcontainer combo[id="utype"]':{"select":this.onUserTypeChange},'userformcontainer radiogroup[id="userAuth"]':{"change":this.authenticationMode},'userformcontainer radiogroup[id="userAuthSAML"]':{"change":this.authenticationMode},'userformcontainer button[id="validate"]':{"click":this.validateDomainIdpDetails},'userformcontainer combo[id="rdoOperation"]':{"select":this.operationOnChange},'userformcontainer combo[id="domainName"]':{"select":this.domainSelect},'userformcontainer treepicker[id="org"]':{"select":this.onOrganizationChange},'userformcontainer button[id="commandButton"]':{"click":this.showCommandInWindow},'userformcontainer radiogroup[id="alarmMsgMode"]':{"change":this.setMeasureInMailMode},'main button[id="btnAddUser"]':{"click":this.submitUserDetails},'main button[id="btnNext"]':{"click":this.moveTab},'main button[id="btnPrev"]':{"click":this.movePreviousTab},'userformcontainer checkboxfield[id="chkuser"]':{"change":this.showAvailableUsers},'userformcontainer checkbox[id="Never"]':{"change":this.userValidityChange},'userformcontainer checkbox[id="logoCheck"]':{"change":this.logoConfiguration},'userformcontainer checkbox[id="high"]':{"change":this.showalarmRet},'userformcontainer checkbox[id="medium"]':{"change":this.showalarmRet},'userformcontainer checkbox[id="low"]':{"change":this.showalarmRet},'userformcontainer radiogroup[id="eGRemoteExec"]':{"change":this.eGRemoteExecution},'userformcontainer radiogroup[id="mailshift"]':{"change":this.loadMailShiftAlerts},'userformcontainer radiogroup[id="Execshift"]':{"change":this.loadCommandShiftAlerts},'userformcontainer radiogroup[id="smsshift"]':{"change":this.loadSMSShiftAlerts},'userformcontainer radiogroup[id="escshift"]':{"change":this.loadESCShiftAlerts},'userformcontainer combo[id="loginLogo1"]':{"select":this.loginLogoController},'userformcontainer combo[id="monitorLogo1"]':{"select":this.monitorLogoController},'userformcontainer combo[id="reporterLogo1"]':{"select":this.repLogoController},'userformcontainer combo[id="configLogo1"]':{"select":this.configLogoController},"fileupload #uploadUsrIcon":{"click":this.uploadUsrImage},"userformcontainer":{"tabchange":this.loadUserTab},"elementassociationform":{"afterrender":this.initUserElements},"egmailalertsuppress":{"afterrender":this.initUserMailConfigs},'elementassociationform combo[id="associate"]':{"select":this.associateOnChange},'elementassociationform checkbox[id="compAssociation"]':{"change":this.associateServerType},'elementassociationform combo[id="compType"]':{"select":this.getServerDetails},'elementassociationform button[id="apply"]':{"click":this.assignAndAddMore},'elementassociationform button[id="finish"]':{"click":this.submitUserElements},'elementassociationform button[id="btnViewElements"]':{"click":this.viewUserAssociatedElements},'egmailalertsuppress combo[id="filter"]':{"select":this.popFilterDetails},'egmailalertsuppress combo[id="CompTypes"]':{"select":this.popCompTypes},'egmailalertsuppress button[id="includeMore"]':{"click":this.assignAndAddMoreFilters},'egmailalertsuppress button[id="mailSubmit"]':{"click":this.submitUserFilterElements},'egmailalertsuppress button[id="btnViewFilters"]':{"click":this.viewFilteredElements},'userformcontainer textfield[id="uname"]':{"change":this.onCheck},'userformcontainer textfield[id="upass"]':{"change":this.passStrength},'userformcontainer radio[id="alarmNotifyNew"]':{change:this.setDDInMailMode},'configurecomponenttypes button[id="btnApply"]':{"click":this.applySeverChange}});
},setDDInMailMode:function(){var a=Ext.getCmp("alarmNotifyNew").getValue();if(a==false||a=="false"){Ext.getCmp("detailsDiagnosisAlerts").setVisible(false);}else{Ext.getCmp("detailsDiagnosisAlerts").setVisible(true);}},passStrength:function(){var a=publicJSON.pwdLength;var f=publicJSON.pwdComplexityCount;
if(a==""||a<2){a=8;}else{if(a!=""&&a<f){a=f;}}var b=Ext.getCmp("upass").getValue();var c=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\da-zA-Z]).+$/;var e=/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z]).+$/;var d=/^(?=.*\d)(?=.*[a-zA-Z]).+$/;if(b.length>=a&&c.test(b)){Ext.getCmp("passScore").setText(passStr+": "+Strong);
}else{if(b.length>=a&&b.match(e)){Ext.getCmp("passScore").setText(passStr+": "+Good);}else{if(b.length>=a&&b.match(d)){Ext.getCmp("passScore").setText(passStr+": "+Fair);}else{if(b.length==0){Ext.getCmp("passScore").setText(passLabel1+" "+a+" "+passLabel2);}else{Ext.getCmp("passScore").setText(passStr+": "+Weak);
}}}}},pwdComplexityCheck:function(e){var c="^";var a="";var f=".+$";var n="";var b=".";var m="<br/>";var g=publicJSON.pwdComplexity;if(g!=null&&g!=undefined){if(g.indexOf(",")>-1){n="false#";var j=g.split(",");for(var d=0;d<j.length;d++){var l=j[d].toLowerCase().trim();if(l=="lc"){a+="(?=.*[a-z])";n+=m+(d+1)+b+" "+userIDValidationMsg69;
}else{if(l=="uc"){a+="(?=.*[A-Z])";n+=m+(d+1)+b+" "+userIDValidationMsg70;}else{if(l=="dg"){a+="(?=.*[0-9])";n+=m+(d+1)+b+" "+userIDValidationMsg71;}else{if(l=="sp"){a+="(?=.*[^0-9a-zA-Z])";n+=m+(d+1)+b+" "+userIDValidationMsg72;}}}}}}else{n="false#";var l=g.toString().toLowerCase().trim();if(l=="lc"){a+="(?=.*[a-z])";
n+=userIDValidationMsg69;}else{if(l=="uc"){a+="(?=.*[A-Z])";n+=userIDValidationMsg70;}else{if(l=="dg"){a+="(?=.*[0-9])";n+=userIDValidationMsg71;}else{if(l=="sp"){a+="(?=.*[^0-9a-zA-Z])";n+=userIDValidationMsg72;}}}}}var h=new RegExp(c+a+f);if(h.test(e)){n="true";}}return n;},onCheck:function(){var b=Ext.getCmp("uname").getValue();
var g=publicJSON.hiddenFields;var f=g.username1;var h=publicJSON.displayNameOfDefaultOrg;if(b!=null&&b!=""){var a=Ext.getCmp("eGAuth").getValue();if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("idpAuthSAML").getValue()==true){a=true;}else{if(Ext.getCmp("eGAuthSAML").getValue()==true){a=true;
}}}if(f!=null&&f!=""&&a==true){var e=f.split("|hash|");if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("idpAuthSAML").getValue()==true){var c=Ext.getCmp("idpName").getValue();b="samlsso/"+c+"/"+b;}}for(var d=0;d<e.length;d++){if(typeof e[d]==="string"){e[d]=e[d].toLowerCase();
}}if(Ext.Array.contains(e,b.toLowerCase())||b.toLowerCase()==h.toLowerCase()){Ext.getCmp("userImage").update('<center><img src="/final/images/spacer.gif" class="iconWrong" style="cursor:pointer;" border="0" width="15" height="10" data-qtip="User ID already exists" data-qclass="yellowtip"></center>');
}else{Ext.getCmp("userImage").update('<center><img src="/final/images/spacer.gif" class="iconRight" style="cursor:pointer;" border="0" width="15" height="10" data-qtip="User ID available" data-qclass="yellowtip"></center>');}Ext.getCmp("userImage").show();}}else{Ext.getCmp("userImage").hide();}},buildMainData:function(a){if(!Ext.isEmpty(a)){appURL=appURL+"&usertype="+a;
}Ext.Ajax.request({url:appURL,method:"POST",async:false,success:function(b){var c=b.responseText;publicJSON=Ext.decode(c);}});},getErrorMessageTemplate:function(d){var a='<div class="x-table" style="width:90%"><table cellspacing="0" width="100%" cellpadding="5" border="0" align="center"><thead><tr><th><div class="x-panel-header x-docked x-panel-header-default x-horizontal x-panel-header-horizontal x-panel-header-default-horizontal x-top x-panel-header-top x-panel-header-default-top x-docked-top x-panel-header-docked-top x-panel-header-default-docked-top x-unselectable"><span>'+errorTitle+" : "+pageIntnl75+"</span></div></td></tr></thead>";
for(var c in d){if(c=="title"){continue;}var b=d[c];a=a+'<tr class="x-grid-row"><td class=" x-grid-cell x-grid-cell-first"><div class="x-grid-cell-inner" >'+b+"</div></td></tr>";}a=a+"</table></div>";return a;},cloneExistingUser:function(){window.location.href="/final/admin/EgReplicateUser.jsp?fromWizard="+fromWizard;
},getErrorTemplate:function(){var a=new Ext.XTemplate('<div class="x-table" style="width:100%">','<table cellspacing="0" width="90%" cellpadding="5" border="0" align="center" class="x-grid-table" style="border: 1px #e1e1e1 solid;"><col width="20%"><col width="70%">',"<thead>",'<tr class="x-grid-row">','<th colspan="2" class="x-grid-cell">','<div><span><b class="font_bold">'+pageIntnl75+"</b></span></div>","</th>","</tr>","</thead>","<tbody>",'<tpl for=".">','<tr class="x-grid-row">','<td class=" x-grid-cell x-grid-cell-first">','<div class="x-grid-cell-inner" ><b>'+pageIntnl76+"</b></div>","</td>",'<td class=" x-grid-cell x-grid-cell-first" style="border-left:0px" >','<div class="x-grid-cell-inner" >{ERROR}</div>',"</td>","</tr>",'<tr class="x-grid-row">','<td class=" x-grid-cell">','<div class="x-grid-cell-inner"><b>'+pageIntnl77+"</b></div>","</td>",'<td class="x-grid-cell" style="border-left:0px">','<div class="x-grid-cell-inner" >{DESCRIPTION}</div>',"</td>","</tr>",'<tr class="x-grid-row">','<td class="x-grid-cell">','<div class="x-grid-cell-inner"><b>'+pageIntnl78+"</b></div>","</td>",'<td class=" x-grid-cell" style="border-left:0px">','<div class="x-grid-cell-inner" >{RESOLUTION}</div>',"</td>","</tr>","</tpl>","</tbody>","</table>","</div>");
return a;},setMeasureInMailMode:function(d){var c=d.getValue().msgmode;var a=Ext.getCmp("measure_in_mail_mode");var b=publicJSON["measure_in_mail_mode"];if(c=="H"){a.getStore().loadRawData(b);a.setValue(a.getStore().getAt(1).get("valueField"));}else{a.getStore().loadRawData(b);a.setValue(a.getStore().getAt(1).get("valueField"));
a.getStore().removeAt(1);}},userValidityChange:function(f,e,c,d){var b=Ext.getCmp("tmptilldate");var a=f.getValue();if(a==true){b.setDisabled(true);}else{b.setDisabled(false);}},showAvailableUsers:function(e,d,a,b){var c=e.getValue();var f=Ext.getCmp("availusers");if(c==true){f.show();Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y);
}else{f.hide();Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y);}},submitUserElements:function(){var d="EgAddUser/data/EgusersiteserverspJson.jsp?date="+new Date().getTime();var c=this;c.associateValue("finish");var e=userElementJSON["hiddenFields"];var b=this.getHiddenFields(e);var a=this.getElementassociationform().getForm();
if(a.isValid()){this.getElementassociationform().submit({url:d+"&"+b,method:"POST",success:function(f,g){c.showUserAddForm();},failure:function(f,g){c.showUserAddForm();}});}},submitUserFilterElements:function(f){var e=this;f.setDisabled(true);var a=Ext.getCmp("filter").getValue();var d="EgAddUser/data/EgMailAlertSuppresspJson.jsp?reqfrom=add&userID="+encodeURIComponent(username);
if(username=="-1"){Ext.MessageBox.alert("Mail Filter","Please choose a user id");return;}if(username!="-1"){e.setFilterValues("finish");var g=userMailJSON["hiddenFields"];var c=e.getHiddenFields(g);var b=e.getEgmailalertsuppress().getForm();if(b.isValid()){this.getEgmailalertsuppress().submit({url:d+"&"+c,method:"POST",success:function(h,j){e.showUserAddForm();
},failure:function(h,j){e.showUserAddForm();}});}}f.setDisabled(false);},assignAndAddMoreFilters:function(e){var g=this;e.setDisabled(true);var j="raju";var h=Ext.getCmp("filter").getValue();var f="EgAddUser/data/EgMailAlertSuppresspJson.jsp?reqfrom=add&userID="+encodeURIComponent(username);if(j=="-1"){Ext.MessageBox.alert("Mail Filter","Please choose a user id");
return;}if(j!="-1"&&h!="-1"){g.setFilterValues("addMore");var d=userMailJSON["hiddenFields"];var a=g.getHiddenFields(d);var c=g.getEgmailalertsuppress().getForm();var b=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});b.show();if(c.isValid()){this.getEgmailalertsuppress().submit({url:f+"&"+a,method:"POST",success:function(k,l){b.hide();
},failure:function(k,l){b.hide();}});}}e.setDisabled(false);},showUserAddForm:function(){window.location.href="EgAddUser.jsp?qctr=1&fromWizard="+fromWizard;},assignAndAddMore:function(){var e="EgAddUser/data/EgusersiteserverspJson.jsp?date="+new Date().getTime();var d=this;d.associateValue("apply");var f=userElementJSON["hiddenFields"];
var c=this.getHiddenFields(f);var b=this.getElementassociationform().getForm();var a=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});a.show();if(b.isValid()){this.getElementassociationform().submit({url:e+"&"+c,method:"POST",success:function(g,h){a.hide();},failure:function(g,h){a.hide();}});}},setFilterValues:function(d){var h=Ext.getCmp("hiddenFieldsContainer");
var f=Ext.getCmp("exclude");var g=new Array();var b=new Array();var a=f.fromField.store;var k=f.toField.store;for(var l=0;l<a.getCount();l++){var c=a.getAt(l).get("valueField");b.push(c);}for(var l=0;l<k.getCount();l++){var c=k.getAt(l).get("valueField");g.push(c);}if(userMailJSON["excludedBoxHostVal"]&&userMailJSON["excludedBoxHostVal"]!=undefined){var j=userMailJSON["excludedBoxHostVal"];
if(j!=null&&j!=""){b[b.length]=j;}}var n={xtype:"hiddenfield",name:"includedBoxVal",value:g};var e={xtype:"hiddenfield",name:"excludedBoxVal",value:b};var m={xtype:"hiddenfield",name:"control",value:d};h.removeAll();h.add(n);h.add(e);h.add(m);},associateValue:function(p){var h=Ext.getCmp("elementassociationform");
var f=Ext.getCmp("elementsHiddenContainer");f.removeAll();var o=Ext.getCmp("associate");var g=Ext.getCmp("otherHosts");var b=new Array();var a=g.fromField.store;for(var m=0;m<a.getCount();m++){var d=a.getAt(m).get("valueField");b.push(d);}var c={xtype:"hiddenfield",name:"chosenHosts",value:b};var n={xtype:"hiddenfield",name:"action",value:p};
f.add(c);f.add(n);var k=o.getValue();if(!(k=="Segment")||(k=="Service")){if(k=="Zone"){var l=new Array();for(var j=0;j<a.getCount();j++){var d=a.getAt(j).get("valueField");l[j]=",Zone:"+d;}var e={xtype:"hiddenfield",name:"permanentAssociation",value:l};f.add(e);}else{var e={xtype:"hiddenfield",name:"permanentAssociation",value:Ext.getCmp("compType").getValue()};
f.add(e);}}},getServerDetails:function(f){var d=this;var h=f.getValue();var c=Ext.getCmp("associate").getValue();var b="EgAddUser/data/EgUserSiteServersJson.jsp?qctr=1&assousers="+encodeURIComponent(assousers)+"&username="+encodeURIComponent(username)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+utype+"&associate="+encodeURIComponent(c)+"&compType="+encodeURIComponent(h)+"&date="+new Date().getTime();
d.updateUserElementPage(b);var e=Ext.getCmp("otherHosts");var g=userElementJSON["associatedItems"];var a=userElementJSON["disAssociatedItems"];e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();}if(!Ext.isEmpty(g)){e.fromField.store.add(g);
}if(!Ext.isEmpty(a)){e.toField.store.add(a);}},associateServerType:function(e){if(e.getValue()==true){var d=Ext.getCmp("otherHosts");var c=d.toField.store;var b=d.fromField.store;for(var f=0;f<c.getCount();f++){var a=c.getAt(f);d.fromField.store.add(a);}d.toField.store.removeAll();}},associateOnChange:function(g){var k=this;
var h=g.getValue();if(h=="-1"){var e=Ext.getCmp("otherHosts");Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();}}else{var b="EgAddUser/data/EgUserSiteServersJson.jsp?qctr=1&assousers="+encodeURIComponent(assousers)+"&username="+encodeURIComponent(username)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+utype+"&associate="+encodeURIComponent(h)+"&date="+new Date().getTime();
k.updateUserElementPage(b);var a=userElementJSON["associatedItems"];var c=userElementJSON["disAssociatedItems"];var j=userElementJSON["toTitle"];var l=userElementJSON["fromTitle"];var e=Ext.getCmp("otherHosts");e.fromField.getComponent(0).setTitle(j);e.toField.getComponent(0).setTitle(l);if(h=="Independent servers"){var d=Ext.getCmp("compType");
var f=Ext.getCmp("compAssociation");d.getStore().loadRawData(userElementJSON["componentTypes"]);d.setValue(d.getStore().getAt(0).get("valueField"));d.show();e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();
}if(!Ext.isEmpty(a)){e.fromField.store.add(a);}if(!Ext.isEmpty(c)){e.toField.store.add(c);}}else{if(h=="Segment"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();
}if(!Ext.isEmpty(a)){e.fromField.store.add(a);}if(!Ext.isEmpty(c)){e.toField.store.add(c);}}else{if(h=="Zone"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();
}if(!Ext.isEmpty(a)){e.fromField.store.add(a);}if(!Ext.isEmpty(c)){e.toField.store.add(c);}}else{if(h=="Service"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();
}if(!Ext.isEmpty(a)){e.fromField.store.add(a);}if(!Ext.isEmpty(c)){e.toField.store.add(c);}}else{if(h=="ServiceGroup"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();
}if(!Ext.isEmpty(a)){e.fromField.store.add(a);}if(!Ext.isEmpty(c)){e.toField.store.add(c);}}}}}}}},uploadUsrImage:function(){var j=this;var m="gif/jpg/jpeg/png";var h=false;var c=Ext.getCmp("FILE_0");var e=c.getValue();var f=e.substring((e.lastIndexOf("."))+1,e.length);if(!validateSingleByte(c.getValue())){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg61+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(f.toLowerCase()!="gif"&&f.toLowerCase()!="jpg"&&f.toLowerCase()!="jpeg"&&f.toLowerCase()!="png"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg62+": '"+m+"'"+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}var b="FILE_0_dstFile";var l=filePath;l=l.replace(".gif","."+f);
var g=Ext.getCmp("hiddenFieldsContainer");g.removeAll();var d={xtype:"hiddenfield",name:"FILE_0_dstFile",value:l};g.add(d);var j=this;var a=new Ext.LoadMask(Ext.getBody(),{msg:"Uploading..."});a.show();var k=this.getFileupload().getForm();fileUploadURI=fileUploadURI.replace("fileExt=gif","fileExt="+f);
if(k.isValid()){this.getFileupload().submit({url:fileUploadURI,method:"POST",success:function(n,o){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg65+".",buttons:Ext.Msg.OK,icon:"iconInformation"});a.hide();j.updateImageStatus();Ext.getCmp("fileUpLoader").destroy();},failure:function(n,o){a.hide();
Ext.getCmp("fileUpLoader").destroy();}});}},updateImageStatus:function(){var a=Ext.getCmp("fileUpLoader");if(a.getCurrentUploaderInfo()=="login"){isLoginImgUpdated=true;}else{if(a.getCurrentUploaderInfo()=="monitor"){isAdminMonImgUpdated=true;}else{if(a.getCurrentUploaderInfo()=="reporter"){isRepImgUpdated=true;
}else{if(a.getCurrentUploaderInfo()=="config"){isConfigImgUpdated=true;}}}}},monitorLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("monitorLogoIMG");if(b=="show"){a.show();}else{a.hide();}},loginLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("loginLogoIMG");if(b=="show"){a.show();
}else{a.hide();}},repLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("reporterLogoIMG");if(b=="show"){a.show();}else{a.hide();}},configLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("configLogoIMG");if(b=="show"){a.show();}else{a.hide();}},loadMailShiftAlerts:function(g){var f=g.getValue().mailshift;
if(f=="yes"){var l=true;var m=Ext.getCmp("tomailid").getValue();var k=Ext.getCmp("ccmailid").getValue();var j=Ext.getCmp("bccmailid").getValue();var h=Ext.getCmp("escmailid").getValue();var d=validateEmail(m);var e=validateEmail(k);var n=validateEmail(j);var c=validateEmail(h);if(m==""&&j==""&&k==""){l=false;
}if((m!=""&&d==false)||(j!=""&&n==false)||(k!=""&&e==false)){var b=validateMailID(m);var a=validateMailID(j);var o=validateMailID(k);if(!b&&!a&&!o){l=false;}}if(!l){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg23+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("emailAlert_1").setValue(true);
return false;}Ext.getCmp("emailMailAlert").show();Ext.getCmp("userpref").body.scroll("bottom",g.getBox().y-200);}else{Ext.getCmp("emailMailAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",g.getBox().y-200);}},loadCommandShiftAlerts:function(c){var b=c.getValue().Execshift;if(b=="yes"){var a=Ext.getCmp("customScript");
if(a.getValue()==null||a.getValue()==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg40+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("shiftAlert_1").setValue(true);return false;}else{if(!checkspecial(a.getValue(),"@*+=[]|;\"'<>?~`")){a.focus(true);Ext.getCmp("shiftAlert_1").setValue(true);
return false;}}Ext.getCmp("commandAlert").show();Ext.getCmp("userpref").body.scroll("bottom",c.getBox().y-200);}else{Ext.getCmp("commandAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",c.getBox().y-200);}},loadSMSShiftAlerts:function(e){var n=/^(\+\d\d)?[0-9]+$/g;var d=e.getValue().smsshift;
if(d=="yes"){var m=true;var k=Ext.getCmp("tomailid").getValue();var h=Ext.getCmp("ccmailid").getValue();var g=Ext.getCmp("bccmailid").getValue();var f=Ext.getCmp("escmailid").getValue();var o=(k).match(n);var j=(h).match(n);var c=(g).match(n);var l=(f).match(n);if(k==""&&g==""&&h==""){m=false;}if((k!=""&&o!=k)||(g!=""&&c!=g)||(h!=""&&j!=h)){var b=validateMobileNo(k);
var a=validateMobileNo(g);var p=validateMobileNo(h);if(!b&&!a&&!p){m=false;}}if(!m){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg26+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("smsAlert_1").setValue(true);return false;}Ext.getCmp("smsAlert").show();Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y-200);
}else{Ext.getCmp("smsAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y-200);}},loadESCShiftAlerts:function(f){var h=/^(\+\d\d)?[0-9]+$/g;var b=/(((([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])|((\+\d\d)?[0-9]+))/g;
var e=f.getValue().escshift;if(e=="yes"){var c=Ext.getCmp("escmailid").getValue();var d=Ext.getCmp("escshiftNo");var a=validateEmail(c);var g=(c).match(h);var j=(c).match(b);if(c!=null&&c==""&&!checkmultiplemailid(c)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg28+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
Ext.getCmp("escAlert_1").setValue(true);return false;}if((c!="")&&(a==null||a==false)&&g==null&&j!=c){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg22+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(k){Ext.getCmp("escmailid").focus(true);}});Ext.getCmp("escAlert_1").setValue(true);return false;
}Ext.getCmp("escMailAlert").show();Ext.getCmp("userpref").body.scroll("bottom",f.getBox().y-200);}else{Ext.getCmp("escMailAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",f.getBox().y-200);}},eGRemoteExecution:function(e,d,a,b){var c=e.getValue().remotecontrol;if(c=="true"){Ext.getCmp("execcommands").show();
Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y);}else{Ext.getCmp("execcommands").hide();Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y);}},configureMailAlert:function(a){if(a==true){Ext.getCmp("high").setValue(true);Ext.getCmp("medium").setValue(true);Ext.getCmp("low").setValue(true);
Ext.getCmp("frmAlarmContainer").show();}else{Ext.getCmp("high").setValue(false);Ext.getCmp("medium").setValue(false);Ext.getCmp("low").setValue(false);Ext.getCmp("frmAlarmContainer").hide();}},showalarmRet:function(g,f,c,d){var e=Ext.getCmp("high").getValue();var b=Ext.getCmp("medium").getValue();var a=Ext.getCmp("low").getValue();
if(e==true||b==true||a==true){Ext.getCmp("frmAlarmContainer").show();if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){Ext.getCmp("customScript").hide();Ext.getCmp("Execshift").hide();}}else{Ext.getCmp("frmAlarmContainer").hide();}Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("high").getBox().y-200);
},logoConfiguration:function(g,f,b,c){var e=Ext.getCmp("imgRepPage");var d=Ext.getCmp("imgConfigPage");var a=publicJSON["isConfigSupported"];if(g.getValue()==true){e.hide();d.hide();}else{if(a==true){e.show();d.show();}else{e.show();}}},validateDomainDetails:function(h){var l=this;var m=Ext.getCmp("utype").getValue();
var k=Ext.getCmp("userAuth").getValue().authentication;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){k=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}var f=Ext.getCmp("rdoOperation").getValue().operation;var p=Ext.getCmp("uname");var n=Ext.getCmp("uname").getValue();
var d=Ext.getCmp("domainName").getValue();var b=n;var a=publicJSON.hiddenFields;var o=a.username1;if(m=="none"){Ext.Msg.show({title:pageTitle,msg:userRoleValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}if(d=="none"){Ext.Msg.show({title:pageTitle,msg:userDomainValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}if(!checkblank(n)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(q){Ext.getCmp("uname").focus(true);}});return;}else{if(!checkSpecial(p,'="/')){Ext.Msg.show({title:pageTitle,msg:_checkspecial,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){Ext.getCmp("uname").focus(true);
}});return;}else{if(trim(n)==""){Ext.getCmp("uname").focus(true);return;}else{if(n.indexOf("..")>-1){Ext.Msg.show({title:pageTitle,msg:_checkdots+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(q){Ext.getCmp("uname").focus(true);}});return;}}}}if(b!=null&&b!=""){if(o!=null&&o!=""){var g=o.split("|hash|");
if(k=="Domain"){b=d+"/"+b;}for(i=0;i<g.length;i++){if(g[i].toLowerCase()==b.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(q){Ext.getCmp("uname").focus(true);}});return;}}}}var e="EgAddUser/data/EgAddUserJson.jsp?qctr=1&usertype="+encodeURIComponent(m)+"&authentication="+k+"&operation="+encodeURIComponent(f)+"&domain="+encodeURIComponent(d)+"&uname="+encodeURIComponent(n)+"&ldapPass="+encodeURIComponent(ldapPass)+"&date="+new Date().getTime();
var c=new Ext.LoadMask(Ext.getBody(),{msg:"Validating..."});c.show();var j="";Ext.Ajax.request({url:e,method:"POST",success:function(q){j=Ext.decode(q.responseText);c.hide();if(j.requestStatus=="success"){h.hide();Ext.getCmp("uname").setReadOnly(true);Ext.getCmp("userExpFieldContainer").show();Ext.getCmp("btnNext").show();
}else{Ext.getCmp("btnNext").hide();var s=j.errors;var r=l.getErrorTemplate();var t=r.apply(s);l.showResultWindow(pageIntnl76,t);}j="";},failure:function(q){Ext.getCmp("btnNext").hide();c.hide();}});},domainSelect:function(e){var h=this;var b=e.getValue();var j=publicJSON["domGrpFilesObj"];var a=j[b];
if(b!="none"){h.isPwdConfiguredWithSelectedDomain(b);Ext.getCmp("rdoOperation").getStore().removeAll();var f=[{"displayField":"User","valueField":"User"}];if(a){f=[{"displayField":"User","valueField":"User"},{"displayField":"Group","valueField":"Groupname"},{"displayField":"Groups (Choose group from a list)","valueField":"Group"}];
}Ext.getCmp("rdoOperation").getStore().loadRawData(f);Ext.getCmp("rdoOperation").reset();Ext.getCmp("rdoOperation").setValue(f[0].valueField);Ext.getCmp("userCont").setFieldLabel("ID");var d=Ext.getCmp("rdoOperation").getValue();if(d=="Group"){var k=Ext.getCmp("utype").getValue();var g=Ext.getCmp("userAuth").getValue().authentication;
if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){g=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}var c="EgAddUser/data/EgAddUserJson.jsp?qctr=1&usertype="+encodeURIComponent(k)+"&authentication="+g+"&operation="+encodeURIComponent(d)+"&domain="+encodeURIComponent(b)+"&ldapPass="+encodeURIComponent(ldapPass)+"&date="+new Date().getTime();
h.updateUserPage(c);Ext.getCmp("grpname").setValue("  ----Click on the icon to select a group----  ");}else{h.resetUserOptions();}}else{Ext.getCmp("rdoOperation").getStore().removeAll();var f=[{"displayField":"User","valueField":"User"}];Ext.getCmp("rdoOperation").getStore().loadRawData(f);Ext.getCmp("rdoOperation").reset();
Ext.getCmp("rdoOperation").setValue("User");Ext.getCmp("rdoOperation").fireEvent("select",Ext.getCmp("rdoOperation"));h.resetUserOptions();}},resetUserOptions:function(){Ext.suspendLayouts();Ext.getCmp("validate").show();Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();Ext.getCmp("btnNext").hide();
Ext.getCmp("uname").setValue("");Ext.getCmp("uname").setReadOnly(false);Ext.getCmp("uname").show();Ext.getCmp("userCont").show();Ext.getCmp("userCont").setFieldLabel("ID");Ext.getCmp("grpnameCon").hide();Ext.getCmp("userExpFieldContainer").hide();Ext.resumeLayouts(true);},isPwdConfiguredWithSelectedDomain:function(b){var a=this;
var d="domainName="+b+"&validatePwd=yes";var c="/final/servlet/com.egurkha.ADDomainAuth?"+d;Ext.Ajax.request({url:c,method:"POST",async:false,success:function(e){var f=Ext.decode(e.responseText);if(f.isPasswordConfigured==false){a.showAuthenticationWindow(f.domainName,f.domUser);}}});},viewUserAssociatedElements:function(){var a=this;
Ext.widget("window",{extend:"Ext.panel.Panel",title:intnlLabel6,id:"userElementsWindow",width:"95%",height:400,border:false,autoScroll:true,closeAction:"destory",doClose:function(){this.destroy();},dockedItems:[{xtype:"toolbar",id:"dockedItem1",dock:"top",items:[{xtype:"tbfill"},{text:"Expand All",ui:"newButtonSmall",handler:function(){var b=Ext.getCmp("componentgroupedsummarygrid");
var c=b.view.getFeature("componentGrouping");c.expandAll();}},{text:"Close All",ui:"newButtonSmall",handler:function(){var b=Ext.getCmp("componentgroupedsummarygrid");var c=b.view.getFeature("componentGrouping");c.collapseAll();}}],}],listeners:{afterrender:function(){var d=Ext.getCmp("utype").getValue();
var e=Ext.getCmp("associate").getValue();var c="EgAddUser/data/EgUserSiteServersJson.jsp?qctr=1&assousers="+encodeURIComponent(assousers)+"&username="+encodeURIComponent(username)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+d+"&associate="+encodeURIComponent(e);
if(e=="Independent servers"){var b=Ext.getCmp("associate").getValue();c=c+"&compType="+encodeURIComponent(b);}a.updateUserElementPage(c);a.updateResultPanel();}},items:[{xtype:"container",id:"userAssociationContainer",layout:{type:"hbox",pack:"center"},margin:"10",}]}).show();},viewFilteredElements:function(){var a=this;
Ext.widget("window",{extend:"Ext.panel.Panel",id:"userFilterWindow",width:"95%",height:400,border:false,autoScroll:true,closeAction:"destory",doClose:function(){this.destroy();},listeners:{afterrender:function(){var d=filterMessage+": "+username;Ext.getCmp("userFilterWindow").setTitle(d);var b=Ext.getCmp("uname").getValue();
var c="EgAddUser/data/EgMailAlertSuppressJson.jsp?userID="+encodeURIComponent(b)+"&reqfrom=add&date="+new Date().getTime();a.updateUserMailSuppressList(c);a.updateFilterResultPanel();}},items:[{xtype:"container",id:"userFilterContainer",layout:{type:"vbox",pack:"center",align:"center"},defaults:{style:{padding:"10px"}},}]}).show();
},showAuthenticationWindow:function(b,a){Ext.widget("window",{title:pageIntnl79,id:"authWindow",width:600,height:170,modal:true,border:false,autoScroll:false,closeAction:"destory",doClose:function(){Ext.getCmp("domainName").setValue("none");this.destroy();},buttonAlign:"center",items:[{xtype:"container",layout:{type:"vbox",align:"center",pack:"center",padding:"6"},defaults:{labelAlign:"top",labelSeparator:"",margin:"5"},items:[{xtype:"displayfield",fieldLabel:"<b>Domain User</b>",width:320,value:b+"\\"+a},{xtype:"textfield",id:"userInput",cls:"textbox",fieldLabel:"<b>Domain User's Password</b>",width:320,inputType:"password",}]}],buttons:[{text:"Submit",cls:"quickMenuWhiteButton",handler:function(){var c=Ext.getCmp("userInput").getValue();
if(c==null||c==""||c.length==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg7+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(d){Ext.getCmp("userInput").focus(true);}});return false;}ldapPass=c;Ext.getCmp("authWindow").destroy();}}]}).show();},operationOnChange:function(a,c,f){var h=this;
var b=Ext.getCmp("domainName").getValue();var e=a.getValue();if(e=="User"||e=="Groupname"){if(e=="Groupname"){Ext.getCmp("userCont").setFieldLabel("Group name");}else{Ext.getCmp("userCont").setFieldLabel("ID");}Ext.suspendLayouts();Ext.getCmp("validate").show();Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();
Ext.getCmp("btnNext").hide();Ext.getCmp("uname").setValue("");Ext.getCmp("uname").setReadOnly(false);Ext.getCmp("uname").show();Ext.getCmp("userCont").show();Ext.getCmp("grpnameCon").hide();Ext.getCmp("userExpFieldContainer").hide();Ext.resumeLayouts(true);}else{if(b=="none"){Ext.Msg.show({title:pageTitle,msg:userDomainValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}Ext.getCmp("userExpFieldContainer").show();var j=Ext.getCmp("utype").getValue();var g=Ext.getCmp("userAuth").getValue().authentication;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){g=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}var e=Ext.getCmp("rdoOperation").getValue();
var b=Ext.getCmp("domainName").getValue();var d="EgAddUser/data/EgAddUserJson.jsp?qctr=1&usertype="+encodeURIComponent(j)+"&authentication="+g+"&operation="+encodeURIComponent(e)+"&domain="+encodeURIComponent(b)+"&ldapPass="+encodeURIComponent(ldapPass)+"&date="+new Date().getTime();h.updateUserPage(d);
Ext.suspendLayouts();Ext.getCmp("validate").hide();Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();Ext.getCmp("btnNext").show();Ext.getCmp("uname").hide();Ext.getCmp("userCont").hide();Ext.getCmp("grpname").setValue("  ----Click on the icon to select a group----  ");Ext.getCmp("grpnameCon").show();
Ext.resumeLayouts(true);}},validateDomainGroupname:function(j){var m=this;var n=Ext.getCmp("utype").getValue();var l=Ext.getCmp("userAuth").getValue().authentication;var g=Ext.getCmp("rdoOperation").getValue();var q=Ext.getCmp("uname");var o=Ext.getCmp("uname").getValue();var d=Ext.getCmp("domainName").getValue();
var b=o;var a=publicJSON.hiddenFields;var p=a.username1;if(!Ext.isEmpty(Ext.getCmp("userAuthSAML"))&&Ext.getCmp("userAuthSAML").isVisible()){l=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}if(n=="none"){Ext.Msg.show({title:pageTitle,msg:userRoleValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(l=="Domain"&&d=="none"){Ext.Msg.show({title:pageTitle,msg:userDomainValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}if(!checkblank(o)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(r){Ext.getCmp("uname").focus(true);
}});return;}else{if(isSoleNumber(q)){Ext.Msg.show({title:pageTitle,msg:"A group name cannot consist solely of numbers, periods (.), or spaces.",width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){Ext.getCmp("uname").focus(true);}});return;}else{if(trim(o)==""){Ext.getCmp("uname").focus(true);
return;}else{if(o.indexOf("..")>-1){Ext.Msg.show({title:pageTitle,msg:_checkdots+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(r){Ext.getCmp("uname").focus(true);}});return;}}}}if(b!=null&&b!=""){if(p!=null&&p!=""){var h=p.split("|hash|");b=d+"/Grp/"+b;for(i=0;i<h.length;i++){if(h[i].toLowerCase()==b.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(r){Ext.getCmp("uname").focus(true);
}});return;}}}}var f="EgAddUser/data/EgAddUserJson.jsp?qctr=1";var e="&usertype="+encodeURIComponent(n)+"&authentication="+l+"&operation="+encodeURIComponent(g)+"&domain="+encodeURIComponent(d)+"&uname="+encodeURIComponent(o)+"&ldapPass="+encodeURIComponent(ldapPass)+"&date="+new Date().getTime();var c=new Ext.LoadMask(Ext.getBody(),{msg:"Validating..."});
c.show();var k="";Ext.Ajax.request({url:f,params:e,method:"POST",timeout:120000,success:function(r){k=Ext.decode(r.responseText);c.hide();if(k.requestStatus=="success"){j.hide();actualGrpName=k.actualGrpName;if(!Ext.isEmpty(actualGrpName)&&actualGrpName!=o){Ext.getCmp("uname").setValue(actualGrpName);
}Ext.getCmp("uname").setReadOnly(true);Ext.getCmp("userExpFieldContainer").show();Ext.getCmp("btnNext").show();}else{Ext.getCmp("btnNext").hide();var t=k.errors;var s=m.getErrorTemplate();var u=s.apply(t);m.showResultWindow(pageIntnl76,u);}k="";},failure:function(r){Ext.getCmp("btnNext").hide();c.hide();
}});},validateDomainIdpDetails:function(h){var f=Ext.getCmp("rdoOperation").getValue();if(!Ext.isEmpty(f)&&f.toLowerCase()=="groupname"){appCnt.validateDomainGroupname(h);}else{var m=this;var o=Ext.getCmp("utype").getValue();var l=Ext.getCmp("userAuth").getValue().authentication;var r=Ext.getCmp("uname");
var p=Ext.getCmp("uname").getValue();var d=Ext.getCmp("domainName").getValue();var n=Ext.getCmp("idpName").getValue();var b=p;var a=publicJSON.hiddenFields;var q=a.username1;if(!Ext.isEmpty(Ext.getCmp("userAuthSAML"))&&Ext.getCmp("userAuthSAML").isVisible()){l=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;
}if(o=="none"){Ext.Msg.show({title:pageTitle,msg:userRoleValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}if(l=="Domain"&&d=="none"){Ext.Msg.show({title:pageTitle,msg:userDomainValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}if(l=="SAML"){if(n=="none"){Ext.Msg.show({title:pageTitle,msg:userIdpValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}var j=Ext.getCmp("uname").getValue();if(!checkblank(j)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(s){Ext.getCmp("uname").focus(true);}});return;}}if(!checkblank(p)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(s){Ext.getCmp("uname").focus(true);
}});return;}else{if(!checkSpecial(r,'="/\\')){Ext.Msg.show({title:pageTitle,msg:_checkspecial,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){Ext.getCmp("uname").focus(true);}});return;}else{if(trim(p)==""){Ext.getCmp("uname").focus(true);return;}else{if(p.indexOf("..")>-1){Ext.Msg.show({title:pageTitle,msg:_checkdots+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(s){Ext.getCmp("uname").focus(true);
}});return;}}}}if(b!=null&&b!=""){if(q!=null&&q!=""){var g=q.split("|hash|");if(l=="Domain"){b=d+"/"+b;}else{if(l=="SAML"){b="samlsso/"+n+"/"+b;}}for(i=0;i<g.length;i++){if(g[i].toLowerCase()==b.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(s){Ext.getCmp("uname").focus(true);
}});return;}}}}if(l=="SAML"){h.hide();Ext.getCmp("uname").setReadOnly(true);Ext.getCmp("userExpFieldContainer").show();Ext.getCmp("btnNext").show();return;}var e="EgAddUser/data/EgAddUserJson.jsp?qctr=1&usertype="+encodeURIComponent(o)+"&authentication="+l+"&operation="+encodeURIComponent(f)+"&domain="+encodeURIComponent(d)+"&uname="+encodeURIComponent(p)+"&ldapPass="+encodeURIComponent(ldapPass)+"&date="+new Date().getTime();
var c=new Ext.LoadMask(Ext.getBody(),{msg:"Validating..."});c.show();var k="";Ext.Ajax.request({url:e,method:"POST",timeout:120000,success:function(s){k=Ext.decode(s.responseText);c.hide();if(k.requestStatus=="success"){h.hide();Ext.getCmp("uname").setReadOnly(true);Ext.getCmp("userExpFieldContainer").show();
Ext.getCmp("btnNext").show();}else{Ext.getCmp("btnNext").hide();var u=k.errors;var t=m.getErrorTemplate();var v=t.apply(u);m.showResultWindow(pageIntnl76,v);}k="";},failure:function(s){Ext.getCmp("btnNext").hide();c.hide();}});}},authenticationMode:function(f,d,a,h){var j=this;var k=Ext.getCmp("utype").getValue();
if(k=="none"){Ext.Msg.show({title:pageTitle,msg:userRoleValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("uname").reset();if(f.id=="userAuthSAML"){Ext.getCmp("userAuthSAML").reset();}else{Ext.getCmp("userAuth").reset();}return false;}var b=d.authentication;Ext.getCmp("userCont").setFieldLabel("ID");
if(f.id=="userAuthSAML"){b=d.authenticationSAML;}var l=publicJSON["hasmonitoraccess"];var c=Ext.getCmp("uname");Ext.suspendLayouts();if(b=="Eg"){Ext.getCmp("validate").hide();Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();Ext.getCmp("btnNext").show();Ext.getCmp("domainName").hide();Ext.getCmp("rdoOperation").hide();
Ext.getCmp("uname").setReadOnly(false);Ext.getCmp("uname").show();Ext.getCmp("userCont").show();Ext.getCmp("upass").show();Ext.getCmp("pasCont").show();c.show();c.maxLength=256;Ext.getCmp("confpasswd").show();Ext.getCmp("changePwd").show();Ext.getCmp("grpnameCon").hide();Ext.getCmp("idpName").hide();
Ext.getCmp("userExpFieldContainer").show();document.getElementById("uname-inputEl").setAttribute("maxLength","256");}else{if(b=="SAML"){c.show();c.maxLength=256;Ext.getCmp("idpName").show();Ext.getCmp("validate").hide();Ext.getCmp("uname").setReadOnly(false);Ext.getCmp("domainName").hide();Ext.getCmp("rdoOperation").hide();
Ext.getCmp("grpnameCon").hide();Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();Ext.getCmp("btnNext").show();Ext.getCmp("upass").hide();Ext.getCmp("pasCont").hide();Ext.getCmp("confpasswd").hide();Ext.getCmp("changePwd").hide();Ext.getCmp("userExpFieldContainer").show();var e=Ext.getCmp("idpName");
e.getStore().loadRawData(publicJSON["idpList"]);e.setValue(e.getStore().getAt(0).get("valueField"));document.getElementById("uname-inputEl").setAttribute("maxLength","156");if(e.getStore().getTotalCount()<=1){Ext.resumeLayouts(true);Ext.Msg.show({title:pageTitle,msg:noIdpMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){if(f.id=="userAuthSAML"){Ext.getCmp("eGAuthSAML").setValue(true);
}else{Ext.getCmp("eGAuth").setValue(true);}}});return false;}}else{c.maxLength=156;Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();Ext.getCmp("btnNext").hide();Ext.getCmp("validate").show();Ext.getCmp("domainName").show();Ext.getCmp("rdoOperation").getStore().removeAll();var g=[{"displayField":"User","valueField":"User"}];
Ext.getCmp("rdoOperation").getStore().loadRawData(g);Ext.getCmp("rdoOperation").reset();Ext.getCmp("rdoOperation").setValue("User");Ext.getCmp("rdoOperation").show();Ext.getCmp("upass").hide();Ext.getCmp("pasCont").hide();c.show();Ext.getCmp("confpasswd").hide();Ext.getCmp("changePwd").hide();Ext.getCmp("grpnameCon").hide();
Ext.getCmp("userExpFieldContainer").hide();Ext.getCmp("rdoOperation").fireEvent("select",Ext.getCmp("rdoOperation"));Ext.getCmp("idpName").hide();var m=Ext.getCmp("domainName");m.getStore().loadRawData(publicJSON["domainsList"]);m.setValue(m.getStore().getAt(0).get("valueField"));document.getElementById("uname-inputEl").setAttribute("maxLength","156");
if(m.getStore().getTotalCount()<=1){Ext.resumeLayouts(true);Ext.Msg.show({title:pageTitle,msg:noDomainMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){if(f.id=="userAuthSAML"){Ext.getCmp("eGAuthSAML").setValue(true);}else{Ext.getCmp("eGAuth").setValue(true);}}});return false;}}}Ext.resumeLayouts(true);
c.setValue("");},onUserTypeChange:function(g){var e=this;var c=g.getValue();if(Ext.isEmpty(c)){c="none";g.setValue("none");}var b=Ext.getCmp("userformcontainer");var d=Ext.getCmp("userModel").getValue();if(!Ext.isEmpty(d)&&d=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg75+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(j){Ext.getCmp("userModel").focus(true,true);
Ext.getCmp("utype").setValue("none");}});b.setActiveTab(0);return false;}else{if(!Ext.isEmpty(d)&&(d=="SubOrganization"||d=="User")){var h=Ext.getCmp("org").getValue();if(h=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg74+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(j){Ext.getCmp("org").focus(true,true);
Ext.getCmp("utype").setValue("none");}});b.setActiveTab(0);return false;}}}if(c=="none"){b.child("#tab2").tab.setDisabled(true);return false;}isLoginImgUpdated=false;isAdminMonImgUpdated=false;isRepImgUpdated=false;isConfigImgUpdated=false;b.child("#tab2").tab.setDisabled(false);var a=new Ext.LoadMask(Ext.getBody(),{msg:"Loading..."});
a.show();var h=Ext.getCmp("org").getValue();var f="EgAddUser/data/EgAddUserJson.jsp?qctr=1&usertype="+encodeURIComponent(c)+"&org="+encodeURIComponent(parent.filterEncode(h))+"&date="+new Date().getTime();e.updateUserPage(f);e.loadUserControls(c);a.hide();},loadUserControls:function(n){var F=Ext.getCmp("org").getValue();
var C="EgAddUser/data/EgAddUserJson.jsp?qctr=1&usertype="+encodeURIComponent(n)+"&org="+encodeURIComponent(parent.filterEncode(F))+"&date="+new Date().getTime();this.updateUserPage(C);inputs=0;mailShiftPeriodsCount=0;smsShiftPeriodsCount=0;escShiftPeriodsCount=0;ExecShiftPeriodsCount=0;var s=this;Ext.getCmp("eGAuth").setValue(true);
Ext.getCmp("rdoOperation").reset();Ext.getCmp("rdoOperation").setValue("User");if(isEmailId){Ext.getCmp("userCont").setFieldLabel("Email ID");}else{Ext.getCmp("userCont").setFieldLabel("ID");}var A=publicJSON["hasmonitoraccess"];var D=publicJSON["hasAllComponentAccess"];var I=Ext.getCmp("loginLogo1");
var e=Ext.getCmp("monitorLogo1");var l=Ext.getCmp("reporterLogo1");var x=Ext.getCmp("configLogo1");var j=Ext.getCmp("timeZone");var J=Ext.getCmp("userDataFormat");var p=Ext.getCmp("timeOpt");j.getStore().loadRawData(publicJSON["timeZone"]);if(publicJSON.selectedTimeZone=="undefined"||publicJSON.selectedTimeZone==undefined){j.setValue(j.getStore().getAt(0).get("valueField"));
}else{j.setValue(publicJSON["selectedTimeZone"]);}J.getStore().loadRawData(publicJSON["userDataFormat"]);J.setValue(publicJSON["selectedDateFormat"]);var h=publicJSON["isDescEnabled"];if(h!=null&&h!=undefined&&h){Ext.getCmp("description").setValue(publicJSON["description"]);Ext.getCmp("description").show();
}var f=Ext.getCmp("mailSenders");f.getStore().loadRawData(publicJSON["mailSenders"]);f.setValue(f.getStore().getAt(0).get("valueField"));if(A==true){var m=Ext.getCmp("monitorHomePage");var E=Ext.getCmp("userProf_monitorHomeOpt");if(!Ext.isEmpty(E)){E.suspendEvents(false);E.setValue({selectedMonHomeOpt:"Default"});
E.resumeEvents();E.on("change",function(){var M=E.getChecked();var L=M[0].inputValue;if(L!=null&&L=="dynamic"){m.getStore().removeAll();m.getStore().loadRawData(publicJSON["monitoringDomains"]);m.setValue(publicJSON["selectedMonitorDomain"]);}else{m.getStore().removeAll();m.getStore().loadRawData(publicJSON["monhomearray"]);
m.setValue(publicJSON["monHomePage"]);}});}var a=publicJSON["selectedMonitorDomain"];if(E!=null&&E=="dynamic"){m.getStore().removeAll();m.getStore().loadRawData(publicJSON["monitoringDomains"]);m.setValue(publicJSON["selectedMonitorDomain"]);}else{m.getStore().removeAll();m.getStore().loadRawData(publicJSON["monhomearray"]);
m.setValue(publicJSON["monHomePage"]);}Ext.getCmp("monitorFieldsContainer").show();Ext.getCmp("mailsmsalerts").show();var r=Ext.getCmp("measure_in_mail_mode");var u=publicJSON["remoteEnabled"];var t=publicJSON["isShiftPeriodsEnabled"];var g=publicJSON["td"];if(t==true){s.getShifPeroidsCt().show();}else{s.getShifPeroidsCt().hide();
}if(Ext.isEmpty(u)||u==undefined||u=="undefined"||u==false){Ext.getCmp("eGRemoteExec").hide();Ext.getCmp("execcommands").hide();}else{var y=Ext.getCmp("execcommands");y.getStore().loadRawData(publicJSON["execcommands"]);y.setValue(y.getStore().getAt(0).get("valueField"));Ext.getCmp("eGRemoteExec").show();
Ext.getCmp("execcommands").show();}r.getStore().loadRawData(publicJSON["measure_in_mail_mode"]);r.setValue(r.getStore().getAt(1).get("valueField"));var v=Ext.getCmp("userDashboardCreationPrivilege");var H=publicJSON["monitorHomeDisable"];if(H=="disabled"){m.setDisabled(true);E.setDisabled(true);v.hide();
}else{m.setDisabled(false);E.setDisabled(false);v.show();}var b=Ext.getCmp("mail_filter_optionGrp");if(publicJSON.isFilterControlEnabled==true){b.show();mailFilterOption=publicJSON.filterControlDefaultSelection;if(mailFilterOption=="Descriptors_Only"){Ext.getCmp("mail_filter_option2").setValue(true);
}else{Ext.getCmp("mail_filter_option1").setValue(true);}}else{b.hide();}Ext.getCmp("availusers").hide();Ext.getCmp("autoassociatetousers").hide();Ext.getCmp("selectedServerListGrid").hide();var z=publicJSON["hasAllCompAccess"];var o=publicJSON["isShareRole"];var B=Ext.getCmp("userModel").getValue();if(z==false){if(!Ext.isEmpty(B)&&B=="User"){if(!Ext.isEmpty(o)&&o==false){Ext.getCmp("selectedServerListGrid").show();
}else{Ext.getCmp("selectedServerListGrid").hide();}}else{if(!Ext.isEmpty(B)&&B=="SubOrganization"){Ext.getCmp("selectedServerListGrid").show();}else{Ext.getCmp("selectedServerListGrid").hide();}}}else{Ext.getCmp("selectedServerListGrid").hide();}if(g==true){Ext.getCmp("chkuser").show();if(!Ext.isEmpty(B)&&B=="User"){if(!Ext.isEmpty(o)&&o==false){Ext.getCmp("autoassociatetousers").show();
Ext.getCmp("availusers").getStore().loadRawData(publicJSON["availusers"]);}else{Ext.getCmp("autoassociatetousers").hide();}}else{Ext.getCmp("autoassociatetousers").hide();}}else{Ext.getCmp("autoassociatetousers").hide();}}else{Ext.getCmp("monitorFieldsContainer").hide();Ext.getCmp("mailsmsalerts").hide();
Ext.getCmp("autoassociatetousers").hide();Ext.getCmp("selectedServerListGrid").hide();}var G=publicJSON["hasReporterTab"];var d=publicJSON["hasMemReporterChek"];if(G==false||d==false){p.getStore().removeAll();Ext.getCmp("reporterTimeLine").hide();}else{p.getStore().loadRawData(publicJSON["chgTimeOpt"]);
p.setValue(publicJSON["chgTimeOptSeleted"]);Ext.getCmp("reporterTimeLine").show();}var q=publicJSON["logoArr"];I.getStore().loadRawData(q);I.setValue(I.getStore().getAt(0).get("valueField"));e.getStore().loadRawData(q);e.setValue(e.getStore().getAt(0).get("valueField"));var w=Ext.getCmp("logoCheck");
w.hide();if(n!=null&&n!="AlarmViewer"&&n!="SuperAlarmViewer"){w.show();l.getStore().loadRawData(q);l.setValue(l.getStore().getAt(0).get("valueField"));var k=publicJSON["isConfigSupported"];var K=Ext.getCmp("configLogoContainer");if(k==true){x.getStore().loadRawData(q);x.setValue(x.getStore().getAt(0).get("valueField"));
var c=Ext.getCmp("logoCheck").getValue();if(c==true){Ext.getCmp("imgRepPage").hide();Ext.getCmp("imgConfigPage").hide();}else{Ext.getCmp("imgConfigPage").show();}}else{Ext.getCmp("imgConfigPage").hide();}}else{Ext.getCmp("imgRepPage").hide();Ext.getCmp("imgConfigPage").hide();}},goBack:function(){if(backHref.indexOf("?")!=-1){backHref+="&fromWizard="+fromWizard;
}else{backHref+="?fromWizard="+fromWizard;}window.location.href=backHref;},afterMainRender:function(){if(reqfrom!="navlink"){Ext.getCmp("backButton").show();}var j=publicJSON.isSAMLLoginEnabled;if(!Ext.isEmpty(j)&&j){Ext.getCmp("userAuthSAML").setDisabled(false);Ext.getCmp("userAuthSAML").show();Ext.getCmp("userAuth").setDisabled(true);
Ext.getCmp("userAuth").hide();}else{Ext.getCmp("userAuth").setDisabled(false);Ext.getCmp("userAuth").show();Ext.getCmp("userAuthSAML").setDisabled(true);Ext.getCmp("userAuthSAML").hide();}Ext.getCmp("userModel").getStore().loadRawData(publicJSON["userModel"]);var c={text:"Choose Organization / Organizational Unit",id:"-1",name:"-1",expanded:true,children:publicJSON["organization"]};
Ext.getCmp("org").getStore().setRootNode(c);if(selectedUType=="none"){if(hasAllComponentAccess){if(isEnterpriseModel){Ext.getCmp("userModel").setValue("User");Ext.getCmp("org").setValue("egenterprise");}else{if(isdefuser){Ext.getCmp("userModel").setValue("Organization");Ext.getCmp("org").setValue("-1");
}else{Ext.getCmp("userModel").setValue("User");if(!Ext.isEmpty(orgName)){Ext.getCmp("org").setValue(orgName);}else{Ext.getCmp("org").setValue("-1");}}}}else{Ext.getCmp("userModel").setValue("User");if(!Ext.isEmpty(orgName)){Ext.getCmp("org").setValue(orgName);}else{Ext.getCmp("org").setValue("-1");}}}else{if(!Ext.isEmpty(selectedUserModel)){Ext.getCmp("userModel").setValue(selectedUserModel);
}else{Ext.getCmp("userModel").setValue("-1");}if(!Ext.isEmpty(orgName)){Ext.getCmp("org").setValue(orgName);}else{Ext.getCmp("org").setValue("-1");}}this.onOrganizationChange(Ext.getCmp("org"));var f=this;f.loadDefaults();if(selectedUType!="none"){var g=Ext.getCmp("userformcontainer");g.child("#tab2").tab.setDisabled(false);
f.loadUserControls(selectedUType);}else{var g=Ext.getCmp("userformcontainer");g.child("#tab2").tab.setDisabled(true);}var e=publicJSON.pwdLength;var b=publicJSON.pwdComplexityCount;if(e==""||e<2){e=8;}else{if(e!=""&&e<b){e=b;}}Ext.getCmp("passScore").setText(passLabel1+" "+e+" "+passLabel2);var h=Ext.getCmp("org").getValue();
var a=Ext.getCmp("userModel").getValue();Ext.getCmp("utype").getStore().clearFilter();if(!isdefuser){if(!Ext.isEmpty(a)&&(a=="Organization"||a=="SubOrganization")){Ext.getCmp("utype").getStore().filter("isShareRole",true);}else{if(h.toLowerCase()=="egenterprise"){}else{Ext.getCmp("utype").getStore().filter("hasallcompaccess",false);
}}}else{if(!Ext.isEmpty(a)&&(a=="Organization"||a=="SubOrganization")){if(a=="Organization"){Ext.getCmp("org").hide();Ext.getCmp("selectedServerListGrid").hide();}else{Ext.getCmp("selectedServerListGrid").show();}Ext.getCmp("utype").getStore().filter("isShareRole",true);}else{Ext.getCmp("org").show();
var h=Ext.getCmp("org").getValue();var d=publicJSON["isShareRole"];if(!Ext.isEmpty(d)&&d==false){Ext.getCmp("selectedServerListGrid").show();}else{Ext.getCmp("selectedServerListGrid").hide();}if(!Ext.isEmpty(j)&&j){Ext.getCmp("userAuthSAML").setDisabled(false);Ext.getCmp("userAuthSAML").show();Ext.getCmp("userAuth").setDisabled(true);
Ext.getCmp("userAuth").hide();}else{Ext.getCmp("userAuth").setDisabled(false);Ext.getCmp("userAuth").show();Ext.getCmp("userAuthSAML").setDisabled(true);Ext.getCmp("userAuthSAML").hide();}}}f.onUserTypeChange(Ext.getCmp("utype"));var h=Ext.getCmp("org").getValue();if(h=="egenterprise"){Ext.getCmp("Never").setValue(true);
}if(!isEnterpriseModel){Ext.getCmp("userAuth").setDisabled(true);Ext.getCmp("userAuth").hide();Ext.getCmp("userAuthSAML").setDisabled(true);Ext.getCmp("userAuthSAML").hide();Ext.getCmp("eGAuth").setValue(true);Ext.getCmp("eGAuthSAML").setValue(true);}},onUserModelChange:function(){var a=Ext.getCmp("userModel").getValue();
Ext.getCmp("utype").getStore().clearFilter();if(!Ext.isEmpty(a)&&a=="Organization"){Ext.getCmp("org").hide();Ext.getCmp("selectedServerListGrid").hide();Ext.getCmp("utype").getStore().filter("isShareRole",true);Ext.getCmp("utype").setValue("none");Ext.getCmp("org").setValue("-1");this.onOrganizationChange(Ext.getCmp("org"));
Ext.getCmp("userCont").setFieldLabel("ID");}else{if(!Ext.isEmpty(a)&&a=="SubOrganization"){Ext.getCmp("org").show();Ext.getCmp("selectedServerListGrid").show();Ext.getCmp("utype").getStore().filter("isShareRole",true);Ext.getCmp("utype").setValue("none");}else{Ext.getCmp("org").show();Ext.getCmp("selectedServerListGrid").show();
var b=Ext.getCmp("org").getValue();if(!Ext.isEmpty(b)&&b.toLowerCase()=="egenterprise"){}else{Ext.getCmp("utype").getStore().filter("hasallcompaccess",false);}Ext.getCmp("utype").setValue("none");}}},onOrganizationChange:function(g){var d=this;var c=Ext.getCmp("userModel").getValue();if(!Ext.isEmpty(c)&&c=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg75+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(j){Ext.getCmp("userModel").focus(true,true);
Ext.getCmp("utype").setValue("none");Ext.getCmp("org").setValue("-1");}});Ext.getCmp("userformcontainer").setActiveTab(0);return false;}var f=g.getValue();if(!Ext.isEmpty(f)&&f!="-1"){var e="EgAddUser/data/EgAddUserJson.jsp?qctr=1&org="+encodeURIComponent(parent.filterEncode(f))+"&date="+new Date().getTime();
Ext.Ajax.request({url:e,method:"POST",success:function(j){var l=Ext.decode(j.responseText);Ext.getCmp("utype").getStore().loadRawData(l["utype"]);if(selectedUType!="none"){var k=Ext.getCmp("utype").getStore().findExact("valueField",selectedUType);if(k!=-1){Ext.getCmp("utype").setValue(selectedUType);
}else{Ext.getCmp("utype").setValue("none");}}else{Ext.getCmp("utype").setValue("none");}if(!isEnterpriseModel&&!Ext.isEmpty(enforceEmailIDInMSP)&&enforceEmailIDInMSP.toLowerCase()=="true"){var m=l["superOU"];if(!Ext.isEmpty(m)&&m.toLowerCase()!="egenterprise"){isEmailId=true;Ext.getCmp("userCont").setFieldLabel("Email ID");
}else{isEmailId=false;Ext.getCmp("userCont").setFieldLabel("ID");}}if(l.requestStatus=="failed"){Ext.Msg.show({title:l.errors.title,msg:l.errors.message1+". "+l.errors.message2+".",width:500,buttons:Ext.Msg.OK,icon:"iconError",fn:function(n){if(n=="ok"){Ext.getCmp("org").setValue("-1");Ext.getCmp("org").focus(true);
d.onOrganizationChange(Ext.getCmp("org"));}}});}},failure:function(j){}});}f=g.getValue();if(f=="-1"){if(!Ext.isEmpty(c)&&c!="Organization"){Ext.getCmp("utype").getStore().clearFilter();}Ext.getCmp("tmptilldate").setValue("");Ext.getCmp("Never").setValue("");Ext.getCmp("userformcontainer").child("#tab2").tab.setDisabled(true);
}else{var a=g.getStore().getNodeById(f);var h=a.raw.uvalidtill;Ext.getCmp("tmptilldate").setValue("");Ext.getCmp("Never").setValue("");if(h!=null&&h!="12/12/9999"){Ext.getCmp("tmptilldate").setValue(h);Ext.getCmp("tmptilldate").setMaxValue(h);Ext.getCmp("Never").setDisabled(true);Ext.getCmp("Never").setValue(false);
}else{Ext.getCmp("tmptilldate").setMaxValue("12/12/9999");Ext.getCmp("Never").setDisabled(false);Ext.getCmp("Never").setValue(true);}var c=Ext.getCmp("userModel").getValue();Ext.getCmp("utype").getStore().clearFilter();if(!Ext.isEmpty(c)&&c=="Organization"){Ext.getCmp("org").hide();Ext.getCmp("selectedServerListGrid").hide();
Ext.getCmp("utype").setValue("none");Ext.getCmp("utype").getStore().filter("isShareRole",true);}else{if(!Ext.isEmpty(c)&&c=="SubOrganization"){Ext.getCmp("org").show();Ext.getCmp("selectedServerListGrid").show();Ext.getCmp("utype").setValue("none");Ext.getCmp("utype").getStore().filter("isShareRole",true);
}else{Ext.getCmp("org").show();Ext.getCmp("selectedServerListGrid").show();if(f=="egenterprise"){Ext.getCmp("utype").setValue("none");}else{Ext.getCmp("utype").setValue("none");Ext.getCmp("utype").getStore().filter("hasallcompaccess",false);}}}}if(selectedUType!="none"){var b=Ext.getCmp("utype").getStore().findExact("valueField",selectedUType);
if(b!=-1){Ext.getCmp("utype").setValue(selectedUType);}else{Ext.getCmp("utype").setValue("none");}}else{Ext.getCmp("utype").setValue("none");}Ext.getCmp("userformcontainer").child("#tab2").tab.setDisabled(true);},loadDefaults:function(){var a=Ext.getCmp("utype");a.getStore().loadRawData(publicJSON["utype"]);
a.setValue(selectedUType);this.setLangEntries(publicJSON.langEntries);},setLangEntries:function(c){for(var a in c){var b=Ext.getCmp(a);if(b==null||b=="undefined"){continue;}if(b.getXType()=="checkboxfield"||b.getXType()=="radiofield"){if(b.boxLabelEl==null||b.boxLabelEl==undefined||b.boxLabelEl=="undefined"){continue;
}b.boxLabelEl.update(c[a]);}else{b.setFieldLabel(c[a]);}}},updateUserPage:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var c=b.responseText;publicJSON=Ext.decode(c);}});},showCommandInWindow:function(b){var a=Ext.getCmp("customScript").getValue();b.setDisabled(true);
Ext.widget("window",{extend:"Ext.panel.Panel",title:"Command",id:"commandWindow",closeAction:"destory",width:625,height:300,modal:true,scroll:true,autoScroll:true,doClose:function(){b.setDisabled(false);this.destroy();},padding:"40px 5px 10px 5px",buttonAlign:"center",items:[{xtype:"textareafield",id:"tmpTextArea",cls:"text-area",fieldLabel:"Command",height:160,grow:true,value:a,rows:9,cols:72}],buttons:[{text:"Apply",id:"applyCommand",ui:"newButtonSmall",margin:"0 0 10 0",handler:function(){b.setDisabled(false);
Ext.getCmp("customScript").setValue(Ext.getCmp("tmpTextArea").getValue());Ext.getCmp("commandWindow").destroy();}}]}).show();},showResultWindow:function(b,a){Ext.widget("window",{title:b,closeAction:"destory",bodyPadding:20,scroll:true,width:700,modal:true,autoScroll:true,doClose:function(){this.destroy();
},html:a}).show();},showResultQBox:function(b){var e=Ext.decode(b);var d=e["requestStatus"];var c="";if(d=="success"){var a=e["result"];c=a.title;}else{var a=e["errors"];c=a.title;}Ext.widget("window",{title:c,closeAction:"destory",width:600,height:300,scroll:true,autoScroll:true,doClose:function(){e="";
this.destroy();},html:b}).show();},getHiddenFields:function(b){var a="";for(key in b){if(key=="vsTypes"){continue;}a+=key+"="+encodeURIComponent(b[key])+"&";}return a;},submitUserDetails:function(b){var e=this;var f=Ext.getCmp("utype").getValue();this.buildMainData(f);var c=e.validateUserForm("formsubmit");
if(c==true){var d=e.getSelectedUsers();var h="";Ext.getCmp("selectedServerListGrid").getStore().each(function(k){if(!Ext.isEmpty(k.get("valueField_1"))){h+=k.get("valueField_1")+",";}if(!Ext.isEmpty(k.get("valueField_2"))){h+=k.get("valueField_2")+",";}if(!Ext.isEmpty(k.get("valueField_3"))){h+=k.get("valueField_3")+",";
}});h=h.substring(0,h.length-1);Ext.getCmp("interestedDomains").setValue(h);var a=new Ext.LoadMask(Ext.getBody(),{msg:"Adding new user..."});a.show();var g=this.getMain().getForm();if(g.isValid()){Ext.getCmp("availusers").setDisabled(true);Ext.getCmp("confpasswd").setDisabled(true);var j=Ext.getCmp("org").getValue();
this.getMain().submit({url:"EgAddUser/data/EgadduserpJson.jsp?count="+inputs+"&assousers="+encodeURIComponent(d)+"&date="+new Date().getTime(),method:"POST",params:{"org":parent.filterEncode(j)},success:function(n,p){if(p.response.status==200&&!Ext.isEmpty(p.response.responseText)){a.hide();var q=Ext.decode(p.response.responseText);
if(q.requestStatus=="success"){var s=q.TwoFAMailSend;if(!Ext.isEmpty(s)&&s.toLowerCase()=="failed"){var m=q.MailSendErrMsg;Ext.Msg.show({title:pageTitle,msg:m+".",buttons:Ext.Msg.OK,icon:"iconInformation"});}assousers=d;utype=q.utype;username=q.username;var k=q.hasallcompaccess;var l=q.userModel;var o=q.ShareCompsAcrossOU;
var r=q.isShareRole;isAlarmEnabled=q.isAlarmEnabled;isFilterMailAlertsEnabled=q.isFilterMailAlertsEnabled;if(k==false&&utype!="FannieMae-InfoSec"){if(!Ext.isEmpty(l)&&l=="Organization"){if(!Ext.isEmpty(o)&&o=="true"){e.configureUserElements("association");}else{if(isAlarmEnabled==true&&isFilterMailAlertsEnabled==true){e.configureUserElements("filter");
}else{var t=q.result;Ext.Msg.show({title:t.title,msg:t.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(u){if(u=="ok"){e.showUserAddForm();}}});}}}else{if(!Ext.isEmpty(l)&&l=="User"){if(!Ext.isEmpty(r)&&r==false){e.configureUserElements("association");}else{if(isAlarmEnabled==true&&isFilterMailAlertsEnabled==true){e.configureUserElements("filter");
}else{var t=q.result;Ext.Msg.show({title:t.title,msg:t.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(u){if(u=="ok"){e.showUserAddForm();}}});}}}else{e.configureUserElements("association");}}}else{if(isAlarmEnabled==true&&isFilterMailAlertsEnabled==true&&utype!="FannieMae-InfoSec"){e.configureUserElements("filter");
}else{var t=q.result;Ext.Msg.show({title:t.title,msg:t.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(u){if(u=="ok"){e.showUserAddForm();}}});}}}else{Ext.Msg.show({title:q.errors.title,msg:q.errors.message1+". "+q.errors.message2+".",width:500,buttons:Ext.Msg.OK,icon:"iconError"});
}}Ext.getCmp("availusers").setDisabled(false);},failure:function(k,l){Ext.getCmp("availusers").setDisabled(false);Ext.Msg.show({title:"Ajax Failed",msg:"Could not update user details.",width:400,buttons:Ext.Msg.OK,icon:"iconError"});a.hide();}});}}},getDeepAllChildNodes:function(b){var a="";Ext.Ajax.request({url:"EgAddUser/data/EgAddUserJson.jsp?qctr=1&from=getSuperOU&org="+encodeURIComponent(parent.filterEncode(b))+"&date="+new Date().getTime(),method:"POST",async:false,success:function(e){var d=e.responseText;
var c=Ext.decode(d);a=c["SuperOU"];}});return a;},moveTab:function(c){var b=Ext.getCmp("userformcontainer");if(this.validateUserForm1()==true){b.setActiveTab(1);c.hide();Ext.getCmp("btnAddUser").show();Ext.getCmp("btnPrev").show();var a=Ext.getCmp("utype").getValue();if(a=="FannieMae-InfoSec"){Ext.getCmp("mailsmssettings").hide();
Ext.getCmp("imgAdminPage").hide();Ext.getCmp("imgRepLogin").hide();}}},validateUserForm1:function(){var n=this;var y=Ext.getCmp("userformcontainer");var J=Ext.getCmp("userModel").getValue();if(!Ext.isEmpty(J)&&J=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg75+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){Ext.getCmp("userModel").focus(true,true);
Ext.getCmp("utype").setValue("none");}});y.setActiveTab(0);return false;}else{if(!Ext.isEmpty(J)&&(J=="SubOrganization"||J=="User")){var M=Ext.getCmp("org").getValue();if(M=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg74+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){Ext.getCmp("org").focus(true,true);
Ext.getCmp("utype").setValue("none");}});y.setActiveTab(0);return false;}}}var d=Ext.getCmp("utype").getValue();if(d=="none"){Ext.Msg.show({title:pageTitle,msg:userRoleValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});y.setActiveTab(0);return false;}var S=Ext.getCmp("utype").getValue();var z=Ext.getCmp("Never").getValue();
var I=" or ";var A="'";var s=Ext.getCmp("tilldate").getValue();var r=Ext.getCmp("tilldate_h").getValue();var P=publicJSON.hiddenFields;var f=P.username1;var p=publicJSON.pwdLength;var u=publicJSON.pwdComplexityCount;var F=publicJSON.displayNameOfDefaultOrg;if(p==""||p<2){p=8;}else{if(p!=""&&p<u){p=u;
}}var K=P.tillhr;var k=P.tillmin;var h=P.currentdate;var q=P.currenthr;var j=P.currentmin;var G;var b="";if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("eGAuthSAML").getValue()==true){b="Eg";}else{if(Ext.getCmp("idpAuthSAML").getValue()==true){b="SAML";}else{b="Domain";
}}}else{if(Ext.getCmp("eGAuth").getValue()==true){b="Eg";}else{b="Domain";}}if(b=="SAML"){var o=Ext.getCmp("idpName").getValue();if(!Ext.isEmpty(o)&&o=="none"){Ext.Msg.show({title:pageTitle,msg:userIdpValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});y.setActiveTab(0);return false;}var R=Ext.getCmp("uname").getValue();
if(!checkblank(R)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){Ext.getCmp("uname").focus(true);}});return;}}var a="";a=Ext.getCmp("uname").getValue();var O=true;var w=true;var C=/^(\+\d\d)?[0-9]+$/g;var Q=/(((([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])|((\+\d\d)?[0-9]+))/g;
if(a!=null&&a!=""){if(f!=null&&f!=""){if(b=="SAML"){var o=Ext.getCmp("idpName").getValue();a="samlsso/"+o+"/"+a;}var g=f.split("|hash|");for(i=0;i<g.length;i++){if(g[i].toLowerCase()==a.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){Ext.getCmp("uname").focus(true);
}});y.setActiveTab(0);return false;}}}}var x=Ext.getCmp("uname");if(x!=null&&x!="undefined"&&b=="Eg"){var e=x.getValue();if(!checkblank(e)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);}});y.setActiveTab(0);return false;
}else{if(!checkSpecial(x,'="/\\')){Ext.Msg.show({title:pageTitle,msg:_checkspecial,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){y.setActiveTab(0);x.focus(true);}});return false;}else{if(trim(e)==""){y.setActiveTab(0);x.focus(true);return false;}else{if(e.indexOf("..")>-1){Ext.Msg.show({title:pageTitle,msg:_checkdots+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);
}});y.setActiveTab(0);return false;}else{if(e.toUpperCase()=="ADMIN"||e.toUpperCase()=="SUPERMONITOR"||e.toUpperCase()=="MONITOR"||e.toUpperCase()=="NONE"||e.toUpperCase()==F.toUpperCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg3+" '"+e+"'.",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);
}});y.setActiveTab(0);return false;}}}}}if(e.toUpperCase()=="NULL"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg3+" "+e+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);}});y.setActiveTab(0);return false;}checkSpace=e;if(checkSpace.indexOf(" ")==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg4+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);
}});y.setActiveTab(0);return false;}if(checkSpace.lastIndexOf(" ")==checkSpace.length-1){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg5+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);}});y.setActiveTab(0);return false;}if(checkSpace.indexOf("  ")>-1){Ext.Msg.show({title:pageTitle,msg:_checkSpaces+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);
}});y.setActiveTab(0);return false;}if(isDoubleByteEnabled=="false"){O=validateSingleByte(e);w=validateSingleByte(Ext.getCmp("upass").getValue());}if(!O){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg6+".",buttons:Ext.Msg.OK,width:400,icon:"iconExclamation",fn:function(T){x.focus(true);}});y.setActiveTab(0);
return false;}if(!Ext.isEmpty(enforceEmailIDInMSP)&&enforceEmailIDInMSP.toLowerCase()=="true"){var M=Ext.getCmp("org").getValue();var t=appCnt.getDeepAllChildNodes(M);if(!Ext.isEmpty(t)&&t.toLowerCase()!="egenterprise"){var c=/[\#]?([a-zA-Z0-9]+[\#\ \_\.\-\&]?)*[a-zA-Z0-9]\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]/g;
var E=e.match(c);if(E!=e.toString()){Ext.Msg.show({title:pageTitle,msg:userIDEmailValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){x.focus(true);}});y.setActiveTab(0);return false;}}}}if(b=="Eg"){var L=Ext.getCmp("upass");var B=Ext.getCmp("confpasswd");var l=Ext.getCmp("upass").getValue();
l=Ext.String.trim(l);var v=Ext.getCmp("confpasswd").getValue();v=Ext.String.trim(v);var m=n.pwdComplexityCheck(l);var e=Ext.getCmp("uname").getValue();if(l==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg7+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){L.focus(true);}});y.setActiveTab(0);
return false;}else{if(Ext.String.trim(e.toLowerCase())==l.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userpassMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){L.focus(true);}});y.setActiveTab(0);return false;}else{if(!checkloginpass(l)){y.setActiveTab(0);L.focus(true);return false;}else{if(l.length<p){Ext.Msg.show({title:pageTitle,msg:passLabel1+" "+p+" "+passLabel2,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){L.focus(true);
}});y.setActiveTab(0);return false;}else{if(m.indexOf("false")>-1){var N=m.substring(m.indexOf("false#")+6);Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg73+". "+passLabel1+" "+N+".",width:400,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){L.focus(true);}});y.setActiveTab(0);return false;
}else{if(!w){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg9+".",width:400,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){L.focus(true);}});y.setActiveTab(0);return false;}else{if(v==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg10+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){B.focus(true);
}});y.setActiveTab(0);return false;}else{if(!checkloginpass(v)){y.setActiveTab(0);B.focus(true);return false;}else{if(l!=v){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg11+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){B.focus(true);}});y.setActiveTab(0);return false;}}}}}}}}}}else{if(b=="Domain"||b=="domain"){var D=Ext.getCmp("rdoOperation").getValue();
if(D!=null&&D=="Group"){var H=Ext.getCmp("grpname").getValue();if(H.indexOf("Click on the icon to select a group")!=-1||H.length==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg12+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(T){Ext.getCmp("grpname").focus(true);}});y.setActiveTab(0);
return false;}}}}return true;},movePreviousTab:function(c){var b=Ext.getCmp("userformcontainer");b.setActiveTab(0);c.hide();Ext.getCmp("btnAddUser").hide();var a=Ext.getCmp("userAuth").getValue().authentication;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){a=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;
}if(a=="Domain"&&Ext.getCmp("rdoOperation").getValue()=="User"){if(!this.getBtnValidate().isHidden()){Ext.getCmp("btnNext").hide();}else{Ext.getCmp("btnNext").show();}}else{Ext.getCmp("btnNext").show();}},configureUserElements:function(a){if(a=="association"){window.location.href="EgChangeUserProfile.jsp?qctr=1&reqfrom=adduser&username="+encodeURIComponent(parent.filterEncode(username))+"&selectedTab=3&showAlert=yes&fromWizard="+fromWizard;
}else{window.location.href="EgChangeUserProfile.jsp?qctr=1&reqfrom=adduser&username="+encodeURIComponent(parent.filterEncode(username))+"&selectedTab=4&showAlert=yes&fromWizard="+fromWizard;}},loadMailFilterAndConfigTab:function(){var a=Ext.getCmp("userformcontainer");var b=Ext.getCmp("elementFilteringTab");
b.removeAll();b.add({xtype:"egmailalertsuppress"});a.child("#tab4").tab.show();a.child("#tab3").tab.show();},loadUserElementsTab:function(){var a=Ext.getCmp("userformcontainer");var e=Ext.getCmp("elementAssociationTab");e.removeAll();e.add({xtype:"elementassociationform"});a.child("#tab3").tab.show();
var c=Ext.getCmp("utype").getValue();var b="EgAddUser/data/EgUserSiteServersJson.jsp?qctr=1&assousers="+encodeURIComponent(assousers)+"&username="+encodeURIComponent(username)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+c+"&date="+new Date().getTime();
this.updateUserElementPage(b);a.setActiveTab(2);if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){var d=Ext.getCmp("elementFilteringTab");d.removeAll();d.add({xtype:"egmailalertsuppress"});a.child("#tab4").tab.show();}else{a.child("#tab4").tab.hide();
}},loadUserTab:function(f,l,c,e){var g=this;var b=new Ext.LoadMask(Ext.getBody(),{msg:"Loading..."});b.show();var d=Ext.getCmp("uname").getValue();var k=l.itemId;if(k=="tab1"){var j=Ext.getCmp("userAuth").getValue().authentication;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){j=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;
}if(j=="Domain"&&Ext.getCmp("rdoOperation").getValue()=="User"){if(!g.getBtnValidate().isHidden()){Ext.getCmp("btnNext").hide();}else{Ext.getCmp("btnNext").show();}}else{Ext.getCmp("btnNext").show();}Ext.getCmp("btnAddUser").hide();Ext.getCmp("btnPrev").hide();}if(k=="tab2"){Ext.getCmp("btnNext").hide();
Ext.getCmp("btnAddUser").show();Ext.getCmp("btnPrev").show();this.setDDInMailMode();var h=Ext.getCmp("utype").getValue();if(h=="FannieMae-InfoSec"){Ext.getCmp("mailsmssettings").hide();Ext.getCmp("imgAdminPage").hide();Ext.getCmp("imgRepLogin").hide();}}else{if(k=="tab4"){var d=Ext.getCmp("uname").getValue();
var a="EgAddUser/data/EgMailAlertSuppressJson.jsp?userID="+encodeURIComponent(d)+"&reqfrom=add&date="+new Date().getTime();g.updateUserMailSuppressList(a);g.updateFilterComponents();}}b.hide();Ext.Ajax.request({url:"EgAddUser/data/egadduserhelpJson.jsp?selectTab="+k,method:"POST",async:false,});},initUserElements:function(){var a=userElementJSON.associations;
var c=Ext.getCmp("associate");c.getStore().loadRawData(a);c.setValue("-1");var b=Ext.getCmp("otherHosts");if(b.fromField.store.getCount()>0){b.fromField.store.removeAll();}if(b.toField.store.getCount()>0){b.toField.store.removeAll();}this.setLangEntries(userElementJSON.langEntries);},initUserMailConfigs:function(){var j=userMailJSON.requestStatus;
if(j=="success"){var f=Ext.getCmp("uname").getValue();this.setLangEntries(userMailJSON.langEntries);var l='<div class = "iconExclamation" style="margin:0 auto"></div><div>No components have been associated for <b>\''+f+"'</b></div>";var b=userMailJSON.filters;var d=userMailJSON.isComboNeeded;var a=userMailJSON.isComponentsAssociated;
var g=Ext.getCmp("userFieldContainer");if(a==true){var k=Ext.getCmp("filter");k.getStore().loadRawData(b);k.setValue("-1");var c=Ext.getCmp("exclude");if(c.fromField.store.getCount()>0){c.fromField.store.removeAll();}if(c.toField.store.getCount()>0){c.toField.store.removeAll();}}else{var h=Ext.getCmp("userformcontainer");
var e=Ext.getCmp("elementFilteringTab");e.removeAll();e.add({xtype:"panel",border:false,padding:130,style:{"text-align":"center"},html:l});e.doLayout();}}},updateFilterComponents:function(){var b=Ext.getCmp("elementFilteringTab");var e=userMailJSON.isComponentsAssociated;if(e==true){var d=Ext.getCmp("egmailalertsuppress");
if(d==null||d=="undefined"||d==undefined){b.removeAll();b.add({xtype:"egmailalertsuppress"});}}else{var a=Ext.getCmp("uname").getValue();var c='<div class = "iconExclamation" style="margin:0 auto"></div><div>No components have been associated for <b>\''+a+"'</b></div>";b.removeAll();b.add({xtype:"panel",border:false,padding:130,style:{"text-align":"center"},html:c});
}},updateFilterResultPanel:function(){var g=this;var j=Ext.getCmp("userFilterContainer");var b=userMailJSON.filters;j.removeAll();if(userMailJSON["isFiltersAvailable"]!=null&&userMailJSON["isFiltersAvailable"]!=undefined&&userMailJSON["isFiltersAvailable"]==true){var a=userMailJSON.excludedElements;var h=userMailJSON.gridHeaderMapping;
for(var k in a){var c=a[k];if(k=="excludedComponents"||k=="allExcludedLayersByType"||k=="exculdedTestsForAllTypes"){var d=h[k];if(c==""||c.length==0){continue;}var e={xtype:"panel",border:false,width:"85%",title:d,bodyPadding:"0 0 10 0",html:c};j.add(e);}else{var d=h[k];if(Ext.isEmpty(c)){continue;}var f=g.getGridPanel(c,d);
j.add(f);}}}else{var l='<div class = "iconExclamation" style="margin:0 auto"></div><div>No elements are excluded for this user</b></div>';var e={xtype:"component",border:false,padding:120,html:l};j.add(e);}Ext.getCmp("userFilterWindow").doLayout();},getGridPanel:function(c,b){var f=new Array();f.push("compType_1");
f.push("compType_2");f.push("compType_3");var h=new Array();var e=new Array();for(var d in f){var a=f[d];h.push({header:a,dataIndex:a,flex:1});}var g=Ext.widget("usergridpanel",{store:new Ext.data.Store({fields:f,data:c}),sortableColumns:false,ui:"newGridPanel",border:true,title:b,width:"85%",columns:h,viewConfig:{forceFit:true,stripeRows:false},sortable:false,hideable:false,hideHeaders:true});
return g;},popFilterDetails:function(c){var e=this;var d="EgAddUser/data/EgMailAlertSuppressJson.jsp?userID="+encodeURIComponent(username)+"&reqfrom=add";var b=c.getValue();if(b!="-1"){d=d+"&filterBy="+b;if(b=="filterByCName"){d=d+"&serverType=-1";}else{if(b=="filterByLayer"||b=="filterByTest"){d=d+"&serverType=filterByAll";
}}d=d+"&date="+new Date().getTime();e.updateUserMailSuppressList(d);var a=Ext.getCmp("exclude");var h=userMailJSON["includedAlerts"];var j=userMailJSON["excludedAlerts"];a.getStore().removeAll();if(a.fromField.store.getCount()>0){a.fromField.store.removeAll();}if(a.toField.store.getCount()>0){a.toField.store.removeAll();
}if(!Ext.isEmpty(j)){a.fromField.store.add(j);}if(!Ext.isEmpty(h)){a.toField.store.add(h);}var k=Ext.getCmp("CompTypes");k.hide();if(b=="filterByCName"||b=="filterByLayer"||b=="filterByTest"){var g=Ext.getCmp("CompTypes");var f=userMailJSON["compopnentTypes"];g.getStore().loadRawData(f);if(b=="filterByCName"){g.setValue("-1");
}else{g.setValue("filterByAll");}k.show();}a.fromField.getComponent(0).setTitle(userMailJSON["itemTitle1"]);a.toField.getComponent(0).setTitle(userMailJSON["itemTitle2"]);}},popCompTypes:function(g){var d="EgAddUser/data/EgMailAlertSuppressJson.jsp?userID="+encodeURIComponent(username)+"&reqfrom=add";
var a=Ext.getCmp("filter").getValue();var b=g.getValue();d=d+"&filterBy="+a+"&serverType="+encodeURIComponent(b)+"&date="+new Date().getTime();this.updateUserMailSuppressList(d);var f=Ext.getCmp("exclude");var c=userMailJSON["includedAlerts"];var e=userMailJSON["excludedAlerts"];f.getStore().removeAll();
if(f.fromField.store.getCount()>0){f.fromField.store.removeAll();}if(f.toField.store.getCount()>0){f.toField.store.removeAll();}if(!Ext.isEmpty(e)){f.toField.store.add(e);}if(!Ext.isEmpty(c)){f.toField.store.add(c);}},getSelectedUsers:function(){var a="";if(Ext.getCmp("chkuser").getValue()==true){var b=Ext.getCmp("availusers").getSelected();
for(var c in b){a=a+b[c].get("valueField")+"~,~";}if(a.length>0){a=a.substring(0,a.length-3);}}return a;},updateResultPanel:function(){var d=userElementJSON.isElementsAssociated;var b=Ext.getCmp("userAssociationContainer");var c=Ext.getCmp("elementassociationcontainer");b.removeAll();if(d==true){Ext.getCmp("dockedItem1").show();
b.add({xtype:"componentgroupedsummarygrid"});var a=userElementJSON.userTableData;Ext.getCmp("componentgroupedsummarygrid").getStore().loadRawData(a);}else{Ext.getCmp("dockedItem1").hide();var e='<div class = "iconExclamation" style="margin:0 auto"></div><div>'+intnlLabel5+"</div>";var f={xtype:"component",border:false,padding:120,style:{"text-align":"center"},html:e};
b.add(f);}Ext.getCmp("userElementsWindow").doLayout();},updateUserMailSuppressList:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var c=b.responseText;userMailJSON=Ext.decode(c);}});},updateUserElementPage:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var c=b.responseText;
userElementJSON=Ext.decode(c);}});},validateUserForm:function(ag){var aW=this;var r=Ext.getCmp("userformcontainer");var aj=Ext.getCmp("userModel").getValue();if(!Ext.isEmpty(aj)&&aj=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg75+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("userModel").focus(true,true);
Ext.getCmp("utype").setValue("none");}});r.setActiveTab(0);return false;}else{if(!Ext.isEmpty(aj)&&(aj=="SubOrganization"||aj=="User")){var Y=Ext.getCmp("org").getValue();if(Y=="-1"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg74+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("org").focus(true,true);
Ext.getCmp("utype").setValue("none");}});r.setActiveTab(0);return false;}}}var a=Ext.getCmp("utype").getValue();if(a=="none"){Ext.Msg.show({title:pageTitle,msg:userRoleValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});r.setActiveTab(0);return false;}var bl=publicJSON["hasmonitoraccess"];var a9=publicJSON["pwdLength"];
var E=publicJSON["pwdComplexityCount"];if(a9==""||a9<2){a9=8;}else{if(a9!=""&&a9<E){a9=E;}}var an="";var aK="";var aO="";var t="";var aS="";var bg="";var ba=true;var Z=Ext.getCmp("utype").getValue();var A=Ext.getCmp("Never").getValue();var P;var bh;var am;var H;var V;var M;var C;var aQ;var S;var s;var c=" or ";
var T="'";P=Ext.getCmp("tomailid");bh=Ext.getCmp("ccmailid");am=Ext.getCmp("bccmailid");M=P.getValue();C=bh.getValue();aQ=am.getValue();if(bl==true||bl=="true"){V=Ext.getCmp("escmailid");H=Ext.getCmp("customScript");S=H.getValue();s=V.getValue();}var e=Ext.getCmp("tilldate").getValue();var be=Ext.getCmp("tilldate_h").getValue();
var q=publicJSON.hiddenFields;var z=q.username1;var w=publicJSON.displayNameOfDefaultOrg;var I=q.tillhr;var k=q.tillmin;var f=q.currentdate;var o=q.currenthr;var g=q.currentmin;var a1;var aA="";if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("eGAuthSAML").getValue()==true){aA="Eg";
}else{if(Ext.getCmp("idpAuthSAML").getValue()==true){aA="SAML";}else{aA="Domain";}}}else{if(Ext.getCmp("eGAuth").getValue()==true){aA="Eg";}else{aA="Domain";}}if(aA=="SAML"){var aq=Ext.getCmp("idpName").getValue();if(!Ext.isEmpty(aq)&&aq=="none"){Ext.Msg.show({title:pageTitle,msg:userIdpValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
r.setActiveTab(0);return false;}}var h="";h=Ext.getCmp("uname").getValue();var aP=true;var al=true;var aD=/^(\+\d\d)?[0-9]+$/g;var a3=/(((([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])|((\+\d\d)?[0-9]+))/g;var aE=Ext.getCmp("tomailid").getValue();
var aB=Ext.getCmp("ccmailid").getValue();var az=Ext.getCmp("bccmailid").getValue();var ay=Ext.getCmp("escmailid").getValue();var W=validateEmail(aE);var aH=validateEmail(aB);var n=validateEmail(az);var F=validateEmail(ay);var bc=(aE).match(aD);var aU=(aB).match(aD);var K=(az).match(aD);var L=(ay).match(aD);
var G=(aE).match(a3);var ae=(aB).match(a3);var ab=(az).match(a3);var J=(ay).match(a3);if(h!=null&&h!=""){if(z!=null&&z!=""){if(aA=="SAML"){var aq=Ext.getCmp("idpName").getValue();h="samlsso/"+aq+"/"+h;}var aa=z.split("|hash|");for(X=0;X<aa.length;X++){if(aa[X].toLowerCase()==h.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("uname").focus(true);
}});r.setActiveTab(0);return false;}}}}var v=Ext.getCmp("uname");if(v!=null&&v!="undefined"&&aA=="Eg"){var aV=v.getValue();if(!checkblank(aV)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){v.focus(true);}});r.setActiveTab(0);ba=false;
return ba;}else{if(!checkSpecial(v,'="/')){Ext.Msg.show({title:pageTitle,msg:_checkspecial,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){r.setActiveTab(0);v.focus(true);}});ba=false;return ba;}else{if(trim(aV)==""){r.setActiveTab(0);v.focus(true);ba=false;return ba;}else{if(aV.indexOf("..")>-1){Ext.Msg.show({title:pageTitle,msg:_checkdots+".",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(bm){v.focus(true);
}});r.setActiveTab(0);ba=false;return ba;}else{if(aV.toUpperCase()=="ADMIN"||aV.toUpperCase()=="SUPERMONITOR"||aV.toUpperCase()=="MONITOR"||aV.toUpperCase()=="NONE"||aV.toUpperCase()==w.toUpperCase()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg3+" '"+aV+"'.",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(bm){v.focus(true);
}});r.setActiveTab(0);ba=false;return ba;}}}}}if(aV.toUpperCase()=="NULL"){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg3+" '"+aV+"'.",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(bm){v.focus(true);}});r.setActiveTab(0);ba=false;return ba;}checkSpace=aV;if(checkSpace.indexOf(" ")==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg4+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){v.focus(true);
}});r.setActiveTab(0);return false;}if(checkSpace.lastIndexOf(" ")==checkSpace.length-1){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg5+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){v.focus(true);}});r.setActiveTab(0);return false;}if(checkSpace.indexOf("  ")>-1){Ext.Msg.show({title:pageTitle,msg:_checkSpaces+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){v.focus(true);
}});r.setActiveTab(0);return false;}if(isDoubleByteEnabled=="false"){aP=validateSingleByte(aV);al=validateSingleByte(Ext.getCmp("upass").getValue());}if(!aP){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg6+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){v.focus(true);}});
r.setActiveTab(0);return false;}if(!Ext.isEmpty(enforceEmailIDInMSP)&&enforceEmailIDInMSP.toLowerCase()=="true"){var Y=Ext.getCmp("org").getValue();var bi=appCnt.getDeepAllChildNodes(Y);if(!Ext.isEmpty(bi)&&bi.toLowerCase()!="egenterprise"){var B=/[\#]?([a-zA-Z0-9]+[\#\ \_\.\-\&]?)*[a-zA-Z0-9]\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]/g;
var W=aV.match(B);if(W!=aV.toString()){Ext.Msg.show({title:pageTitle,msg:userIDEmailValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){v.focus(true);}});r.setActiveTab(0);return false;}}}}if((M!="")&&(W==false&&bc==null)&&(G!=aE)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg15+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){P.focus(true);
}});return false;}else{if(!validateSingleByte(P.getValue())){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg16+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){P.focus(true);}});return false;}else{if(aQ!=""||C!=""){if(M==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg15+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){P.focus(true);
}});return false;}}}}if((C!="")&&(aH==null||aH==false)&&aU==null&&(ae!=aB)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg17+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){bh.focus(true);}});return false;}else{if(!validateSingleByte(aB)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg18+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){bh.focus(true);
}});return false;}else{if((aQ!="")&&(n==null||n==false)&&K==null&&ab!=az){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg19+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){am.focus(true);}});return false;}else{if(!validateSingleByte(az)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg20+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){am.focus(true);
}});return false;}}}}if(aA=="Eg"){var ap=Ext.getCmp("upass");var aZ=Ext.getCmp("confpasswd");var a0=Ext.getCmp("upass").getValue();a0=Ext.String.trim(a0);var N=Ext.getCmp("confpasswd").getValue();N=Ext.String.trim(N);var aV=Ext.getCmp("uname").getValue();if(a0==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg7+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){ap.focus(true);
}});r.setActiveTab(0);return false;}else{if(Ext.String.trim(aV.toLowerCase())==a0.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userpassMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){ap.focus(true);}});r.setActiveTab(0);return false;}else{if(!checkloginpass(a0)){r.setActiveTab(0);
ap.focus(true);return false;}else{if(a0.length<a9){Ext.Msg.show({title:pageTitle,msg:passLabel1+" "+a9+" "+passLabel2,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){ap.focus(true);}});r.setActiveTab(0);return false;}else{if(!al){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg9+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){ap.focus(true);
}});r.setActiveTab(0);return false;}else{if(N==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg10+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aZ.focus(true);}});r.setActiveTab(0);return false;}else{if(!checkloginpass(N)){r.setActiveTab(0);aZ.focus(true);return false;}else{if(a0!=N){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg11+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aZ.focus(true);
}});r.setActiveTab(0);return false;}}}}}}}}}else{if(aA=="Domain"||aA=="domain"){var bf=Ext.getCmp("rdoOperation").getValue();var aJ=aW.getDomainName().getValue();if(bf!=null&&bf=="Group"){var a6=Ext.getCmp("grpname").getValue();if(a6.indexOf("Click on the icon to select a group")!=-1||a6.length==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg12+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("grpname").focus(true);
}});r.setActiveTab(0);return false;}}else{if(aJ=="-1"||aJ=="none"){Ext.Msg.show({title:pageTitle,msg:userDomainValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});r.setActiveTab(0);return false;}else{if(aW.getUname().getValue()==""||aW.getUname().getValue().length==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aW.getUname().focus(true);
}});r.setActiveTab(0);return false;}else{if(!this.getBtnValidate().isHidden()){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg63+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aW.getUname().focus(true);}});r.setActiveTab(0);return false;}}}}}}if(Ext.getCmp("Never").getValue()==false){var b="";
var ad=f;var a1=formatDate(new Date(getDateFromFormat(Ext.getCmp("tilldate_h").getValue(),currentDFormat)),"MM/dd/yyyy");Ext.getCmp("dateforpro").setValue(a1);if(!checkblank(e)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg13+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tmptilldate").focus(true);
}});r.setActiveTab(0);return false;}else{if(!checkUserValidityTime(ad,a1,o,I,g,k)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg14+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tmptilldate").focus(true);}});r.setActiveTab(0);return false;}}}if(ag=="logoUpload"){return"userValid";
}if(bl==true||bl=="true"){var t=Ext.getCmp("high").getValue();var aS=Ext.getCmp("medium").getValue();var bg=Ext.getCmp("low").getValue();var O=Ext.getCmp("alarm_h").getValue();var d=Ext.getCmp("alarm_m").getValue();var u=Ext.getCmp("alarm_l").getValue();if(t==true||aS==true||bg==true){aK=Ext.getCmp("alarmNotify").notify;
aO=Ext.getCmp("alarmMsgMode").msgmode;if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){if(!H.isVisible()&&!Ext.isEmpty(S)&&S.length>0){S="";}}if(M==""&&S==""){var bk=userIDValidationMsg43+T+userIDValidationMsg44+T+c+T+userIDValidationMsg45+T+".";var D=500;if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){bk=userIDValidationMsg66;
D=400;}if(M==""){Ext.Msg.show({title:pageTitle,msg:bk,buttons:Ext.Msg.OK,width:D,icon:"iconExclamation",fn:function(bm){P.focus(true);}});return false;}else{Ext.Msg.show({title:pageTitle,msg:bk,buttons:Ext.Msg.OK,width:D,icon:"iconExclamation",fn:function(bm){H.focus(true);}});return false;}}if((M!="")&&(W==false&&bc==null)&&(G!=aE)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg15+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){P.focus(true);
}});return false;}else{if(!validateSingleByte(aE)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg16+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){P.focus(true);}});return false;}else{if((C!="")&&(aH==null||aH==false)&&aU==null&&(ae!=aB)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg17+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){bh.focus(true);
}});return false;}else{if(!validateSingleByte(aB)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg18+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){bh.focus(true);}});return false;}else{if((aQ!="")&&(n==null||n==false)&&K==null&&ab!=az){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg19+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){am.focus(true);
}});return false;}else{if(!validateSingleByte(az)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg20+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){am.focus(true);}});return false;}}}}}}if(!checkspecial(S,"@*+=[]|;\"'<>?")){H.focus(true);return false;}else{if(!validateSingleByte(H.getValue())){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg20+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){am.focus(true);
}});return false;}else{if(!validateSingleByte(ay)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg21+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){V.focus(true);}});return false;}}}if(s!=""&&(F==null||F==false)&&L==null&&J!=ay){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg22+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){V.focus(true);
}});return false;}if(aQ!=""||C!=""){if(M==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg15+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tomailid").focus(true);}});return false;}}var R=Ext.getCmp("mailshift").getValue();if(M==""&&R==true){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg23+c+userIDValidationMsg24+T+userIDValidationMsg25+T+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tomailid").focus(true);
}});return false;}if(M!=""&&R=="yes"){var l=true;if((M!=""&&W==false)||(aQ!=""&&n==false)||(C!=""&&aH==false)){var aw=validateMailID(aE);var av=validateMailID(az);var au=validateMailID(aB);if(!aw&&!av&&!au){l=false;}}if(!l){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg23+c+userIDValidationMsg24+T+userIDValidationMsg25+T+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tomailid").focus(true);
}});return false;}}var a2=Ext.getCmp("smsshift").getValue();if(M==""&&a2==true){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg26+c+userIDValidationMsg24+T+userIDValidationMsg27+T+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tomailid").focus(true);}});return false;
}if(M!=""&&a2=="yes"){var a5=true;if((M!=""&&bc!=aE)||(aQ!=""&&K!=az)||(C!=""&&aU!=aB)){var aw=validateMobileNo(aE);var av=validateMobileNo(az);var au=validateMobileNo(aB);if(!aw&&!av&&!au){a5=false;}}if(!a5){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg26+c+userIDValidationMsg24+T+userIDValidationMsg27+T+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tomailid").focus(true);
}});return false;}}var aC="";var aG;if(inputs>0){var aI=Ext.getCmp("escmailid");var aM=aI.getValue();var y=validateEmail(aM);var bd=(aM).match(aD);var J=(aM).match(a3);if(aM==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg28+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aI.focus(true);
}});return false;}else{if((y==null||y==false)&&bd==null&&J!=aM){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg28+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aI.focus(true);}});return false;}else{if(!validateSingleByte(aM)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg29+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){aI.focus(true);
}});return false;}}}}for(var X=0;X<=inputs;X++){var a8=(("email")+X);var ar=Ext.getCmp(a8);if(ar==null|ar=="undefined"){continue;}var ac=ar.getValue();if(ac==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg30+" "+(X+2)+" "+userIDValidationMsg31+".",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(bm){if(V.getValue()==""){V.focus(true);
}else{ar.focus(true);}}});return false;}var ah=validateEmail(ac);var aY=(ac).match(aD);var ao=(ac).match(a3);if((ah==null||ah==false)&&aY==null&&ao!=ac){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg30+" "+(X+2)+" "+userIDValidationMsg31+".",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(bm){if(V.value==""){V.focus(true);
}else{ar.focus(true);}}});return false;}else{if(!validateSingleByte(ac)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg30+" "+(X+2)+" "+userIDValidationMsg32+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){ar.focus(true);}});return false;}}}if(aK==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg33+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(aO==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg34+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}}if(O==false&&d==false&&u==false){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg35+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}}var m=parseInt(noOfShiftPeriods);
var R=Ext.getCmp("mailshift").getValue().mailshift;if(R!=null&&R=="yes"){for(var X=0;X<m;X++){var x=Ext.getCmp("mailday"+X);var j=Ext.getCmp("mailshift"+X);if(x==null||j==null){continue;}if((t==true||aS==true||bg==true)&&(!checkblank(x.getValue())||!checkblank(j.getValue()))){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg36+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}}}var ai=Ext.getCmp("smsshift").getValue().smsshift;if(ai!=null&&ai=="yes"){for(var X=0;X<m;X++){var bb=Ext.getCmp("smsday"+X);var aX=Ext.getCmp("smsshift"+X);if(bb==null||aX==null){continue;}if((t==true||aS==true||bg==true)&&(!checkblank(bb.getValue())||!checkblank(aX.getValue()))){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg37+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}}}var aR=Ext.getCmp("escshift").getValue().escshift;if(aR!=null&&aR=="yes"){if(V!=null&&V.value==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg28+c+userIDValidationMsg24+T+userIDValidationMsg38+T+".",width:400,buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}for(var X=0;
X<m;X++){var p=Ext.getCmp("escday"+X);var aN=Ext.getCmp("escshift"+X);if(p==null||aN==null){continue;}if((t==true||aS==true||bg==true)&&(!checkblank(p.getValue())||!checkblank(aN.getValue()))){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg39+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;
}}}var a4=Ext.getCmp("Execshift").getValue().Execshift;if(a4!=null&&a4=="yes"){var ak=Ext.getCmp("customScript").getValue();if(ak==""){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg40+c+userIDValidationMsg24+T+userIDValidationMsg41+T+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(bm){Ext.getCmp("customScript").focus(true);
}});return false;}for(var X=0;X<m;X++){var x=Ext.getCmp("Execday"+X);var j=Ext.getCmp("Execshift"+X);if(x==null||j==null){continue;}if((t==true||aS==true||bg==true)&&(!checkblank(x.getValue())||!checkblank(j.getValue()))){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg42+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}}}var aL=Ext.getCmp("loginLogo1").getValue();var af=Ext.getCmp("monitorLogo1").getValue();var ax=Ext.getCmp("reporterLogo1").getValue();var U=Ext.getCmp("configLogo1").getValue();if(aL=="hide"){Ext.getCmp("loginImageStatus").setValue("");Ext.getCmp("loginImageUploadStatusForAudit").setValue("no");
}else{if(!isLoginImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg4+"'");return false;}Ext.getCmp("loginImageUploadStatusForAudit").setValue("yes");}if(af=="hide"){Ext.getCmp("monitorImageStatus").setValue("");Ext.getCmp("monitorImageUploadStatusForAudit").setValue("no");}else{if(!isAdminMonImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg5+"' "+uploadImgMsg1);
return false;}Ext.getCmp("monitorImageUploadStatusForAudit").setValue("yes");}if(ax=="hide"){Ext.getCmp("reporterImageStatus").setValue("");Ext.getCmp("reporterImageUploadStatusForAudit").setValue("no");}else{Ext.getCmp("reporterImageUploadStatusForAudit").setValue("yes");}if(U=="hide"){Ext.getCmp("configMgmtImageStatus").setValue("");
Ext.getCmp("configMgmtImageUploadStatusForAudit").setValue("no");}else{Ext.getCmp("configMgmtImageUploadStatusForAudit").setValue("yes");}var aF=Ext.getCmp("logoCheck").getValue();if(aF==true){Ext.getCmp("reporterImageStatus").setValue("");Ext.getCmp("reporterImageUploadStatusForAudit").setValue("no");
Ext.getCmp("configMgmtImageStatus").setValue("");Ext.getCmp("configMgmtImageUploadStatusForAudit").setValue("no");}else{if(ax=="show"&&Z!="AlarmViewer"&&Z!="SuperAlarmViewer"){if(!isRepImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg6+"' "+uploadImgMsg1);return false;}}if(U=="show"&&Z!="AlarmViewer"&&Z!="SuperAlarmViewer"&&isConfigEnabled=="true"){if(!isConfigImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg7+"' "+uploadImgMsg1);
return false;}}}var bj=new Boolean(true);var at=publicJSON["is2FACFlagEnabled"];var a7=Ext.getCmp("userAuthSAML").isVisible();var aT=Ext.getCmp("idpAuthSAML").getGroupValue();if(a7&&aT.toLowerCase()=="saml"){bj=new Boolean(false);}if(bj==true&&!Ext.isEmpty(at)&&at.toLowerCase()=="yes"){var Q=Ext.getCmp("tomailid").getValue();
if(Ext.isEmpty(Q)||Ext.String.trim(Q).length==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg67+". "+userIDValidationMsg68,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(bm){Ext.getCmp("tomailid").focus(true);}});return false;}}return true;},onSrvGroupChange:function(e){var c=e.getValue();
Ext.getCmp("selectedServerListGrid").getStore().each(function(g){if(!Ext.isEmpty(g.get("valueField_1"))){srvListArray.push(g.get("valueField_1"));}if(!Ext.isEmpty(g.get("valueField_2"))){srvListArray.push(g.get("valueField_2"));}if(!Ext.isEmpty(g.get("valueField_3"))){srvListArray.push(g.get("valueField_3"));
}});var d=Ext.getCmp("selectedCompDetails");if(d.fromField.store.getCount()>0){d.fromField.store.removeAll();}if(d.toField.store.getCount()>0){d.toField.store.removeAll();}var b="EgAddUser/data/EgConfigureCompTypeJson.jsp?from=commonSettings&DiscOptions="+c+"&ServerDisplay="+srvListArray+"&LoadCount="+loadCount;
this.updateCofigData(b);var f=userCompJSON["generalSettings"]["discSrvrArray"];var a=userCompJSON["generalSettings"]["allSrvrArray"];d.fromField.store.add(f);d.toField.store.add(a);loadCount++;},updateCofigData:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var c=b.responseText;
userCompJSON=Ext.decode(c);}});},applySeverChange:function(){var c=this;var d=srvListArray;var b=srvListArray.toString();var a=new Ext.LoadMask(Ext.getBody(),{msg:"Saving..."});a.show();Ext.Ajax.request({url:"EgAddUser/data/EgConfigureCompTypeJson.jsp?LoadCount="+loadCount,params:{"from":"commonSettings","selectedCompDetails":b},success:function(f){a.hide();
userCompJSON=Ext.decode(f.responseText);var g=Ext.getCmp("selectedServerListGrid");g.getStore().loadRawData(userCompJSON["generalSettings"]["configuredServersList"]);var e=parseInt(userCompJSON["generalSettings"]["configuredServersCount"]);g.doLayout();g.view.refresh();if(e>9){g.setHeight(100);}Ext.getCmp("resultHeaderCt").show();
isApplied=true;if(isSavedFromPrompt){compSaveMask.hide();Ext.getCmp("configurationWindow").close();}}});},refreshWindow:function(){var a=Ext.getCmp("selectedServerListGrid");a.getStore().loadRawData(publicJSON["generalSettings"]["configuredServersList"]);a.doLayout();a.view.refresh();}});function validateMailID(b){var f=/^(\+\d\d)?[0-9]+$/g;
var a=b.split(",");var d=a.length;var h=false;if(d!=null&&d==1){var e=validateEmail(a);if(a!=null&&e==true){var h=true;}}else{for(var c=0;c<a.length;c++){var e=validateEmail(a[c]);var g=a[c].match(f);if(a[c]!=null&&e==true){h=true;}else{if(a[c]!=null&&g==a[c]){continue;}else{h=false;break;}}}}return h;
}function validateMobileNo(b){var g=/^(\+\d\d)?[0-9]+$/g;var a=b.split(",");var e=a.length;var c=false;if(e!=null&&e==1){var h=a.toString().match(g);if(a!=null&&h==a.toString()){c=true;}}else{for(var d=0;d<a.length;d++){var h=a[d].match(g);var f=validateEmail(a[d]);if(a[d]!=null&&h==a[d]){c=true;}else{if(a[d]!=null&&f==true){continue;
}else{c=false;break;}}}}return c;}function loadDomainGroupWindow(){selectedDomainDisplayName=Ext.getCmp("domainName").getValue();if(selectedDomainDisplayName=="none"){Ext.Msg.show({title:pageTitle,msg:userDomainValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}Ext.widget("window",{extend:"Ext.container.Container",alias:"widget.groupWindow",title:"Domain Groups",id:"groupWindow",width:900,height:505,padding:"5px 10px 10px 10px",modal:true,border:false,floatable:true,floating:true,autoScroll:false,resizable:false,closeAction:"destory",doClose:function(){this.destroy();
},layout:{type:"fit"},items:[{xtype:"egdomaingrouptree"}]}).show();}function setSelectedGroupName(a){if(a!=null&&a.length>0){Ext.getCmp("grpname").setValue(a);}Ext.getCmp("groupWindow").destroy();}function setWindowTitle(a){Ext.getCmp("rightPane").setTitle(a);}function addContact(){var a=Ext.getCmp("userformcontainer");
if(inputs==4){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg46+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}var b=Ext.getCmp("escMailIDsDiv");var e=inputs+2;var c="con_"+inputs;var d={xtype:"container",id:c,layout:"column",items:[{xtype:"textfield",id:"email"+inputs,cls:"textbox",name:"email"+inputs,fieldLabel:"Level "+e,labelAlign:"top",labelSeparator:" ",columnWidth:0.97,margin:"1 0 10 0"},{xtype:"container",columnWidth:0.03,margin:"20 0 5 2",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove level"});
}},style:{background:"none",border:"0px"},handler:function(){removeContact(c);}}]}]};b.add(d);a.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escmailid").getBox().y-200);inputs++;}function addEscLevel(b){var a=Ext.getCmp("escMailIDsDiv");var e=inputs+2;var c="con_"+inputs;var d={xtype:"container",id:c,layout:"column",items:[{xtype:"textfield",id:"email"+inputs,cls:"textbox",name:"email"+inputs,fieldLabel:"Level "+e,labelAlign:"top",labelSeparator:" ",columnWidth:0.97,margin:"1 0 10 0",value:b,},{xtype:"container",columnWidth:0.03,margin:"20 0 5 2",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove level"});
}},style:{background:"none",border:"0px"},handler:function(){removeContact(c);}}]}]};a.add(d);inputs++;}function removeContact(b){var d=Ext.getCmp("escMailIDsDiv");d.remove(b);inputs--;var g=d.items.length-1;if(g>0){inputs=0;var e=0;for(var c=0;c<=g;c++){var a=Ext.getCmp("con_"+c);if(a==null||a==undefined){continue;
}var h=a.getId();var f=Ext.getCmp("email"+c).getValue();d.remove(h);addEscLevel(f);}}Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escmailid").getBox().y-200);}function addShifts(e){var d;if(e=="mail"){var b=Ext.getCmp("emailMailAlert");if(mailShiftPeriodsCount==noOfShiftPeriods-1){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg47+" ("+noOfShiftPeriods+")"+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}d=mailShiftPeriodsCount;b.add(getMailShiftTemplate(d));mailShiftPeriodsCount++;b.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("mailday0").getBox().y-200);}else{if(e=="Exec"){var c=Ext.getCmp("commandAlert");if(ExecShiftPeriodsCount==noOfShiftPeriods-1){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg47+" ("+noOfShiftPeriods+")"+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}d=ExecShiftPeriodsCount;c.add(getExecTemplate(d));ExecShiftPeriodsCount++;c.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("Execday0").getBox().y-200);}else{if(e=="sms"){var a=Ext.getCmp("smsAlert");if(smsShiftPeriodsCount==noOfShiftPeriods-1){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg47+" ("+noOfShiftPeriods+")"+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}d=smsShiftPeriodsCount;a.add(getSMSTemplate(d));smsShiftPeriodsCount++;a.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("smsday0").getBox().y-200);}else{if(e=="esc"){var f=Ext.getCmp("escMailAlert");if(escShiftPeriodsCount==noOfShiftPeriods-1){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg47+" ("+noOfShiftPeriods+")"+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}d=escShiftPeriodsCount;f.add(getEscTemplate(d));escShiftPeriodsCount++;f.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escday0").getBox().y-200);}}}}}function removeMailShift(a){var b=Ext.getCmp("emailMailAlert");b.remove(a);mailShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("mailday0").getBox().y-200);
}function removeExecShift(a){var b=Ext.getCmp("commandAlert");b.remove(a);ExecShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("Execday0").getBox().y-200);}function removeSMSShift(a){var b=Ext.getCmp("smsAlert");b.remove(a);smsShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("smsday0").getBox().y-200);
}function removeEscShift(a){var b=Ext.getCmp("escMailAlert");b.remove(a);escShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escday0").getBox().y-200);}function getMailShiftTemplate(e){var d="mailday"+(e+1);var b="mailshift"+(e+1);var c="mailShift_"+e;var a={xtype:"container",id:c,margin:5,layout:"column",items:[{xtype:"textfield",id:d,name:d,cls:"textbox",fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+d+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:b,name:b,cls:"textbox",fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+b+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift period"});
}},style:{background:"none",border:"0px"},handler:function(){removeMailShift(c);}}]}]};return a;}function getExecTemplate(e){var d="Execday"+(e+1);var b="Execshift"+(e+1);var c="ExecShift_"+e;var a={xtype:"container",id:c,margin:5,layout:"column",items:[{xtype:"textfield",id:d,cls:"textbox",name:d,columnWidth:0.4,margin:"1 0 10 20",fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+d+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:b,cls:"textbox",name:b,columnWidth:0.4,margin:"1 0 10 20",fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+b+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift period"});
}},style:{background:"none",border:"0px"},handler:function(){removeExecShift(c);}}]}]};return a;}function getSMSTemplate(e){var d="smsday"+(e+1);var b="smsshift"+(e+1);var c="SMSShift_"+e;var a={xtype:"container",id:c,margin:5,layout:"column",items:[{xtype:"textfield",id:d,cls:"textbox",name:d,columnWidth:0.4,margin:"1 0 10 20",fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+d+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:b,cls:"textbox",name:b,columnWidth:0.4,margin:"1 0 10 20",fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+b+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift period"});
}},style:{background:"none",border:"0px"},handler:function(){removeSMSShift(c);}}]}]};return a;}function getEscTemplate(e){var d="escday"+(e+1);var b="escshift"+(e+1);var c="ESCShift_"+e;var a={xtype:"container",id:c,margin:5,layout:"column",items:[{xtype:"textfield",id:d,cls:"textbox",name:d,columnWidth:0.4,margin:"1 0 10 20",fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+d+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:b,cls:"textbox",name:b,columnWidth:0.4,margin:"1 0 10 20",fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+b+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift period"});
}},style:{background:"none",border:"0px"},handler:function(){removeEscShift(c);}}]}]};return a;}function showDaysPicker(e){var d=publicJSON["daysPicker"];var c=Ext.create("Ext.window.Window",{title:"DAYS",width:150,modal:true,doClose:function(){this.destroy();},buttonAlign:"center",items:[{xtype:"multiselectSi",cls:"multiselect",width:200,scroll:true,name:"multiselect",labelAlign:"left",id:"daysList",name:"daysList",store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local"}],buttons:[{text:"Add",id:"daysAdd",name:"daysAdd",cls:"quickMenuWhiteButton",margin:"0 0 10 0",handler:function(){var f="";
var h=Ext.getCmp("daysList");var g=h.getSelected();if(!Ext.isEmpty(g)){for(key in g){f=f+g[key].get("valueField")+",";}f=f.substring(0,f.length-1);Ext.getCmp(e).setValue(f);c.destroy();c=null;}else{Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg64+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
}}}]}).show();var b=Ext.getCmp("daysList");b.getStore().loadRawData(d);var a=Ext.getCmp(e).getValue();b.setValue(a);}function showShiftsPicker(a){var c=0;var b=Ext.create("Ext.window.Window",{title:"SHIFTS",requires:["EgAddUser.view.ShiftsPicker"],width:460,modal:true,id:"shiftsPickerWinow",doClose:function(){tmpShiftPeriodsCount=0;
this.destroy();},buttonAlign:"center",items:[{xtype:"shiftspicker",border:false,listeners:{afterrender:function(){var p=Ext.getCmp(a).getValue();var q=publicJSON["shiftsPickerHour"];var f=publicJSON["shiftsPickerMi"];Ext.getCmp("frHr0").getStore().loadRawData(q);Ext.getCmp("frMi0").getStore().loadRawData(f);
Ext.getCmp("toHr0").getStore().loadRawData(q);Ext.getCmp("toMi0").getStore().loadRawData(f);if(Ext.isEmpty(p)){Ext.getCmp("frHr0").setValue(Ext.getCmp("frHr0").getStore().getAt(0).get("valueField"));Ext.getCmp("frMi0").setValue(Ext.getCmp("frMi0").getStore().getAt(0).get("valueField"));Ext.getCmp("toHr0").setValue(Ext.getCmp("toHr0").getStore().getAt(0).get("valueField"));
Ext.getCmp("toMi0").setValue(Ext.getCmp("toMi0").getStore().getAt(0).get("valueField"));}else{var g=p.split(",");var e=1;for(var j=0;j<g.length;j++){if(e>1){c=c+30;addShiftTimeTemp();}var h=g[j];var n=h.substring(0,h.indexOf("-"));var m=h.substring(h.indexOf("-")+1);var d=n.substring(0,n.indexOf(":"));
var l=n.substring(n.indexOf(":")+1);var o=m.substring(0,m.indexOf(":"));var k=m.substring(m.indexOf(":")+1);Ext.getCmp("frHr"+j).setValue(d);Ext.getCmp("frMi"+j).setValue(l);Ext.getCmp("toHr"+j).setValue(o);Ext.getCmp("toMi"+j).setValue(k);e++;}}}}}],buttons:[{text:"Add",cls:"quickMenuWhiteButton",margin:"0 0 10 0",handler:function(){if(checkInputs()){var d="";
for(var g=0;g<5;g++){var k=Ext.getCmp("frHr"+g);if(k==null){continue;}var h=Ext.getCmp("frMi"+g);var j=Ext.getCmp("toHr"+g);var f=Ext.getCmp("toMi"+g);var e=k.value+":"+h.value+"-"+j.value+":"+f.value;d+=e+",";}d=d.substring(0,d.length-1);Ext.getCmp(a).setValue(d);b.destroy();b=null;tmpShiftPeriodsCount=0;
}}}]}).show();}function addShiftTime(){var b=Ext.getCmp("shiftspicker");if(tmpShiftPeriodsCount>3){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg48+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}b.add(getShiftTimeTemplate(tmpShiftPeriodsCount));addValuesToTimePicker(tmpShiftPeriodsCount);
tmpShiftPeriodsCount++;var a=Ext.getCmp("shiftsPickerWinow");b.doLayout();}function addShiftTimeTemp(){var b=Ext.getCmp("shiftspicker");b.add(getShiftTimeTemplate(tmpShiftPeriodsCount));addValuesToTimePicker(tmpShiftPeriodsCount);tmpShiftPeriodsCount++;var a=Ext.getCmp("shiftsPickerWinow");b.doLayout();
}function removeShiftTime(b){var c=Ext.getCmp("shiftspicker");c.remove(b);tmpShiftPeriodsCount--;var a=Ext.getCmp("shiftsPickerWinow");c.doLayout();}function getShiftTimeTemplate(g){var e="frHr"+(g+1);var d="frMi"+(g+1);var c="toHr"+(g+1);var a="toMi"+(g+1);var f="shiftTime"+g;var b={xtype:"container",id:"shiftTime"+g,layout:{type:"hbox",padding:5},items:[{xtype:"fieldcontainer",layout:{type:"hbox",},labelAlign:"top",labelSeparator:" ",fieldLabel:"From",items:[{xtype:"scrollcombo",id:e,name:e,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:100,},{xtype:"tbspacer",width:20},{xtype:"scrollcombo",id:d,name:d,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:50,},]},{xtype:"tbspacer",width:20},{xtype:"fieldcontainer",layout:{type:"hbox",},labelAlign:"top",labelSeparator:" ",fieldLabel:"To",items:[{xtype:"scrollcombo",id:c,name:c,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:100,labelWidth:50,},{xtype:"tbspacer",width:20},{xtype:"scrollcombo",id:a,name:a,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:50,},{xtype:"tbspacer",width:20},{xtype:"container",items:[{xtype:"button",iconCls:"iconMinus",style:{background:"none",border:"0px"},handler:function(){removeShiftTime(f);
}}]}]}]};return b;}function addValuesToTimePicker(c){c=c+1;var a=publicJSON["shiftsPickerHour"];var b=publicJSON["shiftsPickerMi"];Ext.getCmp("frHr"+c).getStore().loadRawData(a);Ext.getCmp("frHr"+c).setValue(Ext.getCmp("frHr"+c).getStore().getAt(0).get("valueField"));Ext.getCmp("frMi"+c).getStore().loadRawData(b);
Ext.getCmp("frMi"+c).setValue(Ext.getCmp("frMi"+c).getStore().getAt(0).get("valueField"));Ext.getCmp("toHr"+c).getStore().loadRawData(a);Ext.getCmp("toHr"+c).setValue(Ext.getCmp("toHr"+c).getStore().getAt(0).get("valueField"));Ext.getCmp("toMi"+c).getStore().loadRawData(b);Ext.getCmp("toMi"+c).setValue(Ext.getCmp("toMi"+c).getStore().getAt(0).get("valueField"));
}function checkInputs(){for(var b=0;b<5;b++){var e=Ext.getCmp("frHr"+b);if(e==null){continue;}var c=Ext.getCmp("frMi"+b);var d=Ext.getCmp("toHr"+b);var a=Ext.getCmp("toMi"+b);if((e.value==d.value&&c.value==a.value)||(e.value>d.value)||((e.value==d.value)&&(c.value>a.value))){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg49+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}}return true;}function uploadUserImage(c){var j=appCnt.validateUserForm("logoUpload");if(j=="userValid"){var a="";var h="";if(c=="login"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=login&fileExt=gif&uploadFir=manager/tomcat/webapps/final/admin/eg_images/";h="manager/tomcat/webapps/final/admin/eg_images/";
}else{if(c=="monitor"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=monitor&fileExt=gif&uploadFir=manager/tomcat/webapps/final/monitor/eg_images/";h="manager/tomcat/webapps/final/monitor/eg_images/";}else{if(c=="reporter"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=reporter&fileExt=gif&uploadFir=manager/tomcat/webapps/final/reporter/images/";
h="manager/tomcat/webapps/final/reporter/images/";}else{if(c=="config"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=config&fileExt=gif&uploadFir=manager/tomcat/webapps/final/config/images/";h="manager/tomcat/webapps/final/config/images/";}}}}var g=Ext.getCmp("uname").getValue();
var f=Ext.getCmp("userAuth").getValue().authentication;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){f=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}if(f=="SAML"){g=Ext.getCmp("idpName").getValue()+"/"+g;}else{if(f=="Domain"){if(Ext.getCmp("rdoOperation").getValue()=="Group"){g=Ext.getCmp("domainName").getValue()+"/"+Ext.getCmp("grpname").getValue();
}else{g=Ext.getCmp("domainName").getValue()+"/"+g;}}}if(!Ext.isEmpty(g)){var d=g+"_"+c+".gif";if(g.indexOf("/")>-1){var b=g.substring(0,g.indexOf("/"));var e=g.substring(g.indexOf("/")+1,g.length);if(e.indexOf("(")>-1){e=g.substring(g.indexOf("/")+1,g.indexOf("(")-1);}d=b.toLowerCase()+"_"+e+"_"+c+".gif";
}h=h+d;a=a+escape(d);}showUserImageUploader(c,a,h);}}function showUserImageUploader(c,a,b){fileUploadURI=a;filePath=b;var d=Ext.create("Ext.window.Window",{title:"Files to be uploaded",requires:["EgAddUser.view.FileUpload"],width:500,imageFor:c,id:"fileUpLoader",modal:true,doClose:function(){this.destroy();
},getCurrentUploaderInfo:function(){return this.imageFor;},items:[{xtype:"fileupload",}],}).show();if(!Ext.isEmpty(c)&&c=="login"){Ext.getCmp("specificationId").setValue("Type:GIF, JPEG, PNG, JPG;  Size:300KB;  Resolution:225x70pixels");}}function loadConfigPage(b,c){var a="";if(b=="userZones"){a="/final/admin/EgConfigZone.jsp?qctr=0&mode=modify&zone="+encodeURIComponent(c);
}if(b=="userServices"){a="/final/admin/EgConfigSites.jsp?modify=true&site="+encodeURIComponent(c);}if(b=="userServiceGroups"){a="/final/admin/EgConfigServiceGroup.jsp?modify=true&site="+encodeURIComponent(c);}if(b=="userSegments"){a="/final/admin/EgAdminTopology.jsp?qctr=0&segment="+encodeURIComponent(c);
}if(b=="userComponenets"||b=="userAutoComps"){a="/final/admin/EgDispServer.jsp?qctr=1&server="+encodeURIComponent(c);}if(!Ext.isEmpty(fromWizard)){a+="&fromWizard="+fromWizard;}window.location.href=a;}function checkSpecial(c,b){obj_val=c.value;for(var a=0;a<obj_val.length;a++){check_char=b.indexOf(obj_val.charAt(a));
if(check_char>=0){return false;}}return true;}function addAutomanageSrvs(h,f){var c=Ext.getCmp("serverCategoryList").getValue();var g=h.toString();var b;if(g!=null){b=g.split(",");}if(b!=""&&b.length>0){if(selectedCategoryArr.indexOf(c)==-1){selectedCategoryArr.push(c);for(var d=0;d<b.length;d++){var a=b[d];
if(srvListArray.indexOf(a)==-1){srvListArray.push(a);}}if(f.getValue()!==undefined){toFieldData(f);}}else{for(var d=0;d<b.length;d++){var e=b[d];if(srvListArray.indexOf(e)==-1){srvListArray.push(e);}}if(f.getValue()!==undefined){toFieldData(f);}}}else{toFieldData(f);}}function fromFieldData(e){var d=e;
var g=d.fromField.store;var f="";var c=g.getCount();for(var b=0;b<c;b++){var a=g.getAt(b).get("valueField");if(b==(c-1)){f+=a;}else{f+=a+",";}}addAutomanageSrvs(f,e);}function toFieldData(f){unmanageList=f.getValue();var e=unmanageList.toString();var b=e.split(",");if(b!=""&&b.length>0){for(var d=0;d<b.length;
d++){var a=b[d];for(var c=0;c<srvListArray.length;c++){if(srvListArray[c].indexOf(a)!=-1){var g=srvListArray.indexOf(srvListArray[c]);srvListArray.splice(g,1);}}}}}function isSoleNumber(g){if(typeof(g)=="object"){object_value=g.value;}else{object_value=g;}var d="0123456789";var e;var a=false;var c=false;
var f=false;for(var b=1;b<object_value.length;b++){e=d.indexOf(object_value.charAt(b));if(e<0){return false;}}return true;}