Ext.define("EgReplicateUser.controller.Main",{extend:"Ext.app.Controller",views:["CloneUser","EgDomainGroupTree","viewSelections"],refs:[{selector:"cloneuser",ref:"cloneuser"},{selector:"egdomaingrouptree",ref:"egdomaingrouptree"},{selector:"viewselections",ref:"viewselections"},{selector:"groupWindow",ref:"groupWindow"}],init:function(){thisController=this;
this.buildMainData();var a;var b;this.control({"cloneuser":{"afterrender":this.afterMainRender},'cloneuser combo[id="domainID"]':{"select":this.domainNameChange},'cloneuser treepicker[id="uidS"]':{"select":this.cloneFromComboChange},'cloneuser checkbox[id="noExpiryField"]':{"change":this.noExpiryChange},'cloneuser button[id="validateID"]':{"click":this.onValidate},'cloneuser radiogroup[id="authenticationID"]':{"change":this.radioChanged},'cloneuser radiogroup[id="userAuthSAML"]':{"change":this.radioChanged},'cloneuser radiofield[id="userId"]':{"change":this.operationRadioChanged},'cloneuser radiofield[id="groupId"]':{"change":this.operationRadioChanged},'cloneuser button[id="replicateID"]':{"click":this.cloneUpdate},'cloneuser checkboxgroup[id="checkboxGroupId"]':{"change":this.selectCheckBox},'groupWindow button[id="applyBtn"]':{"click":this.applyGroupName},'groupWindow button[id="viewSelect"]':{"click":this.viewSelections},'cloneuser textfield[id="passwordID"]':{"change":this.passStrength},'cloneuser textfield[id="unameID"]':{"change":this.onCheck}});
},passStrength:function(){var a=publicJSON.pwdLength;var g=publicJSON.pwdComplexityCount;if(a==""||a<2){a=8;}else{if(a!=""&&a<g){a=g;}}var b=Ext.getCmp("passwordID").getValue();var d=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\da-zA-Z]).+$/;var f=/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z]).+$/;var e=/^(?=.*\d)(?=.*[a-zA-Z]).+$/;
if(b.length>=a&&d.test(b)){Ext.getCmp("passScore").setText(passStr+": "+Strong);}else{if(b.length>=a&&b.match(f)){Ext.getCmp("passScore").setText(passStr+": "+Good);}else{if(b.length>=a&&b.match(e)){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(f){var d="^";var a="";var g=".+$";var o="";var b=".";var n="<br/>";var h=publicJSON.pwdComplexity;if(h!=null&&h!=undefined){if(h.indexOf(",")>-1){o="false#";var l=h.split(",");for(var e=0;e<l.length;e++){var m=l[e].toLowerCase().trim();
if(m=="lc"){a+="(?=.*[a-z])";o+=n+(e+1)+b+" "+alertForPwdComplexity1;}else{if(m=="uc"){a+="(?=.*[A-Z])";o+=n+(e+1)+b+" "+alertForPwdComplexity2;}else{if(m=="dg"){a+="(?=.*[0-9])";o+=n+(e+1)+b+" "+alertForPwdComplexity3;}else{if(m=="sp"){a+="(?=.*[^0-9a-zA-Z])";o+=n+(e+1)+b+" "+alertForPwdComplexity4;
}}}}}}else{o="false#";var m=h.toString().toLowerCase().trim();if(m=="lc"){a+="(?=.*[a-z])";o+=alertForPwdComplexity1;}else{if(m=="uc"){a+="(?=.*[A-Z])";o+=alertForPwdComplexity2;}else{if(m=="dg"){a+="(?=.*[0-9])";o+=alertForPwdComplexity3;}else{if(m=="sp"){a+="(?=.*[^0-9a-zA-Z])";o+=alertForPwdComplexity4;
}}}}}var j=new RegExp(d+a+g);if(j.test(f)){o="true";}}return o;},onCheck:function(){var b=Ext.getCmp("unameID").getValue();var a=publicJSON.usersExistJson;var k=a.usersexist;var h=publicJSON.displayNameOfDefaultOrg;if(b!=null&&b!=""){var e=Ext.getCmp("egAuthentication").getValue();if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("idpAuthSAML").getValue()==true){e=true;
}else{if(Ext.getCmp("eGAuthSAML").getValue()==true){e=true;}}}if(k!=null&&k!=""&&e==true){var g=k.split("|hash|");if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("idpAuthSAML").getValue()==true){var d=Ext.getCmp("idpName").getValue();b="samlsso/"+d+"/"+b;}else{if(Ext.getCmp("domainAuthSAML").getValue()==true){var j=Ext.getCmp("domainID").getValue();
b=j+"/"+b;}}}else{if(Ext.getCmp("domainAuthentication").getValue()==true){var j=Ext.getCmp("domainID").getValue();b=j+"/"+b;}}for(var f=0;f<g.length;f++){if(typeof g[f]==="string"){g[f]=g[f].toLowerCase();}}if(Ext.Array.contains(g,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(){Ext.Ajax.request({url:appURL,async:false,success:function(a){var b=a.responseText;
publicJSON=Ext.decode(b);}});},domainNameChange:function(f){var g=Ext.getCmp("uidS").getValue();var d=Ext.getCmp("domainID").getValue();var a=Ext.getCmp("userId");var k=Ext.getCmp("groupId");if(a.getValue()){operationTypeValue="User";}if(k.getValue()){operationTypeValue="Group";}var h=this;var b=f.getValue();
if(b!="none"&&b!="Choose a domain"){h.isPwdConfiguredWithSelectedDomain(b);if(operationTypeValue=="Group"){var j=Ext.getCmp("domainAuthentication").getGroupValue();if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){j=Ext.getCmp("domainAuthSAML").getGroupValue();}var e="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?uname="+encodeURIComponent(g)+"&domain="+d+"&operation="+operationTypeValue+"&authentication="+j+"&ldapPass="+encodeURIComponent(adDomainpwd);
h.updateUserPage(e);Ext.getCmp("displayGroup").setValue("  ----Click on the icon to select a group----  ");}else{Ext.getCmp("operationID").setValue({operation:"User"});Ext.suspendLayouts();Ext.getCmp("domainID").show();Ext.getCmp("operationID").show();Ext.getCmp("displayGroup").show();Ext.getCmp("validateID").show();
Ext.getCmp("expiry_dateID").hide();Ext.getCmp("mailidormobileID").hide();Ext.getCmp("timeZoneID").hide();Ext.getCmp("languageNameID").hide();Ext.getCmp("userCont").show();Ext.getCmp("unameID").show();Ext.getCmp("unameID").setReadOnly(false);Ext.getCmp("passwordID").hide();Ext.getCmp("Retype_passwordID").hide();
Ext.getCmp("changePwd").hide();Ext.getCmp("grpnameContainer").hide();Ext.getCmp("replicateID").hide();Ext.getCmp("validateID").show();Ext.resumeLayouts(true);Ext.getCmp("unameID").reset();}}else{Ext.Msg.show({title:cloneUserTitle,msg:alertForNoDomain,buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("operationID").setValue({operation:"User"});
Ext.suspendLayouts();Ext.getCmp("domainID").show();Ext.getCmp("operationID").show();Ext.getCmp("displayGroup").show();Ext.getCmp("validateID").show();Ext.getCmp("expiry_dateID").hide();Ext.getCmp("mailidormobileID").hide();Ext.getCmp("timeZoneID").hide();Ext.getCmp("languageNameID").hide();Ext.getCmp("userCont").show();
Ext.getCmp("unameID").show();Ext.getCmp("unameID").setReadOnly(false);Ext.getCmp("passwordID").hide();Ext.getCmp("Retype_passwordID").hide();Ext.getCmp("changePwd").hide();Ext.getCmp("grpnameContainer").hide();Ext.getCmp("replicateID").hide();Ext.getCmp("validateID").show();Ext.resumeLayouts(true);Ext.getCmp("unameID").reset();
return false;}},updateUserPage:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var d=b.responseText;publicJSON=Ext.decode(d);}});},isPwdConfiguredWithSelectedDomain:function(b){var a=this;var e="domainName="+b+"&validatePwd=yes";var d="/final/servlet/com.egurkha.ADDomainAuth?"+e;
Ext.Ajax.request({url:d,method:"POST",async:false,success:function(f){var g=Ext.decode(f.responseText);if(g.isPasswordConfigured==false){a.showAuthenticationWindow(g.domainName,g.domUser);}}});},showAuthenticationWindow:function(b,a){Ext.widget("window",{title:domainNameCredentialLabel,id:"authWindow",width:600,height:170,modal:true,border:false,autoScroll:false,closeAction:"destory",doClose:function(){Ext.getCmp("domainID").setValue("Choose a domain");
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 d=Ext.getCmp("userInput").getValue();
if(d==null||d==""||d.length==0){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoPassword,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(e){Ext.getCmp("userInput").focus(true);}});return false;}adDomainpwd=d;Ext.getCmp("authWindow").destroy();}}]}).show();},afterMainRender:function(){var n="";
var h=Ext.getCmp("uidS");var b=Ext.getCmp("timeZoneID");var k=Ext.getCmp("languageNameID");var j=true;var p=publicJSON.isSAMLLoginEnabled;if(!Ext.isEmpty(p)&&p){Ext.getCmp("userAuthSAML").show();Ext.getCmp("userAuthSAML").setDisabled(false);Ext.getCmp("authenticationID").hide();Ext.getCmp("authenticationID").setDisabled(true);
}else{Ext.getCmp("authenticationID").show();Ext.getCmp("authenticationID").setDisabled(false);Ext.getCmp("userAuthSAML").hide();Ext.getCmp("userAuthSAML").setDisabled(true);}if(!isEnterpriseModel){Ext.getCmp("authenticationID").hide();Ext.getCmp("userAuthSAML").hide();}if(!Ext.isEmpty(p)&&p){n=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;
}else{var o=Ext.getCmp("domainAuthentication");var g=Ext.getCmp("egAuthentication");var m=Ext.getCmp("domainID");if(o.getValue()){n="Domain";}if(g.getValue()){n="Eg";}}var f=Ext.getCmp("selectAllId");var e=Ext.getCmp("checkboxGroupId");if(f.getValue()){e.setValue({rb1:["User_Preferences","Infrastructure_Elements","Exclude_Mail_Alerts","Live_Graph","Quick_Insights","Favorite_Measures","Custom_Dashboards","Favorites","Schedules","Configuration_Data","Quick_Menus","User_Experience_Dashboard","Business_Dashboards","User_Reports","Maintenance_Policies","Booklets","Background_Reports","Citrix_Dashboards"]});
}else{e.setValue(false);e.setValue({rb1:["User_Preferences"]});}var a="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+n;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(r){var w=r.responseText;var u=Ext.decode(w);domainArrayJson=u.domainArrayJson;var t=u.isUsersCreated;
if(!Ext.isEmpty(t)&&t){var x=u["RootNodeText"];if(Ext.isEmpty(x)){x="Choose an user";}var s={text:x,id:"-1",name:"-1",expanded:true,children:u["exportDataArr"]};h.getStore().setRootNode(s);h.setValue("-1");var v=u.timeZoneArrayJson[0].valueField;var q=u.defaultTimeZoneJson.defaultTimeZone;b.getStore().loadRawData(u.timeZoneArrayJson);
if(Ext.isEmpty(q)){b.setValue(u.timeZoneArrayJson[0].valueField);}else{b.setValue("default");}k.getStore().loadRawData(u.countryArrayJson);k.setValue(u.userLanguageJson.userLanguage);}else{Ext.getCmp("cloneUserCont").hide();Ext.getCmp("emptyCont").show();}}});var a="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication=Domain";
if(n=="Domain"){Ext.getCmp("validateID").show();}var l=publicJSON.pwdLength;var d=publicJSON.pwdComplexityCount;if(l==""||l<2){l=8;}else{if(l!=""&&l<d){l=d;}}Ext.getCmp("passScore").setText(passLabel1+" "+l+" "+passLabel2);if(!isEnterpriseModel){Ext.getCmp("userAuthSAML").setDisabled(true);Ext.getCmp("eGAuthSAML").setValue(true);
}},cloneFromComboChange:function(){var b="";var a=Ext.getCmp("uidS");var g=Ext.getCmp("timeZoneID");var e=Ext.getCmp("languageNameID");var f=true;if(publicJSON.isSAMLLoginEnabled){Ext.getCmp("userAuthSAML").reset();}else{Ext.getCmp("authenticationID").reset();}b="Eg";var d="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+b;
Ext.Ajax.request({url:d,scope:this,method:"POST",success:function(k){var j=k.responseText;var o=Ext.decode(j);Ext.getCmp("unameID").reset();Ext.getCmp("passwordID").reset();Ext.getCmp("Retype_passwordID").reset();Ext.getCmp("tilldate").reset();Ext.getCmp("mailidormobileID").reset();Ext.getCmp("noExpiryField").reset();
var l=o.timeZoneArrayJson[0].displayField;var q=o.defaultTimeZoneJson.defaultTimeZone;g.getStore().loadRawData(o.timeZoneArrayJson);if(Ext.isEmpty(q)){g.setValue(o.timeZoneArrayJson[0].valueField);}else{g.setValue("default");}e.getStore().loadRawData(o.countryArrayJson);e.setValue(o.userLanguageJson.userLanguage);
var m=Ext.getCmp("uidS").getValue();var n=Ext.getCmp("uidS").getStore().getNodeById(m);var p=n.raw.iconCls;if(p!="iconUxUser"&&p!="iconUxAdminUser"&&m!="-1"){Ext.Msg.show({title:cloneUserTitle,msg:cloneuseralert,buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("uidS").setValue("-1");return false;
}var h="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+b+"&username="+encodeURIComponent(m);selectedDateFormat=o.selectedDateFormatJson.selectedDateFormat;Ext.Ajax.request({url:h,scope:this,method:"POST",success:function(r){var t=r.responseText;var s=Ext.decode(t);var v=s.orgName;
superOrg=s.superOrgName;var u=s.uvalidtill;if(u!=null&&u!="12/12/9999"){Ext.getCmp("tilldate").setMaxValue(u);Ext.getCmp("noExpiryField").setDisabled(true);}else{Ext.getCmp("tilldate").setMaxValue("12/12/9999");Ext.getCmp("noExpiryField").setDisabled(false);}Ext.getCmp("tilldate").setValue("");Ext.getCmp("noExpiryField").setValue("");
}});if(!isEnterpriseModel){Ext.getCmp("userAuthSAML").setDisabled(true);Ext.getCmp("userAuthSAML").hide();Ext.getCmp("authenticationID").setDisabled(true);Ext.getCmp("authenticationID").hide();Ext.getCmp("eGAuthSAML").setValue(true);Ext.getCmp("egAuthentication").setValue(true);}else{Ext.getCmp("userAuthSAML").setDisabled(false);
Ext.getCmp("authenticationID").setDisabled(false);Ext.getCmp("eGAuthSAML").setValue(true);Ext.getCmp("egAuthentication").setValue(true);}}});},afterCloneSuccess:function(){var l="";var g=Ext.getCmp("uidS");var b=Ext.getCmp("timeZoneID");var j=Ext.getCmp("languageNameID");var d=Ext.getCmp("authenticationID");
var h=true;var k=Ext.getCmp("domainID");if(publicJSON.isSAMLLoginEnabled){Ext.getCmp("userAuthSAML").reset();}else{d.reset();}l="Eg";var f=Ext.getCmp("selectAllId");var e=Ext.getCmp("checkboxGroupId");f.setValue("allCategory");e.setValue({rb1:["User_Preferences","Infrastructure_Elements","Exclude_Mail_Alerts","Live_Graph","Quick_Insights","Favorite_Measures","Custom_Dashboards","Favorites","Schedules","Configuration_Data","Quick_Menus","User_Experience_Dashboard","Business_Dashboards","User_Reports","Maintenance_Policies","Booklets","Background_Reports","Citrix_Dashboards"]});
var a="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+l;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(n){var r=n.responseText;var p=Ext.decode(r);var s=p["RootNodeText"];if(Ext.isEmpty(s)){s="Choose an user";}var o={text:s,id:"-1",name:"-1",expanded:true,children:p["exportDataArr"]};
g.getStore().setRootNode(o);g.setValue("-1");Ext.getCmp("unameID").reset();Ext.getCmp("passwordID").reset();Ext.getCmp("Retype_passwordID").reset();Ext.getCmp("tilldate").reset();Ext.getCmp("mailidormobileID").reset();Ext.getCmp("noExpiryField").reset();Ext.getCmp("grpnameContainer").hide();var q=p.timeZoneArrayJson[0].displayField;
var m=p.defaultTimeZoneJson.defaultTimeZone;b.getStore().loadRawData(p.timeZoneArrayJson);if(Ext.isEmpty(m)){b.setValue(p.timeZoneArrayJson[0].valueField);}else{b.setValue("default");}j.getStore().loadRawData(p.countryArrayJson);j.setValue(p.userLanguageJson.userLanguage);}});},cloneUpdate:function(){var ac="";
var az="";var l="";var ab="";var ap=this;var w=Ext.getCmp("unameID");var aE=Ext.getCmp("userId");var aw=Ext.getCmp("groupId");var aC="";var z=Ext.getCmp("passwordID");var an=Ext.getCmp("Retype_passwordID").getValue();an=Ext.String.trim(an);if(publicJSON.isSAMLLoginEnabled){ac=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;
}else{var C=Ext.getCmp("domainAuthentication");var A=Ext.getCmp("egAuthentication");if(C.getValue()){ac="Domain";}if(A.getValue()){ac="Eg";}}if(aE.getValue()){az="User";}if(aw.getValue()){az="Group";}var af=true;var ao=false;var d="";var aq="";var au="";var a=Ext.getCmp("checkboxGroupId");var ah=Ext.getCmp("checkboxGroupId").getChecked();
var ar="";for(var K=0;K<ah.length;K++){var V=ah[K];var L=V.inputValue;ar+=L+",";}var t="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+ac;var f="";var m="";var g="";var u="";var j="";var J="";var aF="";var ay="";var x="";var aA="";var S="";var aa="";var o="";Ext.Ajax.request({url:t,scope:this,method:"POST",async:false,success:function(aG){var aI=aG.responseText;
var aH=Ext.decode(aI);f=aH.currentDateJson.str_currentdate;m=aH.currentHourJson.str_currenthr;g=aH.currentMinJson.str_currentmin;u="00";j="00";J=aH.usersExistJson.usersexist;aF=aH.isDoubleJson.isDouble;ay=aH.currentDateFormatJson.currentDateFormat;x=aH.pwdLength;S=aH.isAdminEnabled2FA;aa=aH.is2FACFlagEnabled;
aA=aH.pwdComplexityCount;o=aH.displayNameOfDefaultOrg;}});if(x==""||x<2){x=8;}else{if(x!=""&&x<aA){x=aA;}}var aj=true;var U=true;var q=Ext.getCmp("noExpiryField");var G=Ext.getCmp("expiryField");var aq;var y;var B;if(d=="true"||ac=="Eg"||az=="Group"||ac=="Domain"){B=Ext.getCmp("mailidormobileID");y=Ext.getCmp("mailidormobileID").getValue();
}var ad=/^(\+\d\d)?[0-9]+$/g;if(ac=="Eg"){var N=Ext.getCmp("unameID").getValue();var Z=Ext.getCmp("unameID").getValue();var ae=Ext.getCmp("passwordID").getValue();ae=Ext.String.trim(ae);var M=Ext.getCmp("Retype_passwordID").getValue();M=Ext.String.trim(M);var p=J;var h=Ext.getCmp("unameID").getValue();
var F="true";}if(az=="User"){var Z=Ext.getCmp("unameID").getValue();var N=Ext.getCmp("unameID").getValue();var p=J;var h=Ext.getCmp("unameID").getValue();}if((ac=="Eg"||aC=="User")&&(d=="true")){var ag=Ext.getCmp("tilldate");var al=Ext.getCmp("tilldate").getValue();var q=Ext.getCmp("noExpiryField");}else{if(aC=="Group"&&ax!="none"){var ag=Ext.getCmp("tilldate");
var al=Ext.getCmp("tilldate").getValue();var q=Ext.getCmp("noExpiryField");}}if(ac=="Eg"){var ag=Ext.getCmp("tilldate");var al=Ext.getCmp("tilldate").getValue();var q=Ext.getCmp("noExpiryField");}if(ac=="Domain"){var ak=Ext.getCmp("domainID").getValue();}if(ak=="none"||ak=="Choose a domain"){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoDomain,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(h!=null&&h!=""){if(p!=null&&p!=""){var O=p.split("|hash|");if(ac=="SAML"){var Y=Ext.getCmp("idpName").getValue();h="samlsso/"+Y+"/"+h;}else{if(ac=="Domain"){var e=Ext.getCmp("domainID").getValue();h=e+"/"+h;}}for(K=0;K<O.length;K++){if(O[K].toLowerCase()==h.toLowerCase()){Ext.Msg.show({title:cloneUserTitle,msg:alertForAlreadyUser,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return;}}}}var N=Ext.getCmp("unameID").getValue();var w=Ext.getCmp("unameID");var aD=Ext.getCmp("passwordID").getValue();aD=Ext.String.trim(aD);var ae=Ext.getCmp("passwordID").getValue();ae=Ext.String.trim(ae);var X=Ext.getCmp("passwordID");if(ac=="SAML"){var H=Ext.getCmp("idpName").getValue();if(H=="none"){Ext.Msg.show({title:cloneUserTitle,msg:userIdpValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(aG){Ext.getCmp("idpName").focus(true);
}});return;}if(!checkblank(N)){Ext.Msg.show({title:cloneUserTitle,msg:alertForUserId+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(aG){Ext.getCmp("unameID").focus(true);}});return;}}if(az=="User"||ac=="Eg"){if(aF=="false"){aj=this.validateSingleByte();if(aD!=null){U=this.validateSingleByte(aD);
}}if(!aj){Ext.Msg.show({title:cloneUserTitle,msg:alertForSingleByte,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});af=false;return;}var n=this.isUserIdSelected();if(!n){Ext.Msg.show({title:cloneUserTitle,msg:alertForSelectionUser,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});af=false;return;
}else{if(N==""){Ext.Msg.show({title:cloneUserTitle,msg:alertForUserId,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});af=false;return;}}checkSpace=N;if(checkSpace.indexOf(" ")==0){Ext.Msg.show({title:cloneUserTitle,msg:alertForStartSpaceInId,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(checkSpace.lastIndexOf(" ")==checkSpace.length-1){Ext.Msg.show({title:cloneUserTitle,msg:alertForEndSpaceInId,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}if(checkSpace.indexOf("  ")!=-1||checkSpace.indexOf("--")!=-1||checkSpace.indexOf("__")!=-1||checkSpace.indexOf("..")!=-1){Ext.Msg.show({title:cloneUserTitle,msg:alertForSomeCharInId,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(!checkSpecial(w,'="/\\')){Ext.Msg.show({title:cloneUserTitle,msg:_checkspecial,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){w.focus();}});af=false;return;}else{if(trim(N)==""){af=false;return;}else{if(N.indexOf("..")>-1){af=false;return;}else{if(N.toUpperCase()=="ADMIN"||N.toUpperCase()=="SUPERMONITOR"||N.toUpperCase()=="MONITOR"||N.toUpperCase()==o.toUpperCase()){Ext.Msg.show({title:cloneUserTitle,msg:alertForOtherManager+" '"+N+"'.",width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
af=false;return;}}}}if(N.toUpperCase()=="NULL"){Ext.Msg.show({title:cloneUserTitle,msg:alertForNullId+" '"+N+"'.",width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}if(!Ext.isEmpty(enforceEmailIDInMSP)&&enforceEmailIDInMSP.toLowerCase()=="true"){if(superOrg!=null&&superOrg.toLowerCase()!="egenterprise"){var s=/[\#]?([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 I=N.match(s);if(I!=N.toString()){Ext.Msg.show({title:cloneUserTitle,msg:userIDEmailValidationMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(aG){w.focus(true);}});return false;}}}}if(ac=="Eg"){var av=ap.pwdComplexityCheck(ae);if(ae==""){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoPassword,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
af=false;return;}else{if(Ext.String.trim(N.toLowerCase())==ae.toLowerCase()){Ext.Msg.show({title:cloneUserTitle,msg:userpassMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(aG){X.focus(true);}});return false;}else{if(F=="true"&&ae.length<x){Ext.Msg.show({title:cloneUserTitle,msg:passLabel1+" "+x+" "+passLabel2,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
af=false;return;}else{if(F=="true"&&!checkloginpass(z)){af=false;return;}else{if(F=="true"&&av.indexOf("false")>-1){var k=av.substring(av.indexOf("false#")+6);Ext.Msg.show({title:cloneUserTitle,msg:alertForPwdComplexity5+". "+passLabel1+" "+k+".",width:400,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(aG){X.focus(true);
}});return false;}else{if(F=="true"&&!U){Ext.Msg.show({title:cloneUserTitle,msg:alertForPasswordDBL,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});af=false;return;}else{if(F=="true"&&an==""){Ext.Msg.show({title:cloneUserTitle,msg:alertForPasswordRetype,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
af=false;return;}else{if(ae!=an){Ext.Msg.show({title:cloneUserTitle,msg:alertForPasswordMismatch,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});af=false;}}}}}}}}}else{if(ac=="Domain"){if(az!=null&&az=="Group"){var ax=Ext.getCmp("displayGroup").getValue();if(ax==""||ax=="  ----Click on the icon to select a group----  "){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoGroup,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}else{Ext.getCmp("groupName").setValue(ax);}}}}if(d=="true"||ac=="Eg"||az=="Group"||ac=="Domain"){var ag=Ext.getCmp("tilldate");if(q.checked==false){var b=ay;var P="";if(f!=null&&f!="undefined"){P=f;}var al=Ext.getCmp("tilldate").getValue();var W=Ext.Date.format(al,"m/d/Y");if(!Ext.isEmpty(al)&&al!=""){Ext.getCmp("noExpiryField").setValue(false);
}aq=W;var r=this.checkblank(W);var at=this.checkTime(P,aq,m,u,g,j);if(r==false){Ext.Msg.show({title:cloneUserTitle,msg:alertForValidatyDate,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});af=false;return;}else{if(at==false){Ext.Msg.show({title:cloneUserTitle,msg:alertForValidatyCheck,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
af=false;return;}}}}if(d=="true"||ac=="Eg"||az=="Group"||ac=="Domain"){if(y!=""){var R=y.split(",");if(R!=null&&R.length>0){for(var K=0;K<R.length;K++){var E=R[K].toString();if(E.indexOf("@")==-1||E.indexOf(".")==-1){var Q=E.match(ad);if(Q==null||Q!=E){Ext.Msg.show({title:cloneUserTitle,msg:alertForEmailOrMobile,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
B.focus();af=false;return;}}else{if(!validateSingleByte(E)){Ext.Msg.show({title:cloneUserTitle,msg:alertForDBLInToMail,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});B.focus();af=false;return;}else{if(!validateEmail(E)){Ext.Msg.show({title:cloneUserTitle,msg:alertForEmailOrMobile,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
B.focus();af=false;return;}}}}}}}if(d=="false"&&ac=="Domain"&&az=="User"){af=false;Ext.Msg.show({title:cloneUserTitle,msg:alertForIsValidated,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}ao=this.isSelectedAny();if(ao==false){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoCategory,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
}if(af&&ao){var al=Ext.getCmp("tilldate").getValue();var q=Ext.getCmp("noExpiryField").getValue();if(q){q="Never";}var ai=ac;var W=Ext.Date.format(al,"m/d/Y");var v="dateforpro="+W+"&authentication="+ai+"&operation="+az+"&categoryCheck="+ar+"&userDateFormat="+selectedDateFormat+"&never="+q;if(!Ext.isEmpty(S)&&(S.toLowerCase()=="true"||S.toLowerCase()=="yes")&&!Ext.isEmpty(aa)&&(aa.toLowerCase()=="true"||aa.toLowerCase()=="yes")){var T=Ext.getCmp("mailidormobileID").getValue();
if(Ext.isEmpty(T)||Ext.String.trim(T).length==0){Ext.Msg.show({title:cloneUserTitle,msg:maidIDAlertMsg,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});return;}v+="&mailIDVal="+T;}var D=this.getCloneuser().getForm();var aB=new Ext.LoadMask(Ext.getBody(),{msg:"Processing..."});aB.show();if(D.isValid()){var N=Ext.getCmp("unameID").getValue();
var aD=Ext.getCmp("passwordID").getValue();aD=parent.filterEncode(aD);Ext.getCmp("passwordID").setValue(aD);Ext.getCmp("Retype_passwordID").setValue(aD);var am=Ext.getCmp("uidS").getValue();am=parent.filterEncode(am);v+="&uid="+am;D.submit({url:"/final/admin/EgReplicateUser/data/EgReplicateUserJSONp.jsp?",params:v,timeout:180000,method:"POST",success:function(aK,aM){var aL=aM.response.responseText;
var aH=Ext.decode(aL);var aG=aH.error;if(aG!=null&&!aG){Ext.Msg.show({title:cloneUserTitle,msg:cloneUserMessage,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});ap.afterCloneSuccess();aB.hide();}else{var aJ=aH.TwoFAMailSend;if(!Ext.isEmpty(aJ)&&aJ.toLowerCase()=="failed"){var aN=aH.MailSendErrMsg;
Ext.Msg.show({title:pageTitle,msg:aN+".",buttons:Ext.Msg.OK,icon:"iconInformation"});}var aI=aH.errorMsg;Ext.Msg.show({title:cloneUserTitle,msg:aI.message1+" . "+aI.message2,buttons:Ext.Msg.OK,icon:"iconError"});aB.hide();}}});}}},radioChanged:function(g,f,b,d){var a="";var j=Ext.getCmp("uidS").getValue();
Ext.getCmp("userId").setValue("User");if(j=="-1"){Ext.suspendLayouts();Ext.getCmp("domainID").hide();Ext.getCmp("operationID").hide();Ext.getCmp("displayGroup").hide();Ext.getCmp("validateID").hide();Ext.getCmp("groupPopup").hide();Ext.getCmp("grpnameContainer").hide();Ext.getCmp("groupName").hide();
Ext.getCmp("unameID").show();Ext.getCmp("unameID").setReadOnly(false);Ext.getCmp("passCont").show();Ext.getCmp("passwordID").show();Ext.getCmp("Retype_passwordID").show();Ext.getCmp("changePwd").show();Ext.getCmp("expiry_dateID").show();Ext.getCmp("mailidormobileID").show();Ext.getCmp("timeZoneID").show();
Ext.getCmp("languageNameID").show();Ext.getCmp("replicateID").show();Ext.getCmp("idpName").hide();Ext.resumeLayouts(true);Ext.getCmp("unameID").reset();Ext.Msg.show({title:cloneUserTitle,msg:chooseToCloneCombo,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});if(publicJSON.isSAMLLoginEnabled){Ext.getCmp("userAuthSAML").reset();
}else{Ext.getCmp("authenticationID").reset();}return;}if(g.id=="userAuthSAML"){a=f.authenticationSAML;}else{a=f.authentication;}if(a=="Domain"){Ext.suspendLayouts();Ext.getCmp("domainID").show();Ext.getCmp("operationID").show();Ext.getCmp("displayGroup").show();Ext.getCmp("validateID").show();Ext.getCmp("unameID").show();
Ext.getCmp("passwordID").hide();Ext.getCmp("passCont").hide();Ext.getCmp("Retype_passwordID").hide();Ext.getCmp("changePwd").hide();Ext.getCmp("expiry_dateID").hide();Ext.getCmp("mailidormobileID").hide();Ext.getCmp("timeZoneID").hide();Ext.getCmp("languageNameID").hide();Ext.getCmp("replicateID").hide();
Ext.getCmp("validateID").show();Ext.resumeLayouts(true);Ext.getCmp("idpName").hide();Ext.getCmp("unameID").reset();var e=Ext.getCmp("domainID");e.getStore().loadRawData(domainArrayJson);e.setValue(domainArrayJson[0].valueField);if(e.getStore().getTotalCount()<=1){Ext.resumeLayouts(true);Ext.Msg.show({title:cloneUserTitle,msg:noDomainMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){if(g.id=="userAuthSAML"){Ext.getCmp("userAuthSAML").reset();
}else{Ext.getCmp("authenticationID").reset();}}});return false;}}else{if(a=="SAML"){Ext.suspendLayouts();Ext.getCmp("idpName").show();Ext.getCmp("idpName").setDisabled(false);Ext.getCmp("validateID").hide();Ext.getCmp("unameID").setReadOnly(false);Ext.getCmp("domainID").hide();Ext.getCmp("operationID").hide();
Ext.getCmp("passwordID").hide();Ext.getCmp("passCont").hide();Ext.getCmp("Retype_passwordID").hide();Ext.getCmp("changePwd").hide();var h=Ext.getCmp("idpName");h.getStore().loadRawData(publicJSON["ssoList"]);h.setValue(h.getStore().getAt(0).get("valueField"));Ext.getCmp("expiry_dateID").show();Ext.getCmp("mailidormobileID").show();
Ext.getCmp("timeZoneID").show();Ext.getCmp("languageNameID").show();Ext.getCmp("replicateID").show();Ext.resumeLayouts(true);if(h.getStore().getTotalCount()<=1){Ext.resumeLayouts(true);Ext.Msg.show({title:cloneUserTitle,msg:noIdpMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){if(g.id=="userAuthSAML"){Ext.getCmp("userAuthSAML").reset();
}else{Ext.getCmp("authenticationID").reset();}}});return false;}}else{if(a=="Eg"){Ext.suspendLayouts();Ext.getCmp("domainID").hide();Ext.getCmp("operationID").hide();Ext.getCmp("displayGroup").hide();Ext.getCmp("validateID").hide();Ext.getCmp("groupPopup").hide();Ext.getCmp("grpnameContainer").hide();
Ext.getCmp("groupName").hide();Ext.getCmp("unameID").show();Ext.getCmp("unameID").setReadOnly(false);Ext.getCmp("passCont").show();Ext.getCmp("passwordID").show();Ext.getCmp("Retype_passwordID").show();Ext.getCmp("changePwd").show();Ext.getCmp("expiry_dateID").show();Ext.getCmp("mailidormobileID").show();
Ext.getCmp("timeZoneID").show();Ext.getCmp("languageNameID").show();Ext.getCmp("replicateID").show();Ext.getCmp("idpName").hide();Ext.resumeLayouts(true);Ext.getCmp("unameID").reset();}}}},noExpiryChange:function(){if(Ext.getCmp("noExpiryField").getValue()){Ext.getCmp("tilldate").setValue("");Ext.getCmp("tilldate").disable();
}else{Ext.getCmp("tilldate").enable();}},operationRadioChanged:function(){var j="";if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){j=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}else{var l=Ext.getCmp("domainAuthentication");var e=Ext.getCmp("egAuthentication");
if(l.getValue()){j="Domain";}if(e.getValue()){j="Eg";}}var h=Ext.getCmp("userId");var f=Ext.getCmp("groupId");var g=Ext.getCmp("uidS").getValue();var d=Ext.getCmp("domainID").getValue();if(d=="Choose a domain"){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoDomain,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
Ext.getCmp("operationID").reset();return;}if(f.getValue()){Ext.suspendLayouts();Ext.getCmp("grpnameContainer").show();Ext.getCmp("validateID").hide();Ext.getCmp("expiry_dateID").show();Ext.getCmp("mailidormobileID").show();Ext.getCmp("timeZoneID").show();Ext.getCmp("languageNameID").show();Ext.getCmp("replicateID").show();
Ext.getCmp("groupPopup").show();Ext.getCmp("unameID").hide();Ext.getCmp("userCont").hide();Ext.resumeLayouts(true);}if(h.getValue()){Ext.suspendLayouts();Ext.getCmp("domainID").show();Ext.getCmp("operationID").show();Ext.getCmp("displayGroup").show();Ext.getCmp("validateID").show();Ext.getCmp("expiry_dateID").hide();
Ext.getCmp("mailidormobileID").hide();Ext.getCmp("timeZoneID").hide();Ext.getCmp("languageNameID").hide();Ext.getCmp("userCont").show();Ext.getCmp("unameID").show();Ext.getCmp("unameID").setReadOnly(false);Ext.getCmp("passwordID").hide();Ext.getCmp("Retype_passwordID").hide();Ext.getCmp("changePwd").hide();
Ext.getCmp("grpnameContainer").hide();Ext.getCmp("replicateID").hide();Ext.getCmp("validateID").show();Ext.resumeLayouts(true);Ext.getCmp("unameID").reset();}var b=Ext.getCmp("userId");var k=Ext.getCmp("groupId");if(b.getValue()){operationTypeValue="User";}if(k.getValue()){operationTypeValue="Group";
}Ext.getCmp("displayGroup").setValue("  ----Click on the icon to select a group----  ");Ext.getCmp("tilldate").reset();var g=Ext.getCmp("uidS").getValue();var d=Ext.getCmp("domainID").getValue();var b=Ext.getCmp("userId");var k=Ext.getCmp("groupId");if(b.getValue()){operationTypeValue="User";}if(k.getValue()){operationTypeValue="Group";
}var a="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?uname="+g+"&domain="+d+"&operation="+operationTypeValue+"&authentication="+j+"&ldapPass="+encodeURIComponent(adDomainpwd);Ext.Ajax.request({url:a,async:false,success:function(m){var n=m.responseText;publicJSON=Ext.decode(n);}});},onValidate:function(){var f=true;
var a="";var h=Ext.getCmp("uidS").getValue();var j="subseq";var b=true;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){a=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}else{var e=Ext.getCmp("domainAuthentication");var g=Ext.getCmp("egAuthentication");if(e.getValue()){a="Domain";
}if(g.getValue()){a="Eg";}}var d="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+a;Ext.Ajax.request({url:d,scope:this,method:"POST",success:function(n){var l=n.responseText;var q=Ext.decode(l);var p=q.usersExistJson.usersexist;var s=Ext.getCmp("domainID").getValue();var v=Ext.getCmp("unameID");
var t=v.getValue();var u=p;var r;var k=Ext.getCmp("unameID").getValue();if(k!=null&&k!=""){if(u!=null&&u!=""){var o=u.split("|hash|");if(a=="Domain"){k=s+"/"+k;}for(i=0;i<o.length;i++){if(o[i].toLowerCase()==k.toLowerCase()){Ext.Msg.show({title:cloneUserTitle,msg:alertForAlreadyUser,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
f=false;return;}}}}if(s=="Choose a domain"){Ext.Msg.show({title:cloneUserTitle,msg:alertForNoDomain,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});f=false;return;}if(!checkblank(t)){Ext.Msg.show({title:cloneUserTitle,msg:alertForUserId,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});f=false;
return;}else{if(!checkSpecial(v,'="/\\')){Ext.Msg.show({title:cloneUserTitle,msg:_checkspecial,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){v.focus();}});f=false;return;}else{if(trim(t)==""){f=false;return;}else{if(t.indexOf("..")>-1){Ext.Msg.show({title:cloneUserTitle,msg:alertForDoubleDots,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
f=false;return;}}}}var m="/final/admin/EgReplicateUser/data/EgReplicateUserJSON.jsp?authentication="+a+"&uname="+encodeURIComponent(t)+"&domain="+encodeURI(s)+"&cloningUser="+encodeURIComponent(h)+"&isRefresh="+j+"&cloningUser="+encodeURIComponent(h)+"&isValidated="+b+"&ldapPass="+encodeURIComponent(adDomainpwd);
Ext.Ajax.request({url:m,scope:this,method:"POST",success:function(w){var z=w.responseText;var x=Ext.decode(z);var y=x.validatedUserJson.isValidUserForJSON;if(y=="true"){Ext.getCmp("unameID").setReadOnly(true);Ext.getCmp("expiry_dateID").show();Ext.getCmp("mailidormobileID").show();Ext.getCmp("timeZoneID").show();
Ext.getCmp("languageNameID").show();Ext.getCmp("replicateID").show();Ext.getCmp("validateID").hide();}else{Ext.Msg.show({title:cloneUserTitle,msg:alertForNoValidUser,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("expiry_dateID").hide();Ext.getCmp("mailidormobileID").hide();Ext.getCmp("timeZoneID").hide();
Ext.getCmp("languageNameID").hide();Ext.getCmp("replicateID").hide();Ext.getCmp("validateID").show();}}});}});},validateSingleByte:function(b){for(var d=0;d<b.length;d++){var a=b.charCodeAt(d);if(a>255){return false;}}return true;},isUserIdSelected:function(){var a=Ext.getCmp("uidS").getValue();if(a!="-1"){return true;
}return false;},isSelectedAny:function(){var d=Ext.getCmp("checkboxGroupId").getChecked();for(var b=0;b<d.length;b++){var a=d[b];if(a.getValue()){return true;}}return false;},checkblank:function(b){var a=0;if(typeof(field)=="object"){str_Value=b;}else{str_Value=b;}if(str_Value.length==0){a=0;}for(i=1;
i<=str_Value.length;i++){if(str_Value.charAt(i-1)==" "){a=0;}else{a=1;break;}}if(a!=1){return false;}return true;},checkTime:function(n,j,t,b,g,a){var v=t.length;if(v==1){t="0"+t;}var p=b.length;if(p==1){b="0"+b;}var s=g.length;if(s==1){g="0"+g;}var o=a.length;if(o==1){a="0"+a;}var e=n.substring(0,n.indexOf("/"));
var k=n.substring(n.indexOf("/")+1);var f=k.substring(0,k.indexOf("/"));var l=k.substring(k.indexOf("/")+1);var u=l+e+f+t+g;var q=j.substring(0,j.indexOf("/"));var h=j.substring(j.indexOf("/")+1);var r=h.substring(0,h.indexOf("/"));var d=h.substring(h.indexOf("/")+1);var m=d+q+r+b+a;if(u>m||u==m){return false;
}else{return true;}return true;},applyGroupName:function(){var b="";var a="";c=0;if(groupArray!=null&&groupArray.length>0){for(i=0;i<groupArray.length;i++){if(groupArray[i]!=null&&groupArray[i]!="undefined"){if(c==0){b=b+groupArray[i];a=a+groupArray[i];}else{b=b+"|#|"+groupArray[i];a=a+","+groupArray[i];
}c++;}}Ext.getCmp("displayGroup").setValue(a);Ext.getCmp("groupName").setValue(b);groupArray=new Array();Ext.getCmp("groupWindow").destroy();Ext.Ajax.request({url:"EgReplicateUser/data/EgReplicateUserJSON.jsp",method:"POST"});}else{Ext.Msg.show({title:cloneUserTitle,msg:alertForNoGroup,buttons:Ext.Msg.OK,icon:"iconExclamation"});
}},viewSelections:function(){Ext.widget("window",{extend:"Ext.container.Container",alias:"widget.viewSelections",title:"Group Selections",id:"viewWindow",width:300,height:300,padding:"5px",modal:true,border:false,floatable:true,floating:true,autoScroll:false,closeAction:"destory",doClose:function(){this.destroy();
},layout:{type:"fit"},items:[{xtype:"viewselections"}]}).show();var d="0";var b=Ext.getCmp("labelID");var a="<table align='center' width='100%' class='tableborder_ad' cellpadding='4' cellspacing='0'>";for(i=0;i<groupArray.length;i++){if(groupArray[i]!=null&&groupArray[i]!="undefined"){d="1";a=a+"<tr><td class='tdborder_ad' valign='top' style='font:5;width:100%;padding:2px;'>"+groupArray[i].replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</td></tr>";
}}if(d=="0"){return false;}a=a+"</table>";b.setText(a,false);},selectAllOrDeselect:function(){var b=Ext.getCmp("selectAllId");var a=Ext.getCmp("checkboxGroupId");if(b.getValue()){a.setValue({rb1:["User_Preferences","Infrastructure_Elements","Exclude_Mail_Alerts","Live_Graph","Quick_Insights","Favorite_Measures","Custom_Dashboards","Favorites","Schedules","Configuration_Data","Quick_Menus","User_Experience_Dashboard","Business_Dashboards","User_Reports","Maintenance_Policies","Booklets","Background_Reports","Citrix_Dashboards"]});
}else{a.setValue(false);a.setValue({rb1:["User_Preferences"]});}},selectCheckBox:function(){var a=Ext.getCmp("checkboxGroupId");var b=a.getChecked();if(b.length<11){Ext.getCmp("selectAllId").setValue(false);}if(b.length==11){Ext.getCmp("selectAllId").setValue("allCategory");}},});function addData(a,b){Ext.getCmp("displayGroup").setValue(b);
Ext.getCmp("groupName").setValue(a);Ext.getCmp("groupWindow").destroy();}function addGroupToArrayInCtrll(e){var b=new Array();var d=0;if(e.checked==true){b[d++]=e.value;}else{var a=b.indexOf(e.value);b.splice(a,1);}}function loadTree(){selectedDomainDisplayName=Ext.getCmp("domainID").getValue();Ext.widget("window",{extend:"Ext.container.Container",alias:"widget.groupWindow",title:"Domain Groups",id:"groupWindow",padding:"5px 10px 10px 10px",modal:true,border:false,floatable:true,floating:true,autoScroll:false,resizable:false,closeAction:"destory",doClose:function(){groupArray=new Array();
Ext.Ajax.request({url:"EgReplicateUser/data/EgReplicateUserJSON.jsp",method:"POST"});this.destroy();},layout:{type:"auto",},items:[{width:900,height:450,xtype:"egdomaingrouptree"},{xtype:"button",text:"View Selection",id:"viewSelect",width:100,ui:"newButtonSmall",margin:"2 0 10 360",handler:thisController.viewSelections,},{xtype:"button",text:"Apply",id:"applyBtn",width:80,ui:"newButtonSmall",margin:"2 0 10 20",handler:thisController.applyGroupName,}]}).show();
}function setSelectedGroupName(a){if(a!=null&&a.length>0){Ext.getCmp("displayGroup").setValue(a);}Ext.getCmp("groupWindow").destroy();}function setWindowTitle(a){Ext.getCmp("rightPane").setTitle(a);}function checkSpecial(d,b){obj_val=d.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;}