Ext.Msg.bodyPadding="10 0";Ext.Msg.cls="adminAlert";Ext.define("EgConfigureDomains.controller.Main",{extend:"Ext.app.Controller",views:["Main","EgViewDomains","DomainForm","Mywindow","InstallCertificateWizard","DomainConfiguarationPanel","ViewDomainData","DeleteDomains","ValidateDomainCredentials","ResultPanel","DeleteDomains","GridTemplate","UninstallCertificateWizard","ErrorPanel","DomainDetailsGrid","DomainGroupsInfoGrid","UpdateADUserDetails"],refs:[{ref:"domaintree",selector:"domaintree"},{selector:"main",ref:"main"},{selector:"viewdomains",ref:"viewdomains"},{selector:"domaintree",ref:"domaintree"},{selector:"mywindow",ref:"mywindow"},{selector:"domainform",ref:"domainform"},{selector:"installcertificatewizard",ref:"installcertificatewizard"},{selector:"uninstallcertificatewizard",ref:"uninstallcertificatewizard"},{selector:"domainconfiguarationpanel",ref:"domainconfiguarationpanel"},{selector:"viewdomaindata",ref:"viewdomaindata"},{selector:"deletedomains",ref:"deletedomains"},{selector:"validatedomaincredentials",ref:"validatedomaincredentials"},{selector:"resultpanel",ref:"resultpanel"},{selector:"deletedomains",ref:"deletedomains"},{selector:"gridtemplate",ref:"gridtemplate"},{selector:"updateuserdetails",ref:"updateuserdetails"}],init:function(){appCnt=this;
this.buildMainData();this.control({"main":{"boxready":this.afterMainRender},"domaintree":{"afterrender":this.loadTreeData,"itemmouseenter":this.showToolTip,"itemclick":this.loadDomainPage},'domaintree button[id="Expand"]':{"click":this.onExpandAllClick},'domaintree button[id="Collapse"]':{"click":this.onCollapseAllClick},'domainform radiogroup[id="dnsdiscover"]':{},"domainform #update":{"click":this.updateDomainDetails},'domainform button[id="validate"]':{"click":this.validateADServerCredentials},"domainform #domnam":{"blur":this.changeToUpperCase},'domainconfiguarationpanel combo[id="domAction"]':{"select":this.loadActionPage},'domainconfiguarationpanel combo[id="validation"]':{"select":this.showValidationContainer},'validatedomaincredentials button[id="validate"]':{"click":this.getValidationInfo},'validatedomaincredentials button[id="btnGetIP"]':{"click":this.getDNSStackTrace},'deletedomains button[id="delete"]':{"click":this.deleteDomain},"main #backButton":{"click":this.loadHomePage},"installcertificatewizard":{"afterrender":this.loadCertificateDetails},"uninstallcertificatewizard":{"afterrender":this.loadUninstallInfo},"gridtemplate":{},'updateuserdetails button[id="update"]':{"click":this.updateADUserDetails},});
},buildMainData:function(){Ext.Ajax.request({url:appURL,method:"POST",async:false,success:function(a){var b=a.responseText;publicJSON=Ext.decode(b);}});},loadHomePage:function(){if(selectedDomainGroupNode=="fromDiscovery"){var a="/final/admin/EgDiscoveryPane.jsp";window.location.href=a;}else{var c=this;
var b=Ext.getCmp("domainRightPanel");Ext.getCmp("backButton").hide();b.removeAll();b.add({xtype:"viewdomains"});Ext.getCmp("domainInfoHeader").update('<center><img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="iconAdminInfo" valign="middle">&nbsp;&nbsp;'+pageDisc2+"</center>");
c.displayAllDomains();delete b;}},showActions:function(a,b,d,g,f){var c=Ext.DomQuery.select(".x-action-col-icon",d);Ext.each(c,function(e){Ext.get(e).removeCls("x-hidden");});},hideActions:function(a,b,d,g,f){var c=Ext.DomQuery.select(".x-action-col-icon",d);Ext.each(c,function(e){Ext.get(e).addCls("x-hidden");
});},encodeFieldParams:function(e){var g="";var d=["duser","newpwd","domain_Pwd","$domainpassword"];var b=e.getFields().items;for(var c in b){var f=b[c].name;var a=b[c].value;if(Ext.isEmpty(f)||b[c].disabled||!appCnt.isExistsParam(d,f)){continue;}Ext.getCmp(b[c].id).submitValue=false;if(!Ext.isEmpty(a)){g+="&"+f+"="+encodeURIComponent(parent.filterEncode(a));
}}return g;},isExistsParam:function(d,c){var a,b;for(a=0,b=d.length;a<b;a++){if(d[a].toLowerCase()===c.toLowerCase()){return true;}}return false;},updateDomainDetails:function(){var d=this;var c=d.validateDomainForm();if(c==true){var b=c_type;var f="";if(b=="Add"){f="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=Add";
}else{if(b=="Modify"){f="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=Modify&"+queryStr;}else{if(b=="addChild"){f="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=addChild";}}}var h=Ext.getCmp("dnsdiscover");var g="";if(!Ext.isEmpty(h)&&h.isDisabled()){g="&dnsdiscover="+h.getValue().dnsdiscover;
}var a=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});a.show();var e=this.getDomainform().getForm();if(e.isValid()){this.getDomainform().submit({url:f+g,method:"POST",params:d.encodeFieldParams(e),timeout:120,success:function(i,l){a.hide();var k=Ext.decode(l.response.responseText);var q=k["requestStatus"];
var p="";if(q=="success"){var m=k["result"];p=m.title;if(m.message2==null||m.message2=="undefined"){Ext.Msg.show({title:p,msg:m.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation"});}else{Ext.Msg.show({title:p,msg:m.message1+". "+m.message2+".",width:400,buttons:Ext.Msg.OK,icon:"iconInformation"});
}if(b=="Add"){if(selectedDomainGroupNode=="fromDiscovery"){d.updateTree();Ext.Msg.show({title:p,msg:pageIntnl99+". "+pageIntn200,width:400,buttons:Ext.Msg.YESNO,icon:"iconInformation",fn:function(r){if(r=="yes"){d.addNewDomain();}else{d.loadHomePage();}}});}else{var n=Ext.getCmp("domainRightPanel");n.removeAll();
n.add({xtype:"viewdomains"});Ext.getCmp("backButton").hide();d.displayAllDomains();d.updateTree();}}else{if(b=="addChild"){d.updateTree();d.updateDomActionItems(Ext.getCmp("domainDisName").getValue());domainDetailsArray=publicJSON["domainSubValues"];var j=Ext.getCmp("resultViews");j.removeAll();j.add({xtype:"viewdomaindata"});
d.viewSelectedDomain();Ext.getCmp("domAction").setValue("View");}else{d.updateTree();d.updateDomActionItems(Ext.getCmp("domainDisName").getValue());domainDetailsArray=publicJSON["domainSubValues"];var j=Ext.getCmp("resultViews");j.removeAll();j.add({xtype:"viewdomaindata"});d.viewSelectedDomain();Ext.getCmp("domAction").setValue("View");
}}}else{var m=k["errors"];if(m.type==null||m.type=="undefined"){Ext.Msg.show({title:p,msg:m.message1+".",buttons:Ext.Msg.OK,icon:"iconError"});}else{p=m.title;var o=d.getErrorMessageTemplate();d.showResultWindow(p,o.apply(m));}}},failure:function(i,j){switch(j.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.show({title:"Failure",msg:"Form fields may be submitted with invalid values.",buttons:Ext.Msg.OK,icon:"iconError"});
break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.show({title:"Failure",msg:"Ajax communication failed.",buttons:Ext.Msg.OK,icon:"iconError"});break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.show({title:"Failure",msg:j.result.msg+".",buttons:Ext.Msg.OK,icon:"iconError"});}a.hide();}});
}}},deleteParticularDomains:function(a,h,k){var j=Ext.getCmp("domainGrid").getStore().getAt(h);var b=j.get("Display Name");var d="";var e="EgConfigureDomains/data/EgAuthenticationsJson.jsp?ctype=delete&subjectypes="+encodeURIComponent(b);this.updatedomainTree(e);var i=publicJSON["isUserExits"];var c=publicJSON["isUserExistInSubDomain"];
if(i==false&&c==false){var g="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=Delete&subjectypes="+encodeURIComponent(b);var f=this;Ext.MessageBox.confirm({title:pageTitle,msg:confirmMsg3,icon:"iconConfirmation",buttons:Ext.Msg.YESNO,width:400,fn:function(l){if(l=="yes"){f.deleteAllDomains1(g);
}}});}else{Ext.Msg.show({title:pageIntn201,msg:pageIntn202,buttons:Ext.Msg.OK,icon:"iconInformation"});Ext.getCmp("domainGrid").getStore().loadRawData(publicJSON["alldomains"]);Ext.getCmp("domainGrid").getSelectionModel().deselectAll(true);}},deleteCheckedDomains:function(){var e=Ext.getCmp("domainGrid").getSelectionModel().getSelection();
if(e.length==0){Ext.Msg.show({title:pageTitle,msg:pageIntn204,buttons:Ext.Msg.OK,icon:"iconExclamation"});Ext.getCmp("domainGrid").getSelectionModel().deselectAll(true);return;}var c="";var h=new Array();var b="";var a="";for(var d=0;d<e.length;d++){c=e[d];id=c.get("Display Name");isUserExist=c.get("isUserExist");
if(id!=null&&isUserExist==false){a+=id+"~!~";}}if(a!=null&&a.length>0){var g="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=Delete&subjectypes="+encodeURIComponent(a);var f=this;Ext.MessageBox.confirm({title:pageTitle,msg:confirmMsg3,icon:"iconConfirmation",buttons:Ext.Msg.YESNO,width:400,fn:function(i){if(i=="yes"){f.deleteAllDomains1(g);
}}});}else{Ext.Msg.show({title:pageIntn201,msg:pageIntn202,buttons:Ext.Msg.OK,icon:"iconInformation"});Ext.getCmp("domainGrid").getStore().loadRawData(publicJSON["alldomains"]);Ext.getCmp("domainGrid").getSelectionModel().deselectAll(true);}},deleteAllDomains1:function(d){var c=this;var a=new Ext.LoadMask(Ext.getBody(),{msg:"Deleting..."});
a.show();var b=c.getViewdomains().getForm();if(b.isValid()){c.getViewdomains().submit({url:d,method:"POST",timeout:120,success:function(f,g){a.hide();var e=Ext.decode(g.response.responseText);Ext.Msg.show({title:pageTitle,msg:e.result.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation"});c.updatedomainTree("EgConfigureDomains/data/EgViewDomainsJson.jsp?date="+new Date().getTime());
c.updateTree();Ext.getCmp("domainGrid").getStore().loadRawData(publicJSON["alldomains"]);Ext.getCmp("domainGrid").getSelectionModel().deselectAll(true);},failure:function(e,f){a.hide();}});}},deleteAllDomains:function(b){var a=this;Ext.MessageBox.confirm({title:pageTitle,msg:confirmMsg,icon:"iconConfirmation",buttons:Ext.Msg.YESNO,width:400,fn:function(c){if(c=="yes"){a.deleteAllDomains1(b);
}}});},updatedomainTree:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var c=b.responseText;publicJSON=Ext.decode(c);}});},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();},loadTreeData:function(){var a=Ext.getCmp("domainTreePanel");Ext.Ajax.request({url:"EgConfigureDomains/data/EgBuildTreeJSON.jsp",method:"POST",success:function(c,e){var f=c.responseText;if(!Ext.isEmpty(f)){var d=Ext.decode(f);d["expanded"]=true;a.setRootNode(d);var b=a.getStore().getNodeById(selectedDomainGroupNode);
a.getSelectionModel().select(b);Ext.get("Expand").on("click",function(h,j,g){var i=Ext.getCmp("Expand");if(i.currentStatus=="expanded"){i.update('<div style="cursor:pointer;text-decoration:underline;float:right;font-size:9px;padding:2px;text-transform: lowercase;" id="exx">'+pageIntnl80+"</div>");i.currentStatus="collapse";
Ext.getCmp("domainTreePanel").collapseAll();}else{i.currentStatus="expanded";i.update('<div style="cursor:pointer;text-decoration:underline;float:right;font-size:9px;padding:2px;text-transform: lowercase;" id="exx">'+pageIntnl81+"</div>");Ext.getCmp("domainTreePanel").expandAll();}});}},failure:function(b,c){}});
},windowopen:function(){},validateADServerCredentials:function(d){var c=this;d.setDisabled(true);var b=this.validateDomainForm();if(b==true){var e="<table width='670' border='0' height='170px'><tr><td align=center valign=bottom><img src=/final/monitor/eg_images/indicator_medium.gif></td></tr><tr><td align=center vlaign=top>Validating domain server credentials...<br>This may take a few minutes...</td></tr></table>";
var a=Ext.getCmp("validateAdServer");Ext.create("EgConfigureDomains.view.Mywindow",{title:"Validating AD server credentials",closeAction:"destory",id:"validateAdServer",html:e,height:250,align:"center",width:700,padding:"5 10 10 10",modal:true,autoScroll:true,listeners:{"afterrender":function(){c.validateDomainCredentials();
}},scroll:true,doClose:function(){d.setDisabled(false);this.destroy();},}).show();}else{d.setDisabled(false);}},validateDomainCredentials:function(){var k=this;var c=this.getDomainform().getForm();var b="EgConfigureDomains/data/validateADServerCredentials.jsp?";var m=Ext.getCmp("subjectypes").getValue();
var d=Ext.getCmp("domnam").getValue();var i=Ext.getCmp("duser").getValue();var j=Ext.getCmp("newpwd").getValue();var a=Ext.getCmp("domAliasName").getValue();var l="";var f="";var h="";var e="";if(c.findField("dns").getValue()){l="Yes";}else{h=Ext.getCmp("dmnip").getValue();e=Ext.getCmp("prtno").getValue();
l="no";}if(c.findField("sslEnabled").getValue()){f="Yes";}else{f="no";}var g="domainDisName="+encodeURIComponent(parent.filterEncode(m))+"&domainName="+d+"&domain_User="+encodeURIComponent(parent.filterEncode(i))+"&domain_Pwd="+encodeURIComponent(parent.filterEncode(j))+"&ssl="+f+"&dnsMode="+l+"&serverIP="+h+"&port="+e+"&opt="+c_type+"&domAliasName="+a;
b=b+g;Ext.Ajax.request({url:b,method:"POST",success:function(n){var o=n.responseText;Ext.getCmp("validateAdServer").update(o);}});},showToolTip:function(i,b,g,c,h,f){var d=b.raw.customqtip;if(d!=null&&d!=undefined){var a=Ext.create("Ext.tip.ToolTip",{target:h.getTarget(),anchor:"top",hideDelay:0,autoHide:true,trackMouse:true,cls:"yellowTip",html:d}).showAt(h.getXY());
if(!Ext.isEmpty(a)){a.destroy();a=null;}}},loadDomainPage:function(g,c,i,e,a){if(selectedDomainGroupNode=="fromDiscovery"){}else{var f=this;var d=Ext.getCmp("domainRightPanel");var h=c.data.text;var b=c.data.id;var j=c.raw.link;Ext.getCmp("backButton").hide();if(h!="undefined"&&!Ext.isEmpty(h)){if(h=="Domain(s)"){d.removeAll();
d.add({xtype:"viewdomains"});Ext.getCmp("domainInfoHeader").update('<center><img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="iconAdminInfo" valign="middle">&nbsp;&nbsp;'+pageDisc2+"</center>");f.displayAllDomains();f.enableAllToolbarControls();}else{d.removeAll();
d.add({xtype:"domainconfiguarationpanel"});f.updateDomActionItems(h);Ext.getCmp("domainInfoHeader").update('<center><img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="iconAdminInfo" valign="middle">&nbsp;&nbsp;'+pageDisc+"</center>");Ext.getCmp("domainDisName").setValue(h);
domainDetailsArray=publicJSON["domainSubValues"];f.viewSelectedDomain();}}}},enableAllToolbarControls:function(){var a=publicJSON["isDomainConfigured"];Ext.getCmp("addNewDomain").setDisabled(false);if(a==true){Ext.getCmp("deleteAllDomain").setDisabled(false);}else{Ext.getCmp("deleteAllDomain").setDisabled(true);
Ext.getCmp("deleteCheckedDomains").setDisabled(true);}Ext.getCmp("installCert").setDisabled(false);Ext.getCmp("uninstallCert").setDisabled(false);},disableAllToolbarControls:function(){Ext.getCmp("addNewDomain").setDisabled(true);Ext.getCmp("deleteAllDomain").setDisabled(true);Ext.getCmp("deleteCheckedDomains").setDisabled(true);
Ext.getCmp("installCert").setDisabled(true);Ext.getCmp("uninstallCert").setDisabled(true);},disableDeleteIcon:function(){Ext.getCmp("deleteAllDomain").setDisabled(true);Ext.getCmp("deleteCheckedDomains").setDisabled(true);},afterMainRender:function(){var b=this;var a=Ext.getCmp("domainRightPanel");if(selectedDomainGroupNode=="domainroot"){a.removeAll();
a.add({xtype:"viewdomains"});Ext.getCmp("domainInfoHeader").update('<center><img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="iconAdminInfo" valign="middle">&nbsp;&nbsp;'+pageDisc2+"</center>");b.displayAllDomains();b.enableAllToolbarControls();delete domainGridObj;
delete gridCols;delete gridColums;}else{if(selectedDomainGroupNode=="fromDiscovery"){b.addNewDomain();}else{a.removeAll();a.add({xtype:"domainconfiguarationpanel"});b.updateDomActionItems(selectedDomainGroupNode);Ext.getCmp("domainInfoHeader").update('<center><img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="iconAdminInfo" valign="middle">&nbsp;&nbsp;'+pageDisc+"</center>");
Ext.getCmp("domainDisName").setValue(selectedDomainGroupNode);domainDetailsArray=publicJSON["domainSubValues"];b.viewSelectedDomain();}}},changeDomainDiscovery:function(b){var a=this.getDomainform().getForm();if(c_type!=""&&c_type=="addChild"){Ext.getCmp("dns1").setValue(true);Ext.Msg.show({title:pageTitle,msg:pageIntnl79+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}if(a.findField("dns").getValue()){a.findField("parentDomn").hide();a.findField("dmnip").hide();a.findField("prtno").hide();}else{a.findField("parentDomn").show();a.findField("dmnip").show();a.findField("prtno").show();}},onExpandAllClick:function(){Ext.getCmp("domainTreePanel").expandAll();
},onCollapseAllClick:function(){Ext.getCmp("domainTreePanel").collapseAll();},getHiddenFields:function(){hiddenQstr="";var a=publicJSON["hiddenFields"];for(key in a){hiddenQstr+=key+"="+encodeURIComponent(a[key])+"&";}return hiddenQstr;},updateTree:function(){var a=Ext.getCmp("domainTreePanel");Ext.Ajax.request({url:"EgConfigureDomains/data/EgBuildTreeJSON.jsp?date="+new Date().getTime(),method:"POST",async:false,success:function(c,e){var f=c.responseText;
if(!Ext.isEmpty(f)){var d=Ext.decode(f);d["expanded"]=true;a.setRootNode(d);var b=a.getStore().getNodeById(selectedDomainGroupNode);a.getSelectionModel().select(b);}}});},displayAllDomains:function(){var a=this;this.updatedomainTree("EgConfigureDomains/data/EgViewDomainsJson.jsp");Ext.getCmp("domainGrid").getStore().loadRawData(publicJSON.alldomains);
if(Ext.isEmpty(publicJSON.alldomains)){a.disableDeleteIcon();}},installCert:function(){var a=Ext.getCmp("installADCert");if(a==null||a=="undefined"){a=Ext.create("EgConfigureDomains.view.Mywindow",{title:"SSL Certificate Installation",id:"installADCert",padding:"5 10 10 10",modal:true,doClose:function(){Ext.Ajax.request({url:"EgConfigureDomains/data/EgBuildTreeJSON.jsp",method:"POST",});
this.destroy();},items:[{xtype:"installcertificatewizard"}]}).show();}},loadCertificateDetails:function(){var a="EgConfigureDomains/data/EgSSLCertificateUploaderJson.jsp?mode=install";this.updateCertInfo(a);var b=certificateStoreJSON["keystorePath"];Ext.getCmp("Path").setValue(b);},loadUninstallInfo:function(){var a="EgConfigureDomains/data/EgSSLCertificateUploaderJson.jsp?mode=uninstall&doExecute=delete";
this.updateCertInfo(a);var c=Ext.getCmp("tmpAlias");c.getStore().loadRawData(certificateStoreJSON["tmpAlias"]);c.setValue("-1");var b=certificateStoreJSON["keystorePath"];Ext.getCmp("Path").setValue(b);},viewInstalledCert:function(){var a="EgConfigureDomains/data/EgSSLCertificateUploaderJson.jsp?mode=view&doExecute=view";
this.updateCertInfo(a);if(Ext.isEmpty(certificateStoreJSON["allCerts"])){Ext.Msg.show({title:"SSL Certificate info",msg:"No SSL certificates have been installed.",buttons:Ext.Msg.OK,width:300,icon:"iconInformation",fn:closeAlert});return;}else{var b=Ext.getCmp("viewinstalledADCert");if(b==null||b==undefined){b=Ext.create("EgConfigureDomains.view.Mywindow",{title:"Domain SSL Certificates",id:"viewinstalledADCert",width:950,height:400,scroll:true,autoScroll:true,modal:true,doClose:function(){Ext.Ajax.request({url:"EgConfigureDomains/data/EgBuildTreeJSON.jsp",method:"POST",});
this.destroy();},closeAction:"destroy",items:[{xtype:"grid",ui:"newGridPanel",border:true,margin:"20 10 10 10",store:new Ext.data.Store({fields:["AliasName","CertificateIssuerName","Version","CertificateValidity"],data:certificateStoreJSON["allSSLCerts"]}),columns:[{dataIndex:"AliasName",header:"Alias Name",flex:1,menuDisabled:true},{dataIndex:"CertificateIssuerName",header:"Certificate Issuer Name",flex:1,menuDisabled:true},{dataIndex:"Version",header:"Version",flex:1,menuDisabled:true},{dataIndex:"CertificateValidity",header:"Certificate Validity",flex:1,sortable:false,menuDisabled:true}],hideHeaders:false}]}).show();
}}},updateCertInfo:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){var c=b.responseText;certificateStoreJSON=Ext.decode(c);}});},unInstallCert:function(){var a=Ext.getCmp("uninstallADCert");if(a==null||a=="undefined"){a=Ext.create("EgConfigureDomains.view.Mywindow",{title:"Uninstall SSL Certificate",id:"uninstallADCert",padding:"5 10 10 10",modal:true,doClose:function(){Ext.Ajax.request({url:"EgConfigureDomains/data/EgBuildTreeJSON.jsp",method:"POST",});
this.destroy();},items:[{xtype:"uninstallcertificatewizard"}]}).show();}},removeCertificate:function(){var e=this;var c=Ext.getCmp("tmpAlias");var d=c.getValue();if(d=="-1"){Ext.Msg.show({title:pageTitle,msg:pageIntnl59+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}var f=c.getDisplayValue();
var g="../servlet/com.egurkha.EgCertificateController?date="+new Date().getTime()+"&aliasName="+f+"&doMethod=delete&certName="+d;var a=new Ext.LoadMask(Ext.getBody(),{msg:"Uninstalling..."});a.show();var b=this.getUninstallcertificatewizard().getForm();if(b.isValid()){this.getUninstallcertificatewizard().submit({url:g,method:"POST",timeout:120,success:function(i,j){a.hide();
var h=Ext.decode(j.response.responseText);if(h.requestStatus=="success"){Ext.Msg.show({title:"Uninstall Certificate",msg:pageIntnl60+" "+pageIntnl61,buttons:Ext.Msg.OK,icon:"iconInformation"});e.loadUninstallInfo();}else{Ext.Msg.show({title:"Uninstall Failed",msg:pageIntnl62,buttons:Ext.Msg.OK,icon:"iconError"});
}},failure:function(h,i){a.hide();}});}},certificateValidation:function(){var i=this;var k="cer";var h=Ext.getCmp("aliasName").getValue();var g=Ext.getCmp("storePass").getValue();var a=Ext.getCmp("certfile").getValue();if(!checkblank(h)){Ext.Msg.show({title:pageTitle,msg:pageIntnl53+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(l){Ext.getCmp("aliasName").focus(true);
}});return false;}else{if(!checkblank(g)){Ext.Msg.show({title:pageTitle,msg:pageIntnl54+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(l){Ext.getCmp("storePass").focus(true);}});return false;}}if(isDoubleByteEnabled=="false"){if(!validateSingleByte(a)){Ext.Msg.show({title:pageTitle,msg:pageIntnl56+".",width:400,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}}if((a.toLowerCase().indexOf(k))==-1){Ext.Msg.show({title:pageTitle,msg:pageIntnl55+", '"+k+"'"+".",width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}var d=certificateStoreJSON["allCerts"];for(var j in d){var e=d[j];if(e.toLowerCase()==h.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:pageIntnl58+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(l){Ext.getCmp("aliasName").focus(true);
}});return false;}}var f="../servlet/com.egurkha.EgCertificateController?date="+new Date().getTime()+"&aliasName="+h+"&storePass="+encodeURIComponent(g)+"&doMethod=install";var c=new Ext.LoadMask(Ext.getBody(),{msg:"Installing..."});c.show();var b=this.getInstallcertificatewizard().getForm();if(b.isValid()){this.getInstallcertificatewizard().submit({url:f,method:"POST",timeout:120,success:function(n,o){c.hide();
var m=Ext.decode(o.response.responseText);if(m.requestStatus=="success"){Ext.Msg.show({title:pageTitle,msg:pageIntnl63+" "+pageIntnl61,buttons:Ext.Msg.OK,icon:"iconInformation",});var l="EgConfigureDomains/data/EgSSLCertificateUploaderJson.jsp?mode=install";i.updateCertInfo(l);}else{Ext.Msg.show({title:pageTitle,msg:pageIntnl64,buttons:Ext.Msg.OK,icon:"iconError",});
}},failure:function(l,m){c.hide();}});}},changeToUpperCase:function(b){var a=Ext.getCmp("domnam").getValue();var a=a.toUpperCase();Ext.getCmp("domnam").setValue(a);},updateDomActionItems:function(b){var c=Ext.getCmp("domAction");var a="EgConfigureDomains/data/EgAuthenticationsJson.jsp?subjectypes="+encodeURIComponent(b);
this.updatedomainTree(a);c.getStore().loadRawData(publicJSON["actionItems"]);c.setValue(c.getStore().getAt(0).get("valueField"));},getSelectedDomainDetails:function(b){var a="";Ext.Ajax.request({url:b,method:"POST",async:false,success:function(c){var d=c.responseText;a=Ext.decode(d);}});return a;},viewSelectedDomain:function(){var p=new Array();
var q=Ext.getCmp("domainDisName").getValue();var e=domainDetailsArray.parent_domain_name;var d=domainDetailsArray.dnsdiscover;var i=domainDetailsArray.domAlias;var j=domainDetailsArray.domAliasName;var h=domainDetailsArray.ssl;var g=domainDetailsArray.domainName;var n=domainDetailsArray.duser;var o=domainDetailsArray.domainPassword;
var b=domainDetailsArray.dmnip;var f=domainDetailsArray.prtno;var l=domainDetailsArray.authenMode;var c=domainDetailsArray.saveDomainPwdAuth;var k=domainDetailsArray.defaultDomain;var m=domainDetailsArray.showusrdetail;var r={value:q,fieldLabel:pageIntnl4,};p.push(r);r={value:(d.toLowerCase()=="yes"?"Auto":"Manual"),fieldLabel:pageIntnl5,};
p.push(r);r={value:g,fieldLabel:pageIntnl8,};p.push(r);r={value:(i.toLowerCase()=="yes"?"Yes":"No"),fieldLabel:pageIntnl93,};p.push(r);if(i=="Yes"){r={value:j,fieldLabel:pageIntnl94,};p.push(r);}if(d=="No"){r={value:e,fieldLabel:pageIntnl9,};p.push(r);r={value:b,fieldLabel:pageIntnl10,};p.push(r);r={value:f,fieldLabel:"<b>"+pageIntnl11+"</b>",};
p.push(r);}r={value:n,fieldLabel:pageIntnl12,};p.push(r);if(h.toLowerCase()=="true"){h="Yes";}else{h="No";}r={value:h,fieldLabel:pageIntnl14,};p.push(r);r={value:l,fieldLabel:pageIntnl17,};p.push(r);r={value:c,fieldLabel:pageIntnl20,columnWidth:1};p.push(r);r={value:k,fieldLabel:pageIntnl92,columnWidth:1};
p.push(r);if(!Ext.isEmpty(l)&&l!=null&&l!=undefined&&l=="Ldap"){r={value:m,fieldLabel:"Discover User Details from AD",columnWidth:1};p.push(r);}var a=Ext.getCmp("displayFieldsContainer");a.removeAll();a.add(p);this.getViewdomaindata().doLayout();},modifyDomainDetails:function(){var c="";var u=this;c_type="Modify";
var v=Ext.getCmp("domainDisName").getValue();var k="EgConfigureDomains/data/EgAuthenticationsJson.jsp?ctype="+c_type+"&subjectypes="+encodeURIComponent(v);this.updatedomainTree(k);var f=publicJSON["isUserExistInSubDomain"];var v=Ext.getCmp("domainDisName").getValue();var s=domainDetailsArray.parent_domain_name;
var e=domainDetailsArray.dnsdiscover;var j=domainDetailsArray.domAlias;var l=domainDetailsArray.domAliasName;var i=domainDetailsArray.ssl;var h=domainDetailsArray.domainName;var o=domainDetailsArray.duser;var r=domainDetailsArray.domainPassword;var b=domainDetailsArray.dmnip;var g=domainDetailsArray.prtno;
var n=domainDetailsArray.authenMode;var d=domainDetailsArray.saveDomainPwdAuth;var m=domainDetailsArray.defaultDomain;var q=domainDetailsArray.showusrdetail;var t=Ext.getCmp("resultViews");t.removeAll();t.add({xtype:"domainform"});Ext.getCmp("update").setText("Update");Ext.getCmp("subjectypes").setReadOnly(true);
Ext.getCmp("subjectypes").setValue(v);c="$domain="+encodeURIComponent(v);var a=publicJSON["parentDomainArray"];var p=Ext.getCmp("parentDomn");p.getStore().loadRawData(a);p.setValue(s);if(m.toLowerCase()=="yes"){Ext.getCmp("yesDefault").setValue(true);}else{Ext.getCmp("noDefault").setValue(true);}if(e.toLowerCase()=="yes"){c=c+"&previousDnsMode=Auto";
Ext.getCmp("dns").setValue(true);}else{c=c+"&previousDnsMode=Manual";c=c+"&$domainip="+encodeURIComponent(b);c=c+"&$portnumber="+encodeURIComponent(g);Ext.getCmp("dns1").setValue(true);Ext.getCmp("parentDomn").show();Ext.getCmp("dmnip").show();Ext.getCmp("dmnip").setValue(b);Ext.getCmp("prtno").show();
Ext.getCmp("prtno").setValue(g);}if(f){Ext.getCmp("dnsdiscover").setDisabled(true);}else{Ext.getCmp("dnsdiscover").setDisabled(false);}if(j.toLowerCase()=="true"||j.toLowerCase()=="yes"){c=c+"&$_domAlias=Yes";Ext.getCmp("domAliasYes").setValue(true);c=c+"&$domAliasName="+encodeURIComponent(l);Ext.getCmp("domAliasName").setValue(l);
Ext.getCmp("domAliasName").show();}else{c=c+"&$_domAlias=No";Ext.getCmp("domAliasNo").setValue(true);Ext.getCmp("domAliasName").setValue("");Ext.getCmp("domAliasName").hide();}c=c+"&$domainname="+encodeURIComponent(h);c=c+"&pdomain="+encodeURIComponent(s);c=c+"&$domainuser="+encodeURIComponent(o);c=c+"&$domainpassword="+encodeURIComponent(parent.filterEncode(r));
c=c+"&$_authenMode="+encodeURIComponent(n);Ext.getCmp("domnam").setValue(h);Ext.getCmp("duser").setValue(o);Ext.getCmp("newpwd").setValue(r);if(i.toLowerCase()=="true"||i.toLowerCase()=="yes"){c=c+"&$_ssl=Yes";Ext.getCmp("sslEnabled").setValue(true);}else{c=c+"&$_ssl=No";Ext.getCmp("sslEnabled1").setValue(true);
}if(n.toLowerCase()=="kerberos"){Ext.getCmp("authenmode").setValue(true);}else{Ext.getCmp("authenmode1").setValue(true);Ext.getCmp("showuserdetailsradio").show();}if(d.toLowerCase()=="true"||d.toLowerCase()=="yes"){c=c+"&$_saveDomainPwdAuth=Yes";Ext.getCmp("savePass").setValue(true);}else{c=c+"&$_saveDomainPwdAuth=No";
Ext.getCmp("savePass1").setValue(true);}if(q.toLowerCase()=="true"||q.toLowerCase()=="yes"){c=c+"&$_showuserdetails=Yes";Ext.getCmp("showuser").setValue(true);}else{c=c+"&$_showuserdetails=No";Ext.getCmp("hideuser").setValue(true);}queryStr=c;},deleteDomain:function(){var c=Ext.getCmp("domainDisName").getValue();
var e="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=delete&subjectypes="+encodeURIComponent(c);var d=this;var a=new Ext.LoadMask(Ext.getBody(),{msg:"Deleting..."});a.show();var b=this.getDeletedomains().getForm();if(b.isValid()){this.getDeletedomains().submit({url:e,method:"POST",timeout:120,success:function(i,j){a.hide();
var g=Ext.decode(j.response.responseText);Ext.Msg.show({title:pageTitle,msg:g.result.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation",});d.updatedomainTree("EgConfigureDomains/data/EgViewDomainsJson.jsp");var f=Ext.getCmp("domainTreePanel");var h=Ext.getCmp("domainRightPanel");d.updateTree();h.removeAll();
h.add({xtype:"viewdomains"});Ext.getCmp("domainGrid").getStore().loadRawData(publicJSON["alldomains"]);if(Ext.isEmpty(publicJSON.alldomains)){d.disableDeleteIcon();}},failure:function(f,g){a.hide();}});}},deleteSelectedDomain:function(){var e=Ext.getCmp("domainDisName").getValue();var c="EgConfigureDomains/data/EgAuthenticationsJson.jsp?ctype=delete&subjectypes="+encodeURIComponent(e);
this.updatedomainTree(c);var b=publicJSON["isUserExits"];var d=publicJSON["isUserExistInSubDomain"];var f=Ext.getCmp("resultViews");f.removeAll();if(b==false&&d==false){var g="<div><b>"+confirmMsg2+"&nbsp;</b><i>"+e+"</i>&nbsp;<b>"+pageIntnl91+"?</div>";var a=Ext.widget("deletedomains",{buttonAlign:"center",items:[{xtype:"container",margin:"20 0 10 0",style:{"text-align":"center","margin":"0 auto 20 auto"},html:g}],buttons:[{text:pageIntnl71,id:"delete",cls:"button20"}]});
f.add(a);}else{var g="<div style='margin:15% auto auto auto'><table border='0'  width='100%'><tr><td align='center' valign='middle'><div class='iconExclamation'></div><div class='commonErrorMsgText'>"+pageIntnl88+". "+pageIntnl89+".</div></td></tr></table></div>";var a=Ext.widget("deletedomains",{items:[{xtype:"component",style:{"text-align":"center"},html:g}]});
f.add(a);}Ext.getCmp("deletedomains").doLayout();},showValidationForm:function(){var d=Ext.getCmp("validation");var b="EgConfigureDomains/data/EgDomainValidationJson.jsp";var c=this.getSelectedDomainDetails(b);d.getStore().loadRawData(c["validationActions"]);d.setValue(d.getStore().getAt(0).get("valueField"));
var a=d.getStore().getAt(0).get("displayField");this.setDefaultSelections(a);},showValidationContainer:function(d){Ext.getCmp("validationResultPanel").hide();var c=this;var b=d.getValue();var a=d.getDisplayValue();if(b=="1"){c.setDefaultSelections(a);}else{if(b=="2"){c.validateCredentials(a);}else{if(b=="3"){c.doesUserExists(a);
}else{if(b=="4"){c.isLoginValid(a);}else{if(b=="5"){c.enumerateADGroups(a);}else{if(b=="6"){c.fectchDNSConfiguration(a);}}}}}}},fectchDNSConfiguration:function(e){var i=Ext.getCmp("domainDisName").getValue();var c=domainDetailsArray.domainName;var h=domainDetailsArray.saveDomainPwdAuth;var d=domainDetailsArray.duser;
var a=new Array();var b=Ext.getCmp("resultViews");b.removeAll();b.add({xtype:"validatedomaincredentials"});var j=Ext.getCmp("validattionControlsDiv");var g={xtype:"textfield",id:"subjectypes",name:"subjectypes",fieldLabel:pageIntnl4,cls:"textbox24",readOnly:true,value:i,};a.push(g);g={xtype:"textfield",id:"dname",name:"dname",fieldLabel:pageIntnl8,cls:"textbox24",readOnly:true,value:c,};
a.push(g);if(h!=null&&h.toLowerCase()=="false"||h.toLowerCase()=="no"){g={xtype:"textfield",id:"aduname",name:"aduname",fieldLabel:pageIntnl12,cls:"textbox24",value:d,readOnly:true,};a.push(g);g={xtype:"textfield",id:"adpwd",name:"adpwd",fieldLabel:pageIntnl13,cls:"textbox24",inputType:"password",};a.push(g);
}var f={xtype:"fieldset",id:"dnsFieldSet",margin:"20 20 10 0",width:"80%",title:e,collapsible:false,defaults:{labelSeparator:"",margin:5,width:500,labelWidth:250},layout:{type:"vbox",align:"center"},items:a};j.removeAll();j.add(f);Ext.getCmp("validate").setText(pageIntnl84);},enumerateADGroups:function(e){var i=Ext.getCmp("domainDisName").getValue();
var c=domainDetailsArray.domainName;var d=domainDetailsArray.duser;var h=domainDetailsArray.saveDomainPwdAuth;var a=new Array();var b=Ext.getCmp("resultViews");b.removeAll();b.add({xtype:"validatedomaincredentials"});var j=Ext.getCmp("validattionControlsDiv");var g={xtype:"textfield",id:"dname",name:"dname",readOnly:true,fieldLabel:pageIntnl8,cls:"textbox24",value:c,};
a.push(g);if(h!=null&&h.toLowerCase()=="false"||h.toLowerCase()=="no"){var g={xtype:"textfield",id:"aduname",name:"aduname",fieldLabel:pageIntnl12,cls:"textbox24",value:d,readOnly:true,};a.push(g);g={xtype:"textfield",id:"adpwd",name:"adpwd",fieldLabel:pageIntnl13,cls:"textbox24",inputType:"password",};
a.push(g);}var f={xtype:"fieldset",margin:"20 20 10 0",width:"80%",title:e,collapsible:false,defaults:{labelSeparator:"",margin:5,width:500,labelWidth:250},layout:{type:"vbox",align:"center"},items:a};j.removeAll();j.add(f);j.doLayout();Ext.getCmp("validate").setText(pageIntnl85);},doesUserExists:function(e){var i=Ext.getCmp("domainDisName").getValue();
var c=domainDetailsArray.domainName;var d=domainDetailsArray.duser;var j=domainDetailsArray.domainPassword;var h=domainDetailsArray.saveDomainPwdAuth;var a=new Array();var b=Ext.getCmp("resultViews");b.removeAll();b.add({xtype:"validatedomaincredentials"});var k=Ext.getCmp("validattionControlsDiv");var g={xtype:"textfield",id:"dname",name:"dname",fieldLabel:pageIntnl8,readOnly:true,cls:"textbox24",value:c,};
a.push(g);if(h!=null&&h.toLowerCase()=="false"||h.toLowerCase()=="no"){g={xtype:"textfield",id:"aduname",name:"aduname",fieldLabel:pageIntnl12,cls:"textbox24",value:d,readOnly:true,};a.push(g);g={xtype:"textfield",id:"adpwd",name:"adpwd",fieldLabel:pageIntnl13,cls:"textbox24",inputType:"password",};a.push(g);
}g={xtype:"textfield",id:"uname",name:"uname",fieldLabel:pageIntnl72,cls:"textbox24",};a.push(g);var f={xtype:"fieldset",margin:"20 20 10 0",width:"80%",title:e,collapsible:false,defaults:{labelSeparator:"",margin:5,width:500,labelWidth:250},layout:{type:"vbox",align:"center"},items:a};k.removeAll();
k.add(f);Ext.getCmp("validate").setText(pageIntnl31);},isLoginValid:function(e){var i=Ext.getCmp("domainDisName").getValue();var c=domainDetailsArray.domainName;var d=domainDetailsArray.duser;var j=domainDetailsArray.domainPassword;var h=domainDetailsArray.saveDomainPwdAuth;var a=new Array();var b=Ext.getCmp("resultViews");
b.removeAll();b.add({xtype:"validatedomaincredentials"});var k=Ext.getCmp("validattionControlsDiv");var g={xtype:"textfield",id:"dname",name:"dname",fieldLabel:pageIntnl8,cls:"textbox24",readOnly:true,value:c,};a.push(g);g={xtype:"textfield",id:"uname",name:"uname",fieldLabel:pageIntnl72,cls:"textbox24"};
a.push(g);g={xtype:"textfield",id:"upass",name:"upass",fieldLabel:pageIntnl73,cls:"textbox24",inputType:"password"};a.push(g);var f={xtype:"fieldset",margin:"20 20 10 0",width:"80%",title:e,collapsible:false,defaults:{labelSeparator:"",margin:5,width:500,labelWidth:250},layout:{type:"vbox",align:"center"},items:a};
k.removeAll();k.add(f);Ext.getCmp("validate").setText(pageIntnl86);},validateCredentials:function(e){var h=Ext.getCmp("domainDisName").getValue();var c=domainDetailsArray.domainName;var d=domainDetailsArray.duser;var i=domainDetailsArray.domainPassword;var a=new Array();var b=Ext.getCmp("resultViews");
b.removeAll();b.add({xtype:"validatedomaincredentials"});var j=Ext.getCmp("validattionControlsDiv");var g={xtype:"textfield",id:"dname",name:"dname",fieldLabel:pageIntnl8,readOnly:true,cls:"textbox24",value:c,};a.push(g);g={xtype:"textfield",id:"aduname",name:"aduname",fieldLabel:pageIntnl12,cls:"textbox24",value:d,readOnly:true,};
a.push(g);g={xtype:"textfield",id:"adpwd",name:"adpwd",fieldLabel:pageIntnl13,cls:"textbox24",inputType:"password",value:i};a.push(g);var f={xtype:"fieldset",margin:"20 20 10 0",width:"80%",title:e,collapsible:false,defaults:{labelSeparator:"",margin:5,width:500,labelWidth:250},layout:{type:"vbox",align:"center"},items:a};
j.removeAll();j.add(f);Ext.getCmp("validate").setText(pageIntnl31);},setDefaultSelections:function(e){var j=Ext.getCmp("domainDisName").getValue();var k=domainDetailsArray.parent_domain_name;var d=domainDetailsArray.domainName;var a=domainDetailsArray.dnsdiscover;var b=new Array();var c=Ext.getCmp("resultViews");
c.removeAll();c.add({xtype:"validatedomaincredentials"});var l=Ext.getCmp("validattionControlsDiv");var i={xtype:"textfield",id:"subjectypes",name:"subjectypes",fieldLabel:pageIntnl4,cls:"textbox24",value:j,readOnly:true,};b.push(i);i={xtype:"textfield",id:"dname",name:"dname",fieldLabel:pageIntnl8,cls:"textbox24",value:d,readOnly:true,};
if(a.toLowerCase()=="no"||a.toLowerCase()=="false"){var f=domainDetailsArray.dmnip;var g=domainDetailsArray.prtno;i={xtype:"textfield",id:"ip",name:"ip",fieldLabel:pageIntnl10,cls:"textbox24",value:f,readOnly:true,};b.push(i);i={xtype:"textfield",id:"prtno",name:"prtno",fieldLabel:pageIntnl11,cls:"textbox24",value:g,readOnly:true,};
b.push(i);}b.push(i);var h={xtype:"fieldset",margin:"20 20 10 0",width:"80%",title:e,collapsible:false,defaults:{labelSeparator:"",margin:5,width:500,labelWidth:250},layout:{type:"vbox",align:"center"},items:b};l.removeAll();l.add(h);l.doLayout();},loadActionPage:function(a){var b=this;var c=a.getValue();
c=c.toLowerCase();if(c=="view"){Ext.getCmp("validation").hide();var d=Ext.getCmp("resultViews");d.removeAll();d.add({xtype:"viewdomaindata"});b.viewSelectedDomain();}else{if(c=="modify"){Ext.getCmp("validation").hide();b.modifyDomainDetails();}else{if(c=="delete"){Ext.getCmp("validation").hide();b.deleteSelectedDomain();
}else{if(c=="validate"){Ext.getCmp("validation").show();b.showValidationForm();}else{if(c=="addchild"){b.addChildDomain();}else{if(c=="updateuserdetails"){Ext.getCmp("validation").hide();b.showADUpdateForm();}}}}}}},addChildDomain:function(){Ext.getCmp("backButton").show();c_type="addChild";var c=Ext.getCmp("domainDisName").getValue();
var a="EgConfigureDomains/data/EgAuthenticationsJson.jsp?ctype=Add";this.updatedomainTree(a);var d=Ext.getCmp("resultViews");d.removeAll();d.add({xtype:"domainform"});Ext.getCmp("dns1").setValue(true);var e=publicJSON["parentDomainArray"];var b=Ext.getCmp("parentDomn");b.getStore().loadRawData(e);b.setValue(c);
Ext.getCmp("parentDomn").show();Ext.getCmp("dmnip").show();Ext.getCmp("prtno").show();},getDNSStackTrace:function(f){var h=this;f.setDisabled(true);var i=Ext.getCmp("domainDisName").getValue();var k=Ext.getCmp("siteList").getValue();var b="/final/servlet/com.egurkha.ADAuthentication?";var d="domainName="+encodeURIComponent(i)+"&operation=7&siteName="+k;
b=b+d;var e=h.getSelectedDomainDetails(b);if(e["requestStatus"]=="success"){var a=e["serverIPs"];Ext.getCmp("validationResultPanel").hide();var c=Ext.getCmp("validationResultPanel2");c.removeAll();c.add({xtype:"gridtemplate"});Ext.getCmp("gridtemplate").getStore().sorters.clear();Ext.getCmp("gridtemplate").getStore().removeAll();
Ext.getCmp("gridtemplate").getStore().loadRawData(a);c.show();c.doLayout();}else{var j=e.errors;var g=h.getErrorMessageTemplate();Ext.getCmp("validationResultPanel").update(g.apply(j));Ext.getCmp("validationResultPanel").show();}f.setDisabled(false);},getDNSStackTraceInfo:function(e,a){var d=this;var c="/final/servlet/com.egurkha.ADAuthentication?operation=8&ip="+e+"&port="+a;
var b=d.getSelectedDomainDetails(c);if(b.requestStatus=="success"){Ext.Msg.show({title:"DNS Info",msg:b.message+".",buttons:Ext.Msg.OK,icon:"iconInformation",});}else{Ext.Msg.show({title:"DNS Info",msg:b.message+".",buttons:Ext.Msg.OK,icon:"iconError",});}},getReverseDNSStackTrace:function(d){var c=this;
var b="/final/servlet/com.egurkha.ADAuthentication?operation=9&ip="+d;var a=c.getSelectedDomainDetails(b);if(a.requestStatus=="success"){Ext.Msg.show({title:"DNS Info",msg:a.message+".",buttons:Ext.Msg.OK,icon:"iconInformation",});}else{Ext.Msg.show({title:"DNS Info",msg:a.message+".",buttons:Ext.Msg.OK,icon:"iconError",});
}},getErrorMessageTemplate:function(){var a=new Ext.XTemplate('<div class="plainTable plainTableShadow">','<table cellspacing="0" width="100%" cellpadding="0" border="0" ><col width="200px"><col width="70%">',"<thead>","<tr>",'<th colspan="2">Error : '+pageIntnl75+"</th>","</tr>","</thead>","<tbody>",'<tpl for=".">',"<tr>",'<td class="font_bold11">'+pageIntnl76+"</td>","<td>{ERROR}</td>","</tr>","<tr>",'<td class="font_bold11">'+pageIntnl77+"</td>","<td>{DESCRIPTION}</td>","</tr>","<tr>",'<td class="font_bold11">'+pageIntnl78+"</td>","<td>{RESOLUTION}</td>","</tr>","</tpl>","</tbody>","</table>","</div>");
return a;},getValidationInfo:function(n){var q=Ext.getCmp("validationResultPanel");q.show();var v=this;Ext.getCmp("validate").show();Ext.getCmp("btnGetIP").hide();var w=Ext.getCmp("domainDisName").getValue();var s=domainDetailsArray.parent_domain_name;var l=domainDetailsArray.domainName;var d=domainDetailsArray.saveDomainPwdAuth;
var g="/final/servlet/com.egurkha.ADAuthentication?";var b="";var u=Ext.getCmp("validation");var i=u.getValue();if(i=="1"){n.setDisabled(true);b="domainName="+encodeURIComponent(w)+"&operation=1";g=g+b;var k=v.getSelectedDomainDetails(g);if(k["requestStatus"]=="success"){q.update("<div><b>"+k.result.message1+"</b></div>");
q.show();}else{var j=k.errors;var e=v.getErrorMessageTemplate();q.update(e.apply(j));q.show();}}else{if(i=="2"){var m=Ext.getCmp("aduname");var a=Ext.getCmp("adpwd");if(!checkblank(a.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl44+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){a.focus(true);
}});return false;}b="domainName="+encodeURIComponent(w)+"&operation=2&domainUser="+encodeURIComponent(parent.filterEncode(m.getValue()))+"&domainPwd="+encodeURIComponent(parent.filterEncode(a.getValue()));g=g+b;n.setDisabled(true);var k=v.getSelectedDomainDetails(g);if(k["requestStatus"]=="success"){q.update("<div><b>"+k.result.message1+"</b></div>");
q.show();}else{var j=k.errors;var e=v.getErrorMessageTemplate();q.update(e.apply(j));q.show();}}else{if(i=="3"){var p=Ext.getCmp("uname");if(!checkblank(p.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl69+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){p.focus(true);}});return false;
}var c=p.getValue();b="domainName="+encodeURIComponent(w)+"&operation=3&user="+encodeURIComponent(c);if(d!=null&&d.toLowerCase()=="false"||d.toLowerCase()=="no"){var m=Ext.getCmp("aduname");var a=Ext.getCmp("adpwd");if(!checkblank(m.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl41+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){m.focus(true);
}});return false;}if(!checkblank(a.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl70+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){a.focus(true);}});return false;}b=b+"&domainUser="+encodeURIComponent(parent.filterEncode(m.getValue()))+"&domainPwd="+encodeURIComponent(parent.filterEncode(a.getValue()));
}g=g+b;n.setDisabled(true);var k=v.getSelectedDomainDetails(g);if(k["requestStatus"]=="success"){q.update("<div><b>"+k.result.message1+"</b></div>");q.show();}else{var j=k.errors;var e=v.getErrorMessageTemplate();q.update(e.apply(j));q.show();}}else{if(i=="4"){if(!checkblank(Ext.getCmp("uname").getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl69+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){Ext.getCmp("uname").focus(true);
}});return false;}if(!checkblank(Ext.getCmp("upass").getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl44+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){Ext.getCmp("upass").focus(true);}});return false;}var c=Ext.getCmp("uname").getValue();var f=Ext.getCmp("upass").getValue();b="domainName="+encodeURIComponent(w)+"&operation=4&user="+encodeURIComponent(parent.filterEncode(c))+"&userPass="+encodeURIComponent(parent.filterEncode(f));
g=g+b;n.setDisabled(true);var k=v.getSelectedDomainDetails(g);if(k["requestStatus"]=="success"){q.update("<div><b>"+k.result.message1+"</b></div>");q.show();}else{var j=k.errors;var e=v.getErrorMessageTemplate();q.update(e.apply(j));q.show();}}else{if(i=="5"){var m=Ext.getCmp("aduname");var a=Ext.getCmp("adpwd");
b="domainName="+encodeURIComponent(w)+"&operation=5";if(m!=null&&m!=undefined){if(!checkblank(m.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl41+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){m.focus(true);}});return false;}if(!checkblank(a.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl70+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){a.focus(true);
}});return false;}b=b+"&domainUser="+encodeURIComponent(parent.filterEncode(m.getValue()))+"&domainPwd="+encodeURIComponent(parent.filterEncode(a.getValue()));}g=g+b;n.setDisabled(true);var k=v.getSelectedDomainDetails(g);if(k["requestStatus"]=="success"){Ext.getCmp("validationResultPanel").hide();var o=Ext.getCmp("validationResultPanel2");
o.removeAll();o.add({xtype:"domaingroupsinfogrid"});Ext.getCmp("domaingroupsinfogrid").getStore().loadRawData(k.domainGroupArr);o.show();o.doLayout();}else{var j=k.errors;var e=v.getErrorMessageTemplate();q.update(e.apply(j));q.show();}}else{if(i=="6"){b="domainName="+encodeURIComponent(w)+"&operation=6";
if(d!=null&&d.toLowerCase()=="false"||d.toLowerCase()=="no"){var m=Ext.getCmp("aduname");var a=Ext.getCmp("adpwd");if(!checkblank(m.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl41+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){m.focus(true);}});return false;}if(!checkblank(a.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl70+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(x){a.focus(true);
}});return false;}b=b+"&domainUser="+encodeURIComponent(parent.filterEncode(m.getValue()))+"&domainPwd="+encodeURIComponent(parent.filterEncode(a.getValue()));}g=g+b;n.setDisabled(true);var k=v.getSelectedDomainDetails(g);if(k["requestStatus"]=="success"){var t=Ext.getCmp("dnsFieldSet");var h={xtype:"combo",id:"siteList",cls:"dropdown",editable:false,fieldLabel:pageIntnl87,store:new Ext.data.Store({fields:["displayField","valueField"],data:k["sites"]}),displayField:"displayField",valueField:"valueField",queryMode:"local"};
t.add(h);var r=Ext.getCmp("siteList");r.setValue(r.getStore().getAt(0).get("valueField"));t.doLayout();Ext.getCmp("validate").hide();Ext.getCmp("btnGetIP").show();}else{var j=k.errors;var e=v.getErrorMessageTemplate();q.update(e.apply(j));q.show();}}}}}}}n.setDisabled(false);},addNewDomain:function(){Ext.getCmp("domainInfoHeader").update('<center><img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="iconAdminInfo" valign="middle">&nbsp;&nbsp;'+pageDisc+"</center>");
Ext.getCmp("backButton").show();c_type="Add";var c=Ext.getCmp("domainRightPanel");c.removeAll();c.add({xtype:"domainform"});var a="EgConfigureDomains/data/EgAuthenticationsJson.jsp?ctype=Add";this.updatedomainTree(a);var d=publicJSON["parentDomainArray"];var b=Ext.getCmp("parentDomn");b.getStore().loadRawData(d);
b.setValue("none");},validateDomainForm:function(){var k="`~!@#$%^&*()+=[]{}|\\:;\"'<>?/";var i=" `~!@#$%^&*()+=[]{}|\\:;\"'<>?/";var g=" `~!#$%^&*()+=[]{}|\\:;\"'<>?/";var f=Ext.getCmp("domnam").getValue();var m=Ext.getCmp("subjectypes");var b=Ext.getCmp("domnam");var j=Ext.getCmp("duser");var e=Ext.getCmp("newpwd");
var c=Ext.getCmp("dmnip");var h=Ext.getCmp("prtno");var d=Ext.getCmp("dns1").getValue();var l=Ext.getCmp("domAliasYes").getValue();var a=Ext.getCmp("domAliasName");if(!checkblank(m.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl33+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){m.focus(true);
}});return false;}else{if(!validateSingleByte(m.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl34+".",buttons:Ext.Msg.OK,width:400,icon:"iconExclamation",fn:function(n){m.focus(true);}});return false;}else{if(!checkspecialnomess(m.getValue(),g)){Ext.Msg.show({title:pageTitle,msg:pageIntnl35+".",buttons:Ext.Msg.OK,width:400,icon:"iconExclamation",fn:function(n){m.focus(true);
}});return false;}else{if(parseInt(m.getValue())<0){Ext.Msg.show({title:pageTitle,msg:pageIntnl36+".",buttons:Ext.Msg.OK,width:400,icon:"iconExclamation",fn:function(n){m.focus(true);}});return false;}else{if(!checkblank(b.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl37+".",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(n){b.focus(true);
}});return false;}else{if(!validateSingleByte(b.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl38+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(n){b.focus(true);}});return false;}else{if(!checkspecialnomess(b.getValue()," !\"#$&()*+':;<=>?@[]^'{|}~,")){Ext.Msg.show({title:pageTitle,msg:pageIntnl39+".",buttons:Ext.Msg.OK,width:400,icon:"iconExclamation",fn:function(n){b.focus(true);
}});return false;}else{if((b.getValue()).charAt((b.getValue()).length-1)=="."){Ext.Msg.show({title:pageTitle,msg:_domainPeriod+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){b.focus(true);}});return false;}else{if(f.indexOf(".")==-1){Ext.Msg.show({title:pageTitle,msg:pageIntnl40+".",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(n){b.focus(true);
}});return false;}else{if(!checkNonNumericals(b.getValue())){Ext.Msg.show({title:pageTitle,msg:_aplhabets+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){b.focus(true);}});return false;}else{if(!checkblank(j.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl41+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){j.focus(true);
}});return false;}else{if(!checkspecial(j.getValue(),"@*+=|:;\"'<>/[]?,")){j.focus(true);return false;}else{if(trim(j.getValue())==""){Ext.Msg.show({title:pageTitle,msg:pageIntnl42+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){j.focus(true);}});return false;}else{if(j.getValue().indexOf("..")>-1){Ext.Msg.show({title:pageTitle,msg:_checkdots+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){j.focus(true);
}});return false;}else{if((j.getValue()).indexOf("  ")>-1){Ext.Msg.show({title:pageTitle,msg:_checkSpaces+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){j.focus(true);}});return false;}else{if(!validateSingleByte(j.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl43+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(n){j.focus(true);
}});return false;}else{if(e.getValue()==""){Ext.Msg.show({title:pageTitle,msg:pageIntnl44+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){e.focus(true);}});return false;}else{if(!checkblank(e.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl44+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){e.focus(true);
}});return false;}else{if(!checkspecialnomess(e.getValue(),'"')){Ext.Msg.show({title:pageTitle,msg:_notAllowCharInPwd+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){e.focus(true);}});return false;}else{if(!validateSingleByte(e.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl45+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(n){e.focus(true);
}});return false;}else{if(l==true&&!checkblank(a.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl95+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){a.focus(true);}});return false;}else{if(l==true&&!validateSingleByte(a.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl96+".",buttons:Ext.Msg.OK,width:500,icon:"iconExclamation",fn:function(n){a.focus(true);
}});return false;}else{if(l==true&&!checkspecialnomess(a.getValue()," !\"#$&()*+':;<=>?@[]^'{|}~,")){Ext.Msg.show({title:pageTitle,msg:pageIntnl98+".",buttons:Ext.Msg.OK,width:400,icon:"iconExclamation",fn:function(n){a.focus(true);}});return false;}else{if(l==true&&(a.getValue()).charAt((a.getValue()).length-1)=="."){Ext.Msg.show({title:pageTitle,msg:domAlaisNamePeriod+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){a.focus(true);
}});return false;}else{if(l==true&&a.getValue().indexOf(".")==-1){Ext.Msg.show({title:pageTitle,msg:pageIntnl97+".",buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(n){a.focus(true);}});return false;}else{if(l==true&&!checkNonNumericals(a.getValue())){Ext.Msg.show({title:pageTitle,msg:_aplhabets+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){a.focus(true);
}});return false;}else{if(d==true&&!checkblank(c.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl46+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){c.focus(true);}});return false;}else{if(d==true&&!validateIp(c.getValue())){c.focus(true);return false;}else{if(d==true&&!checkspace(c.getValue())){c.focus(true);
return false;}else{if(d==true&&!checkspecial(c.getValue(),"`~!@#$%^&*()+={}[]|\\;\"'<>,?/")){c.focus(true);return false;}else{if(d==true&&!validateSingleByte(c.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl47+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){c.focus(true);}});return false;
}else{if(d==true&&!checkblank(h.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl48+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){h.focus(true);}});return false;}else{if(d==true&&!checknumber("+",h.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl49+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){h.focus(true);
}});return false;}else{if(d==true&&!checkfordecimal(h.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl50+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){h.focus(true);}});return false;}else{if(d==true&&h.getValue()=="0"){Ext.Msg.show({title:pageTitle,msg:pageIntnl51+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){h.focus(true);
}});return false;}else{if(d==true&&!checkspace(h.getValue())){Ext.Msg.show({title:pageTitle,msg:pageIntnl52+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(n){h.focus(true);}});return false;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return true;},showADUpdateForm:function(){var c=Ext.getCmp("domainDisName").getValue();
var b="EgConfigureDomains/data/EgAuthenticationsJson.jsp?ctype=updateADUserDetails&subjectypes="+encodeURIComponent(c);this.updatedomainTree(b);var d=publicJSON["isUserExits"];var e=Ext.getCmp("resultViews");e.removeAll();var f="<div><b>"+"Are you sure to update the User Details from AD for"+"&nbsp;</b><i>"+c+"</i>&nbsp;<b>"+pageIntnl91+" now ?</div>";
var a=Ext.widget("updateuserdetails",{buttonAlign:"center",items:[{xtype:"container",margin:"20 0 10 0",style:{"text-align":"center","margin":"0 auto 20 auto"},html:f}],buttons:[{text:"Update",id:"update",cls:"button20"}]});e.add(a);Ext.getCmp("updateuserdetails").doLayout();},updateADUserDetails:function(){var d="EgConfigureDomains/data/EgAuthenticationspJson.jsp?ctype=updateADUserDetails";
var c=this;var a=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});a.show();var b=this.getUpdateuserdetails().getForm();if(b.isValid()){this.getUpdateuserdetails().submit({url:d,method:"POST",timeout:18000,success:function(h,i){a.hide();var f=Ext.decode(i.response.responseText);Ext.Msg.show({title:f.result.title,msg:f.result.message1+".",buttons:Ext.Msg.OK,icon:"iconInformation",});
c.updatedomainTree("EgConfigureDomains/data/EgViewDomainsJson.jsp");var e=Ext.getCmp("domainTreePanel");var g=Ext.getCmp("domainRightPanel");c.updateTree();g.removeAll();g.add({xtype:"viewdomains"});Ext.getCmp("domainGrid").getStore().loadRawData(publicJSON["alldomains"]);if(Ext.isEmpty(publicJSON.alldomains)){c.disableDeleteIcon();
}},failure:function(e,f){a.hide();}});}}});function selectDomain(c){var a=Ext.getCmp("domainTreePanel");var b=a.getStore().getNodeById(c);a.getSelectionModel().select(b);var g=b.data.text;var f=b.data.id;var e=b.raw.link;var d=Ext.getCmp("domainRightPanel");d.removeAll();d.add({xtype:"domainconfiguarationpanel"});
appCnt.updateDomActionItems(g);Ext.getCmp("domainDisName").setValue(g);domainDetailsArray=publicJSON["domainSubValues"];appCnt.viewSelectedDomain();}function closeAlert(){Ext.Ajax.request({url:"EgConfigureDomains/data/EgBuildTreeJSON.jsp",method:"POST",});}