resolve merge conflicts from rebase
This commit is contained in:
parent
0b90cc0b4b
commit
6acd01d9f2
2 changed files with 32 additions and 46 deletions
|
@ -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;
|
||||
|
|
|
@ -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' => '',
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue