diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-12-04 20:33:12 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-12-04 20:33:12 +0400 |
commit | f24aca61a92dd6945687e7ca652a3ac2e5c5da19 (patch) | |
tree | 67afe4bdecc9e51074ead2be3dd86c48d98edbd6 | |
parent | d3e2226b38d9df40e0f7c311f080ae633ad845df (diff) | |
parent | 73fa6259bea5ee5c8fd108b8d4216ea2980eea65 (diff) |
Merge pull request #6180 from owncloud/fix_6143
fixes checkboxes in Advanced Tab don't save unchecked state anymore, #6143
-rw-r--r-- | apps/user_ldap/ajax/setConfiguration.php | 12 | ||||
-rw-r--r-- | apps/user_ldap/js/settings.js | 13 |
2 files changed, 22 insertions, 3 deletions
diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index 94de8835fbc..84acecee5da 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -27,6 +27,18 @@ OCP\JSON::checkAppEnabled('user_ldap'); OCP\JSON::callCheck(); $prefix = $_POST['ldap_serverconfig_chooser']; + +// Checkboxes are not submitted, when they are unchecked. Set them manually. +// only legacy checkboxes (Advanced and Expert tab) need to be handled here, +// the Wizard-like tabs handle it on their own +$chkboxes = array('ldap_configuration_active', 'ldap_override_main_server', + 'ldap_nocase', 'ldap_turn_off_cert_check'); +foreach($chkboxes as $boxid) { + if(!isset($_POST[$boxid])) { + $_POST[$boxid] = 0; + } +} + $ldapWrapper = new OCA\user_ldap\lib\LDAP(); $connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix); $connection->setConfiguration($_POST); diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index 49e6bf8d4bd..acf88ef58a4 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -518,13 +518,17 @@ var LdapWizard = { loginfilter = $('#ldap_login_filter').val(); //FIXME: activates a manually deactivated configuration. - if(host && port && base && userfilter && loginfilter) { + if(host && port && base && userfilter && loginfilter) { LdapWizard.updateStatusIndicator(true); if($('#ldap_configuration_active').is(':checked')) { return; } - $('#ldap_configuration_active').prop('checked', true); - LdapWizard.save($('#ldap_configuration_active')[0]); + if(!LdapWizard.isConfigurationActiveControlLocked) { + //avoids a manually deactivated connection will be activated + //upon opening the admin page + $('#ldap_configuration_active').prop('checked', true); + LdapWizard.save($('#ldap_configuration_active')[0]); + } } else { if($('#ldap_configuration_active').is(':checked')) { $('#ldap_configuration_active').prop('checked', false); @@ -546,9 +550,12 @@ var LdapWizard = { $(id + " + button").css('display', 'inline'); }, + isConfigurationActiveControlLocked: true, + init: function() { LdapWizard.basicStatusCheck(); LdapWizard.functionalityCheck(); + LdapWizard.isConfigurationActiveControlLocked = false; }, initGroupFilter: function() { |