summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
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
parent0b90cc0b4b529e8d4a4e6fb173d2c56678071362 (diff)
downloadnextcloud-server-6acd01d9f287def7cf4f35fbe71c069dd97eff8b.tar.gz
nextcloud-server-6acd01d9f287def7cf4f35fbe71c069dd97eff8b.zip
resolve merge conflicts from rebase
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/configuration.php21
-rw-r--r--apps/user_ldap/lib/connection.php57
2 files changed, 32 insertions, 46 deletions
diff --git a/apps/user_ldap/lib/configuration.php b/apps/user_ldap/lib/configuration.php
index 2fb566aec6f..460cd9e1dce 100644
--- a/apps/user_ldap/lib/configuration.php
+++ b/apps/user_ldap/lib/configuration.php
@@ -60,8 +60,8 @@ class Configuration {
'ldapQuotaDefault' => null,
'ldapEmailAttribute' => null,
'ldapCacheTTL' => null,
- 'ldapUuidAttribute' => 'auto',
- 'ldapOverrideUuidAttribute' => null,
+ 'ldapUuidUserAttribute' => 'auto',
+ 'ldapUuidGroupAttribute' => 'auto',
'ldapOverrideMainServer' => false,
'ldapConfigurationActive' => false,
'ldapAttributesForUserSearch' => null,
@@ -70,7 +70,8 @@ class Configuration {
'hasPagedResultSupport' => false,
'hasMemberOfFilterSupport' => false,
'ldapExpertUsernameAttr' => null,
- 'ldapExpertUUIDAttr' => null,
+ 'ldapExpertUUIDUserAttr' => null,
+ 'ldapExpertUUIDGroupAttr' => null,
);
public function __construct($configPrefix, $autoread = true) {
@@ -214,9 +215,9 @@ class Configuration {
break;
//following options are not stored but detected, skip them
case 'ldapIgnoreNamingRules':
- case 'ldapOverrideUuidAttribute':
case 'hasPagedResultSupport':
- case 'ldapUuidAttribute':
+ case 'ldapUuidUserAttribute':
+ case 'ldapUuidGroupAttribute':
continue 2;
}
if(is_null($value)) {
@@ -315,15 +316,16 @@ class Configuration {
'ldap_email_attr' => '',
'ldap_group_member_assoc_attribute' => 'uniqueMember',
'ldap_cache_ttl' => 600,
- 'ldap_uuid_attribute' => 'auto',
- 'ldap_override_uuid_attribute' => 0,
+ 'ldap_uuid_user_attribute' => 'auto',
+ 'ldap_uuid_group_attribute' => 'auto',
'home_folder_naming_rule' => '',
'ldap_turn_off_cert_check' => 0,
'ldap_configuration_active' => 0,
'ldap_attributes_for_user_search' => '',
'ldap_attributes_for_group_search' => '',
'ldap_expert_username_attr' => '',
- 'ldap_expert_uuid_attr' => '',
+ 'ldap_expert_uuid_user_attr' => '',
+ 'ldap_expert_uuid_group_attr' => '',
'has_memberof_filter_support' => 0,
);
}
@@ -369,7 +371,8 @@ class Configuration {
'ldap_attributes_for_user_search' => 'ldapAttributesForUserSearch',
'ldap_attributes_for_group_search' => 'ldapAttributesForGroupSearch',
'ldap_expert_username_attr' => 'ldapExpertUsernameAttr',
- 'ldap_expert_uuid_attr' => 'ldapExpertUUIDAttr',
+ 'ldap_expert_uuid_user_attr' => 'ldapExpertUUIUserDAttr',
+ 'ldap_expert_uuid_group_attr' => 'ldapExpertUUIDGroupAttr',
'has_memberof_filter_support' => 'hasMemberOfFilterSupport',
);
return $array;
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' => '',
}