summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-12-04 13:14:05 +0100
committerMorris Jobke <morris.jobke@gmail.com>2013-12-04 17:57:40 +0100
commit1c6568cf687b395ce67a5bbea0e0c87bbe8fb41e (patch)
tree9b5a522e2d2f64135889ecbb68578be30e13ec2f
parent737b9a990f73ffe362cbe03b2878f8a633414336 (diff)
downloadnextcloud-server-1c6568cf687b395ce67a5bbea0e0c87bbe8fb41e.tar.gz
nextcloud-server-1c6568cf687b395ce67a5bbea0e0c87bbe8fb41e.zip
LDAP: make unsetting checkboxes from Advanced tab work again, fixes #6143
-rw-r--r--apps/user_ldap/ajax/setConfiguration.php12
1 files changed, 12 insertions, 0 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);