diff --git a/apps/user_ldap/js/wizard/wizardTabLoginFilter.js b/apps/user_ldap/js/wizard/wizardTabLoginFilter.js index b73d267d16..0316db5b61 100644 --- a/apps/user_ldap/js/wizard/wizardTabLoginFilter.js +++ b/apps/user_ldap/js/wizard/wizardTabLoginFilter.js @@ -71,7 +71,8 @@ OCA = OCA || {}; ], 'ldap_login_filter_mode' ); - _.bindAll(this, 'onVerifyClick'); + _.bindAll(this, 'onVerifyClick', 'onTestLoginnameChange'); + this.managedItems.ldap_test_loginname.$element.keyup(this.onTestLoginnameChange); this.managedItems.ldap_test_loginname.$relatedElements.click(this.onVerifyClick); }, @@ -231,6 +232,16 @@ OCA = OCA || {}; } else { this.configModel.requestWizard('ldap_test_loginname', {ldap_test_loginname: testLogin}); } + }, + + /** + * enables/disables the "Verify Settings" button, depending whether + * the corresponding text input has a value or not + */ + onTestLoginnameChange: function() { + var loginName = this.managedItems.ldap_test_loginname.$element.val(); + var beDisabled = !_.isString(loginName) || !loginName.trim(); + this.managedItems.ldap_test_loginname.$relatedElements.prop('disabled', beDisabled); } }); diff --git a/apps/user_ldap/templates/part.wizard-loginfilter.php b/apps/user_ldap/templates/part.wizard-loginfilter.php index 8d9fccf24b..a13931d932 100644 --- a/apps/user_ldap/templates/part.wizard-loginfilter.php +++ b/apps/user_ldap/templates/part.wizard-loginfilter.php @@ -52,7 +52,7 @@ placeholder="t('Test Loginname'));?>" class="ldapVerifyInput" title="Attempts to receive a DN for the given loginname and the current login filter"/> -