Commits

Sebastian Sdorra committed 0067d7b

added ui for login attempt limit configuration

  • Participants
  • Parent commits d9a81c9

Comments (0)

Files changed (2)

File scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java

    *
    * @since 1.34
    */
+  @XmlElement(name = "login-attempt-limit-timeout")
   private long loginAttemptLimitTimeout = TimeUnit.MINUTES.toSeconds(5l);
 
   /** Field description */

File scm-webapp/src/main/webapp/resources/js/config/sonia.config.scmconfigpanel.js

   errorMsgText: 'Could not load config.',
   errorSubmitMsgText: 'Could not submit config.',
   
+  // TODO i18n
+  loginAttemptLimitText: 'Login Attempt Limit',
+  loginAttemptLimitTimeoutText: 'Login Attempt Limit Timeout',
+  
   enableProxyText: 'Enable Proxy',
   proxyServerText: 'Proxy Server',
   proxyPortText: 'Proxy Port',
   adminGroupsHelpText: 'Comma seperated list of groups with admin permissions.',
   adminUsersHelpText: 'Comma seperated list of users with admin permissions.',
   
+  // TODO i18n
+  loginAttemptLimitHelpText: 'Maximum allowed login attempts. Use -1 to disable the login attempt limit.',
+  loginAttemptLimitTimeoutHelpText: 'Timeout in seconds for users which are temporary disabled,\
+                                     because of too many failed login attempts.',
+  
   enableProxyHelpText: 'Enable Proxy',
   proxyServerHelpText: 'The proxy server',
   proxyPortHelpText: 'The proxy port',
           inputValue: 'true',
           helpText: this.allowAnonymousAccessHelpText
         },{
+          xtype: 'numberfield',
+          fieldLabel: this.loginAttemptLimitText,
+          name: 'login-attempt-limit',
+          allowBlank: false,
+          helpText: this.loginAttemptLimitHelpText          
+        },{
+          xtype: 'numberfield',
+          fieldLabel: this.loginAttemptLimitTimeoutText,
+          name: 'login-attempt-limit-timeout',
+          allowBlank: false,
+          helpText: this.loginAttemptLimitTimeoutHelpText          
+        },{
           xtype: 'checkbox',
           fieldLabel: this.enableProxyText,
           name: 'enableProxy',