summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-24 23:24:39 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-24 23:24:39 -0700
commit5fd1f552a3de82c17f2ced20334888516d3fb9b7 (patch)
tree41311537805a4822e2010477ab17f6a207b6fd89 /apps
parent3917d18980638e86f5cce9242adeded0ca760260 (diff)
parentc48157e3b85f3daa4a68ef83d7534df6a59d5c78 (diff)
downloadnextcloud-server-5fd1f552a3de82c17f2ced20334888516d3fb9b7.tar.gz
nextcloud-server-5fd1f552a3de82c17f2ced20334888516d3fb9b7.zip
Merge pull request #5532 from owncloud/ldap_fixes
Ldap fixes
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/js/settings.js38
-rw-r--r--apps/user_ldap/lib/configuration.php4
-rw-r--r--apps/user_ldap/lib/connection.php15
3 files changed, 45 insertions, 12 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index faef477420f..4c2f182dad8 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -272,13 +272,8 @@ var LdapWizard = {
if(curTabIndex == 0) {
return;
}
- if(curTabIndex == 1) {
- $('.ldap_action_back').addClass('invisible');
- }
$('#ldapSettings').tabs('option', 'active', curTabIndex - 1);
- if(curTabIndex == 3) {
- $('.ldap_action_continue').removeClass('invisible');
- }
+ LdapWizard.controlUpdate(curTabIndex - 1);
},
controlContinue: function() {
@@ -287,12 +282,26 @@ var LdapWizard = {
return;
}
$('#ldapSettings').tabs('option', 'active', 1 + curTabIndex);
- if(curTabIndex == 2) {
+ LdapWizard.controlUpdate(curTabIndex + 1);
+ },
+
+ controlUpdate: function(nextTabIndex) {
+ if(nextTabIndex == 0) {
+ $('.ldap_action_back').addClass('invisible');
+ $('.ldap_action_continue').removeClass('invisible');
+ } else
+ if(nextTabIndex == 1) {
+ $('.ldap_action_back').removeClass('invisible');
+ $('.ldap_action_continue').removeClass('invisible');
+ } else
+ if(nextTabIndex == 2) {
+ $('.ldap_action_continue').removeClass('invisible');
+ $('.ldap_action_back').removeClass('invisible');
+ } else
+ if(nextTabIndex == 3) {
//now last tab
- $('.ldap_action_continue').addClass('invisible');
- }
- if(curTabIndex == 0) {
$('.ldap_action_back').removeClass('invisible');
+ $('.ldap_action_continue').addClass('invisible');
}
},
@@ -493,12 +502,21 @@ var LdapWizard = {
},
onTabChange: function(event, ui) {
+ newTabIndex = 0;
if(ui.newTab[0].id === '#ldapWizard2') {
LdapWizard.initUserFilter();
+ newTabIndex = 1;
} else if(ui.newTab[0].id === '#ldapWizard3') {
LdapWizard.initLoginFilter();
+ newTabIndex = 2;
} else if(ui.newTab[0].id === '#ldapWizard4') {
LdapWizard.initGroupFilter();
+ newTabIndex = 3;
+ }
+
+ curTabIndex = $('#ldapSettings').tabs('option', 'active');
+ if(curTabIndex >= 0 && curTabIndex <= 3) {
+ LdapWizard.controlUpdate(newTabIndex);
}
},
diff --git a/apps/user_ldap/lib/configuration.php b/apps/user_ldap/lib/configuration.php
index c8bf1c09482..e14ed824a74 100644
--- a/apps/user_ldap/lib/configuration.php
+++ b/apps/user_ldap/lib/configuration.php
@@ -241,7 +241,7 @@ class Configuration {
protected function setMultiLine($varname, $value) {
if(empty($value)) {
$value = '';
- } else {
+ } else if (!is_array($value)) {
$value = preg_split('/\r\n|\r|\n/', $value);
if($value === false) {
$value = '';
@@ -374,7 +374,7 @@ class Configuration {
'ldap_attributes_for_user_search' => 'ldapAttributesForUserSearch',
'ldap_attributes_for_group_search' => 'ldapAttributesForGroupSearch',
'ldap_expert_username_attr' => 'ldapExpertUsernameAttr',
- 'ldap_expert_uuid_user_attr' => 'ldapExpertUUIUserDAttr',
+ 'ldap_expert_uuid_user_attr' => 'ldapExpertUUIDUserAttr',
'ldap_expert_uuid_group_attr' => 'ldapExpertUUIDGroupAttr',
'has_memberof_filter_support' => 'hasMemberOfFilterSupport',
);
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 8d34fb2f418..14dfaa1174d 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -39,6 +39,8 @@ class Connection extends LDAPUtility {
//settings handler
protected $configuration;
+ protected $doNotValidate = false;
+
/**
* @brief Constructor
* @param $configPrefix a string with the prefix for the configkey column (appconfig table)
@@ -57,6 +59,8 @@ class Connection extends LDAPUtility {
}
$this->hasPagedResultSupport =
$this->ldap->hasPagedResultSupport();
+ $this->doNotValidate = !in_array($this->configPrefix,
+ Helper::getServerConfigurationPrefixes());
}
public function __destruct() {
@@ -88,6 +92,7 @@ class Connection extends LDAPUtility {
}
public function __set($name, $value) {
+ $this->doNotValidate = false;
$before = $this->configuration->$name;
$this->configuration->$name = $value;
$after = $this->configuration->$name;
@@ -201,11 +206,13 @@ class Connection extends LDAPUtility {
if(is_null($setParameters)) {
$setParameters = array();
}
+ $this->doNotValidate = false;
$this->configuration->setConfiguration($config, $setParameters);
if(count($setParameters) > 0) {
$this->configured = $this->validateConfiguration();
}
+
return $this->configured;
}
@@ -401,6 +408,14 @@ class Connection extends LDAPUtility {
* @returns true if configuration seems OK, false otherwise
*/
private function validateConfiguration() {
+
+ if($this->doNotValidate) {
+ //don't do a validation if it is a new configuration with pure
+ //default values. Will be allowed on changes via __set or
+ //setConfiguration
+ return false;
+ }
+
// first step: "soft" checks: settings that are not really
// necessary, but advisable. If left empty, give an info message
$this->doSoftValidation();