summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/connection.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-10-17 19:40:59 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-10-17 19:40:59 +0200
commit6acd01d9f287def7cf4f35fbe71c069dd97eff8b (patch)
treeea42f8d0d77bc2f2b299fa3168ddd158046bc83d /apps/user_ldap/lib/connection.php
parent0b90cc0b4b529e8d4a4e6fb173d2c56678071362 (diff)
downloadnextcloud-server-6acd01d9f287def7cf4f35fbe71c069dd97eff8b.tar.gz
nextcloud-server-6acd01d9f287def7cf4f35fbe71c069dd97eff8b.zip
resolve merge conflicts from rebase
Diffstat (limited to 'apps/user_ldap/lib/connection.php')
-rw-r--r--apps/user_ldap/lib/connection.php57
1 files changed, 20 insertions, 37 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 981d792325f..8d34fb2f418 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -38,8 +38,6 @@ class Connection extends LDAPUtility {
//settings handler
protected $configuration;
- 'ldapUuidGroupAttribute' => 'auto',
- 'ldapExpertUUIDGroupAttr' => null,
/**
* @brief Constructor
@@ -189,17 +187,11 @@ class Connection extends LDAPUtility {
private function readConfiguration($force = false) {
if((!$this->configured || $force) && !is_null($this->configID)) {
$this->configuration->readConfiguration();
- $this->config['ldapUuidGroupAttribute']
- = $this->$v('ldap_uuid_group_attribute');
- $this->config['ldapExpertUUIDGroupAttr']
- = $this->$v('ldap_expert_uuid_group_attr');
-
$this->configured = $this->validateConfiguration();
}
}
/**
- 'ldap_expert_uuid_group_attr' => 'ldapExpertUUIDGroupAttr',
* @brief set LDAP configuration with values delivered by an array, not read from configuration
* @param $config array that holds the config parameters in an associated array
* @param &$setParameters optional; array where the set fields will be given to
@@ -224,7 +216,6 @@ class Connection extends LDAPUtility {
*/
public function saveConfiguration() {
$this->configuration->saveConfiguration();
- case 'ldapUuidGroupAttribute':
$this->clearCache();
}
@@ -262,11 +253,6 @@ class Connection extends LDAPUtility {
return $result;
}
- //TODO remove if not necessary
-// public function getDefaults() {
-// return $this->configuration->getDefaults();
-// }
-
private function doSoftValidation() {
//if User or Group Base are not set, take over Base DN setting
foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) {
@@ -289,27 +275,29 @@ class Connection extends LDAPUtility {
\OCP\Util::INFO);
}
- $uuidOverride = $this->configuration->ldapExpertUUIDAttr;
- if(!empty($uuidOverride)) {
- $this->configuration->ldapUuidAttribute = $uuidOverride;
- } else {
- $uuidAttributes = array('auto', 'entryuuid', 'nsuniqueid',
- 'objectguid', 'guid');
- if(!in_array($this->configuration->ldapUuidAttribute,
- $uuidAttributes)
- && (!is_null($this->configID))) {
- $this->configuration->ldapUuidAttribute = 'auto';
- $this->configuration->saveConfiguration();
- 'auto');
- \OCP\Util::writeLog('user_ldap',
- 'Illegal value for the UUID Attribute, '.
- 'reset to autodetect.',
- \OCP\Util::INFO);
- }
+ foreach(array('ldapExpertUUIDUserAttr' => 'ldapUuidUserAttribute',
+ 'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute')
+ as $expertSetting => $effectiveSetting) {
+ $uuidOverride = $this->configuration->$expertSetting;
+ if(!empty($uuidOverride)) {
+ $this->configuration->$effectiveSetting = $uuidOverride;
+ } else {
+ $uuidAttributes = array('auto', 'entryuuid', 'nsuniqueid',
+ 'objectguid', 'guid');
+ if(!in_array($this->configuration->$effectiveSetting,
+ $uuidAttributes)
+ && (!is_null($this->configID))) {
+ $this->configuration->$effectiveSetting = 'auto';
+ $this->configuration->saveConfiguration();
+ \OCP\Util::writeLog('user_ldap',
+ 'Illegal value for the '.
+ $effectiveSetting.', '.'reset to '.
+ 'autodetect.', \OCP\Util::INFO);
+ }
+ }
}
-
$backupPort = $this->configuration->ldapBackupPort;
if(empty($backupPort)) {
$this->configuration->backupPort = $this->configuration->ldapPort;
@@ -405,9 +393,6 @@ class Connection extends LDAPUtility {
$configurationOK = false;
}
- }
- if(!empty($this->config['ldapExpertUUIDGroupAttr'])) {
- $this->config['ldapUuidGroupAttribute'] = $this->config['ldapExpertUUIDGroupAttr'];
return $configurationOK;
}
@@ -423,8 +408,6 @@ class Connection extends LDAPUtility {
//second step: critical checks. If left empty or filled wrong, set as
//unconfigured and give a warning.
return $this->doCriticalValidation();
- 'ldap_uuid_group_attribute' => 'auto',
- 'ldap_expert_uuid_group_attr' => '',
}