FR.editSettings={};FR.editSettings.formPanel=new FR.components.editForm({title:"Security",autoScroll:true,layout:"form",defaults:{width:600},labelWidth:180,items:[{xtype:"fieldset",labelWidth:1,items:[{xtype:"checkbox",boxLabel:"Require two-factor authentication",name:"settings[passwords_require_2fa]",value:1,checked:parseInt(FR.settings.passwords_require_2fa),helpText:FR.T('Read more about this <a href="%1" target="_blank">here</a>.').replace("%1","https://docs.filerun.com/2-step_verification")},{xtype:"checkbox",boxLabel:"Force users to access via HTTPS.",width:400,value:1,name:"settings[force_https]",checked:parseInt(FR.settings.force_https)},{xtype:"checkbox",boxLabel:'Enable the "Forgot password?" option',value:1,name:"settings[password_recovery_enable]",checked:parseInt(FR.settings.password_recovery_enable)},{xtype:"checkbox",boxLabel:"Force users to change their passwords after reset.",value:1,name:"settings[password_recovery_force_change]",checked:parseInt(FR.settings.password_recovery_force_change)},{xtype:"checkbox",boxLabel:"Allow users to change their passwords.",value:1,name:"settings[allow_change_pass]",checked:parseInt(FR.settings.allow_change_pass)}]},{xtype:"fieldset",items:[{xtype:"textfield",width:60,fieldLabel:"Maximum login attempts",name:"settings[max_login_attempts]",value:FR.settings.max_login_attempts,helpText:FR.T("The user's account will be automatically deactivated after the last failed attempt.")+"<br>"+FR.T("The recommended value is 4.")},{xtype:"textfield",width:60,fieldLabel:"Inactivity timeout",name:"settings[logout_inactivity]",value:FR.settings.logout_inactivity,suffix:"minutes",helpText:FR.T("The user is automatically logged out after this defined number of minutes of inactivity.")+"<br>"+FR.T("Setting this to 0 will have the users permanently logged in until they sign out themselves.")}]},{xtype:"fieldset",disabled:FR.system.isFree,checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox",id:"settings[captcha]"},checkboxName:"settings[captcha]",title:FR.T('Enable <a href="%1" target="_blank">reCAPTCHA</a>').replace("%1","https://www.google.com/recaptcha"),animCollapse:true,collapsed:!parseInt(FR.settings.captcha),labelWidth:150,items:[{xtype:"textfield",fieldLabel:"Site key",width:280,name:"settings[recaptcha_site_key]",value:FR.settings.recaptcha_site_key},{xtype:"textfield",fieldLabel:"Secret key",width:280,name:"settings[recaptcha_secret_key]",value:FR.settings.recaptcha_secret_key},{xtype:"displayfield",hideLabel:true,style:"color: var(--theme-textLighter)",value:FR.T("Get them from %1").replace("%1",'<a href="https://www.google.com/recaptcha/admin" target="_blank"">https://www.google.com/recaptcha/admin</a>')}]}],tbar:[{text:"Save changes",cls:"fr-btn-primary",ref:"saveBtn",handler:function(){var editForm=this.ownerCt.ownerCt;var params=editForm.form.getFieldValues();var extra={};if(!FR.system.isFree){extra["settings[captcha]"]=Ext.get("settings[captcha]").dom.checked?1:0}Ext.apply(params,extra);var opts={url:FR.URLRoot+"/?module=cpanel&section=settings&action=save",maskText:"Saving changes...",params:params};editForm.submitForm(opts)}}]});Ext.getCmp("appTab").add(FR.editSettings.formPanel);Ext.getCmp("appTab").doLayout(false,true);