Merge pull request #19342 from owncloud/fix-15836

LDAP Wizard: enable/disable test login name button depending on wheth…
This commit is contained in:
Thomas Müller 2015-09-24 14:50:57 +02:00
commit c11bfa9177
2 changed files with 13 additions and 2 deletions

View File

@ -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);
}
});

View File

@ -52,7 +52,7 @@
placeholder="<?php p($l->t('Test Loginname'));?>"
class="ldapVerifyInput"
title="Attempts to receive a DN for the given loginname and the current login filter"/>
<button class="ldapVerifyLoginName" name="ldapTestLoginSettings" type="button">
<button class="ldapVerifyLoginName" name="ldapTestLoginSettings" type="button" disabled="disabled">
<?php p($l->t('Verify settings'));?>
</button>
</p>