2013-09-26 20:31:57 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ownCloud – LDAP Connection
|
|
|
|
|
*
|
|
|
|
|
* @author Arthur Schiwon
|
|
|
|
|
* @copyright 2012, 2013 Arthur Schiwon blizzz@owncloud.com
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 3 of the License, or any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public
|
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace OCA\user_ldap\lib;
|
|
|
|
|
|
|
|
|
|
class Configuration {
|
|
|
|
|
|
|
|
|
|
protected $configPrefix = null;
|
|
|
|
|
protected $configRead = false;
|
|
|
|
|
|
|
|
|
|
//settings
|
|
|
|
|
protected $config = array(
|
|
|
|
|
'ldapHost' => null,
|
|
|
|
|
'ldapPort' => null,
|
|
|
|
|
'ldapBackupHost' => null,
|
|
|
|
|
'ldapBackupPort' => null,
|
|
|
|
|
'ldapBase' => null,
|
|
|
|
|
'ldapBaseUsers' => null,
|
|
|
|
|
'ldapBaseGroups' => null,
|
|
|
|
|
'ldapAgentName' => null,
|
|
|
|
|
'ldapAgentPassword' => null,
|
|
|
|
|
'ldapTLS' => null,
|
|
|
|
|
'ldapNoCase' => null,
|
|
|
|
|
'turnOffCertCheck' => null,
|
|
|
|
|
'ldapIgnoreNamingRules' => null,
|
|
|
|
|
'ldapUserDisplayName' => null,
|
2013-10-04 14:33:37 +00:00
|
|
|
|
'ldapUserFilterObjectclass' => null,
|
2013-10-04 16:11:44 +00:00
|
|
|
|
'ldapUserFilterGroups' => null,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'ldapUserFilter' => null,
|
2013-11-19 22:58:08 +00:00
|
|
|
|
'ldapUserFilterMode' => null,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'ldapGroupFilter' => null,
|
2013-11-19 22:58:08 +00:00
|
|
|
|
'ldapGroupFilterMode' => null,
|
2013-10-09 20:00:36 +00:00
|
|
|
|
'ldapGroupFilterObjectclass' => null,
|
|
|
|
|
'ldapGroupFilterGroups' => null,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'ldapGroupDisplayName' => null,
|
|
|
|
|
'ldapGroupMemberAssocAttr' => null,
|
|
|
|
|
'ldapLoginFilter' => null,
|
2013-11-19 22:58:08 +00:00
|
|
|
|
'ldapLoginFilterMode' => null,
|
2013-10-08 21:47:57 +00:00
|
|
|
|
'ldapLoginFilterEmail' => null,
|
|
|
|
|
'ldapLoginFilterUsername' => null,
|
|
|
|
|
'ldapLoginFilterAttributes' => null,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'ldapQuotaAttribute' => null,
|
|
|
|
|
'ldapQuotaDefault' => null,
|
|
|
|
|
'ldapEmailAttribute' => null,
|
|
|
|
|
'ldapCacheTTL' => null,
|
2013-10-17 17:40:59 +00:00
|
|
|
|
'ldapUuidUserAttribute' => 'auto',
|
|
|
|
|
'ldapUuidGroupAttribute' => 'auto',
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'ldapOverrideMainServer' => false,
|
|
|
|
|
'ldapConfigurationActive' => false,
|
|
|
|
|
'ldapAttributesForUserSearch' => null,
|
|
|
|
|
'ldapAttributesForGroupSearch' => null,
|
2014-10-07 14:29:06 +00:00
|
|
|
|
'ldapExperiencedAdmin' => false,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'homeFolderNamingRule' => null,
|
|
|
|
|
'hasPagedResultSupport' => false,
|
2013-10-08 16:27:36 +00:00
|
|
|
|
'hasMemberOfFilterSupport' => false,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
'ldapExpertUsernameAttr' => null,
|
2013-10-17 17:40:59 +00:00
|
|
|
|
'ldapExpertUUIDUserAttr' => null,
|
|
|
|
|
'ldapExpertUUIDGroupAttr' => null,
|
2013-11-21 16:02:37 +00:00
|
|
|
|
'lastJpegPhotoLookup' => null,
|
2013-12-06 15:46:52 +00:00
|
|
|
|
'ldapNestedGroups' => false,
|
2014-03-04 16:23:04 +00:00
|
|
|
|
'ldapPagingSize' => null,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
);
|
|
|
|
|
|
2014-02-06 15:30:58 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $configPrefix
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @param bool $autoRead
|
2014-02-06 15:30:58 +00:00
|
|
|
|
*/
|
2014-05-11 13:17:27 +00:00
|
|
|
|
public function __construct($configPrefix, $autoRead = true) {
|
2013-09-26 20:31:57 +00:00
|
|
|
|
$this->configPrefix = $configPrefix;
|
2014-05-11 13:17:27 +00:00
|
|
|
|
if($autoRead) {
|
2013-09-26 20:31:57 +00:00
|
|
|
|
$this->readConfiguration();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $name
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return mixed|void
|
|
|
|
|
*/
|
2013-09-26 20:31:57 +00:00
|
|
|
|
public function __get($name) {
|
|
|
|
|
if(isset($this->config[$name])) {
|
|
|
|
|
return $this->config[$name];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $name
|
|
|
|
|
* @param mixed $value
|
2014-05-11 13:17:27 +00:00
|
|
|
|
*/
|
2013-09-26 20:31:57 +00:00
|
|
|
|
public function __set($name, $value) {
|
|
|
|
|
$this->setConfiguration(array($name => $value));
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
2013-09-26 20:31:57 +00:00
|
|
|
|
public function getConfiguration() {
|
|
|
|
|
return $this->config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-05-19 15:50:53 +00:00
|
|
|
|
* set LDAP configuration with values delivered by an array, not read
|
2013-09-26 20:31:57 +00:00
|
|
|
|
* from configuration. It does not save the configuration! To do so, you
|
|
|
|
|
* must call saveConfiguration afterwards.
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param array $config array that holds the config parameters in an associated
|
2013-09-26 20:31:57 +00:00
|
|
|
|
* array
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @param array &$applied optional; array where the set fields will be given to
|
2014-02-06 15:30:58 +00:00
|
|
|
|
* @return false|null
|
2013-09-26 20:31:57 +00:00
|
|
|
|
*/
|
|
|
|
|
public function setConfiguration($config, &$applied = null) {
|
|
|
|
|
if(!is_array($config)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$cta = $this->getConfigTranslationArray();
|
2014-05-11 13:17:27 +00:00
|
|
|
|
foreach($config as $inputKey => $val) {
|
|
|
|
|
if(strpos($inputKey, '_') !== false && array_key_exists($inputKey, $cta)) {
|
|
|
|
|
$key = $cta[$inputKey];
|
|
|
|
|
} elseif(array_key_exists($inputKey, $this->config)) {
|
|
|
|
|
$key = $inputKey;
|
2013-09-26 20:31:57 +00:00
|
|
|
|
} else {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$setMethod = 'setValue';
|
|
|
|
|
switch($key) {
|
|
|
|
|
case 'homeFolderNamingRule':
|
|
|
|
|
if(!empty($val) && strpos($val, 'attr:') === false) {
|
|
|
|
|
$val = 'attr:'.$val;
|
|
|
|
|
}
|
2013-12-12 22:09:31 +00:00
|
|
|
|
break;
|
2013-09-26 20:31:57 +00:00
|
|
|
|
case 'ldapBase':
|
|
|
|
|
case 'ldapBaseUsers':
|
|
|
|
|
case 'ldapBaseGroups':
|
|
|
|
|
case 'ldapAttributesForUserSearch':
|
|
|
|
|
case 'ldapAttributesForGroupSearch':
|
2013-10-04 14:33:37 +00:00
|
|
|
|
case 'ldapUserFilterObjectclass':
|
2013-10-04 16:11:44 +00:00
|
|
|
|
case 'ldapUserFilterGroups':
|
2013-10-09 20:00:36 +00:00
|
|
|
|
case 'ldapGroupFilterObjectclass':
|
|
|
|
|
case 'ldapGroupFilterGroups':
|
2013-10-08 21:47:57 +00:00
|
|
|
|
case 'ldapLoginFilterAttributes':
|
2013-09-26 20:31:57 +00:00
|
|
|
|
$setMethod = 'setMultiLine';
|
2013-12-12 22:09:31 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
$this->$setMethod($key, $val);
|
|
|
|
|
if(is_array($applied)) {
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$applied[] = $inputKey;
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function readConfiguration() {
|
|
|
|
|
if(!$this->configRead && !is_null($this->configPrefix)) {
|
|
|
|
|
$cta = array_flip($this->getConfigTranslationArray());
|
|
|
|
|
foreach($this->config as $key => $val) {
|
|
|
|
|
if(!isset($cta[$key])) {
|
|
|
|
|
//some are determined
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$dbKey = $cta[$key];
|
2013-09-26 20:31:57 +00:00
|
|
|
|
switch($key) {
|
|
|
|
|
case 'ldapBase':
|
|
|
|
|
case 'ldapBaseUsers':
|
|
|
|
|
case 'ldapBaseGroups':
|
|
|
|
|
case 'ldapAttributesForUserSearch':
|
|
|
|
|
case 'ldapAttributesForGroupSearch':
|
2013-10-04 14:33:37 +00:00
|
|
|
|
case 'ldapUserFilterObjectclass':
|
2013-10-04 16:11:44 +00:00
|
|
|
|
case 'ldapUserFilterGroups':
|
2013-10-09 20:00:36 +00:00
|
|
|
|
case 'ldapGroupFilterObjectclass':
|
|
|
|
|
case 'ldapGroupFilterGroups':
|
2013-10-08 21:47:57 +00:00
|
|
|
|
case 'ldapLoginFilterAttributes':
|
2013-09-26 20:31:57 +00:00
|
|
|
|
$readMethod = 'getMultiLine';
|
|
|
|
|
break;
|
|
|
|
|
case 'ldapIgnoreNamingRules':
|
|
|
|
|
$readMethod = 'getSystemValue';
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$dbKey = $key;
|
2013-09-26 20:31:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case 'ldapAgentPassword':
|
|
|
|
|
$readMethod = 'getPwd';
|
|
|
|
|
break;
|
|
|
|
|
case 'ldapUserDisplayName':
|
|
|
|
|
case 'ldapGroupDisplayName':
|
|
|
|
|
$readMethod = 'getLcValue';
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$readMethod = 'getValue';
|
|
|
|
|
break;
|
|
|
|
|
}
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$this->config[$key] = $this->$readMethod($dbKey);
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
$this->configRead = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-05-19 15:50:53 +00:00
|
|
|
|
* saves the current Configuration in the database
|
2013-09-26 20:31:57 +00:00
|
|
|
|
*/
|
|
|
|
|
public function saveConfiguration() {
|
|
|
|
|
$cta = array_flip($this->getConfigTranslationArray());
|
|
|
|
|
foreach($this->config as $key => $value) {
|
|
|
|
|
switch ($key) {
|
|
|
|
|
case 'ldapAgentPassword':
|
|
|
|
|
$value = base64_encode($value);
|
|
|
|
|
break;
|
|
|
|
|
case 'ldapBase':
|
|
|
|
|
case 'ldapBaseUsers':
|
|
|
|
|
case 'ldapBaseGroups':
|
|
|
|
|
case 'ldapAttributesForUserSearch':
|
|
|
|
|
case 'ldapAttributesForGroupSearch':
|
2013-10-04 14:33:37 +00:00
|
|
|
|
case 'ldapUserFilterObjectclass':
|
2013-10-04 16:11:44 +00:00
|
|
|
|
case 'ldapUserFilterGroups':
|
2013-10-09 20:00:36 +00:00
|
|
|
|
case 'ldapGroupFilterObjectclass':
|
|
|
|
|
case 'ldapGroupFilterGroups':
|
2013-10-08 21:47:57 +00:00
|
|
|
|
case 'ldapLoginFilterAttributes':
|
2013-09-26 20:31:57 +00:00
|
|
|
|
if(is_array($value)) {
|
|
|
|
|
$value = implode("\n", $value);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
//following options are not stored but detected, skip them
|
|
|
|
|
case 'ldapIgnoreNamingRules':
|
|
|
|
|
case 'hasPagedResultSupport':
|
2013-10-17 17:40:59 +00:00
|
|
|
|
case 'ldapUuidUserAttribute':
|
|
|
|
|
case 'ldapUuidGroupAttribute':
|
2013-09-26 20:31:57 +00:00
|
|
|
|
continue 2;
|
|
|
|
|
}
|
|
|
|
|
if(is_null($value)) {
|
|
|
|
|
$value = '';
|
|
|
|
|
}
|
|
|
|
|
$this->saveValue($cta[$key], $value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return array|string
|
|
|
|
|
*/
|
|
|
|
|
protected function getMultiLine($varName) {
|
|
|
|
|
$value = $this->getValue($varName);
|
2013-09-26 20:31:57 +00:00
|
|
|
|
if(empty($value)) {
|
|
|
|
|
$value = '';
|
|
|
|
|
} else {
|
|
|
|
|
$value = preg_split('/\r\n|\r|\n/', $value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $value;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
|
|
|
|
* @param array|string $value
|
2014-05-11 13:17:27 +00:00
|
|
|
|
*/
|
|
|
|
|
protected function setMultiLine($varName, $value) {
|
2013-09-26 20:31:57 +00:00
|
|
|
|
if(empty($value)) {
|
|
|
|
|
$value = '';
|
2013-10-24 12:27:33 +00:00
|
|
|
|
} else if (!is_array($value)) {
|
2014-06-03 10:35:18 +00:00
|
|
|
|
$value = preg_split('/\r\n|\r|\n|;/', $value);
|
2013-10-17 18:58:43 +00:00
|
|
|
|
if($value === false) {
|
|
|
|
|
$value = '';
|
|
|
|
|
}
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$this->setValue($varName, $value);
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
protected function getPwd($varName) {
|
|
|
|
|
return base64_decode($this->getValue($varName));
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
protected function getLcValue($varName) {
|
|
|
|
|
return mb_strtolower($this->getValue($varName), 'UTF-8');
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
protected function getSystemValue($varName) {
|
2013-09-26 20:31:57 +00:00
|
|
|
|
//FIXME: if another system value is added, softcode the default value
|
2014-05-11 13:17:27 +00:00
|
|
|
|
return \OCP\Config::getSystemValue($varName, false);
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
protected function getValue($varName) {
|
2013-09-26 20:31:57 +00:00
|
|
|
|
static $defaults;
|
|
|
|
|
if(is_null($defaults)) {
|
|
|
|
|
$defaults = $this->getDefaults();
|
|
|
|
|
}
|
|
|
|
|
return \OCP\Config::getAppValue('user_ldap',
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$this->configPrefix.$varName,
|
|
|
|
|
$defaults[$varName]);
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
|
|
|
|
* @param mixed $value
|
2014-05-11 13:17:27 +00:00
|
|
|
|
*/
|
|
|
|
|
protected function setValue($varName, $value) {
|
|
|
|
|
$this->config[$varName] = $value;
|
2013-09-26 20:31:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-11 13:17:27 +00:00
|
|
|
|
/**
|
2014-05-13 11:29:25 +00:00
|
|
|
|
* @param string $varName
|
|
|
|
|
* @param string $value
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
protected function saveValue($varName, $value) {
|
2013-09-26 20:31:57 +00:00
|
|
|
|
return \OCP\Config::setAppValue('user_ldap',
|
2014-05-11 13:17:27 +00:00
|
|
|
|
$this->configPrefix.$varName,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
$value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return array an associative array with the default values. Keys are correspond
|
2013-09-26 20:31:57 +00:00
|
|
|
|
* to config-value entries in the database table
|
|
|
|
|
*/
|
|
|
|
|
public function getDefaults() {
|
|
|
|
|
return array(
|
2014-10-08 13:04:29 +00:00
|
|
|
|
'ldap_host' => '',
|
|
|
|
|
'ldap_port' => '',
|
|
|
|
|
'ldap_backup_host' => '',
|
|
|
|
|
'ldap_backup_port' => '',
|
|
|
|
|
'ldap_override_main_server' => '',
|
|
|
|
|
'ldap_dn' => '',
|
|
|
|
|
'ldap_agent_password' => '',
|
|
|
|
|
'ldap_base' => '',
|
|
|
|
|
'ldap_base_users' => '',
|
|
|
|
|
'ldap_base_groups' => '',
|
|
|
|
|
'ldap_userlist_filter' => '',
|
|
|
|
|
'ldap_user_filter_mode' => 0,
|
|
|
|
|
'ldap_userfilter_objectclass' => '',
|
|
|
|
|
'ldap_userfilter_groups' => '',
|
|
|
|
|
'ldap_login_filter' => '',
|
|
|
|
|
'ldap_login_filter_mode' => 0,
|
|
|
|
|
'ldap_loginfilter_email' => 0,
|
|
|
|
|
'ldap_loginfilter_username' => 1,
|
|
|
|
|
'ldap_loginfilter_attributes' => '',
|
|
|
|
|
'ldap_group_filter' => '',
|
|
|
|
|
'ldap_group_filter_mode' => 0,
|
|
|
|
|
'ldap_groupfilter_objectclass' => '',
|
|
|
|
|
'ldap_groupfilter_groups' => '',
|
|
|
|
|
'ldap_display_name' => 'displayName',
|
|
|
|
|
'ldap_group_display_name' => 'cn',
|
|
|
|
|
'ldap_tls' => 1,
|
|
|
|
|
'ldap_nocase' => 0,
|
|
|
|
|
'ldap_quota_def' => '',
|
|
|
|
|
'ldap_quota_attr' => '',
|
|
|
|
|
'ldap_email_attr' => '',
|
|
|
|
|
'ldap_group_member_assoc_attribute' => 'uniqueMember',
|
|
|
|
|
'ldap_cache_ttl' => 600,
|
|
|
|
|
'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_user_attr' => '',
|
|
|
|
|
'ldap_expert_uuid_group_attr' => '',
|
|
|
|
|
'has_memberof_filter_support' => 0,
|
|
|
|
|
'last_jpegPhoto_lookup' => 0,
|
|
|
|
|
'ldap_nested_groups' => 0,
|
|
|
|
|
'ldap_paging_size' => 500,
|
2014-10-07 14:29:06 +00:00
|
|
|
|
'ldap_experienced_admin' => 0,
|
2013-09-26 20:31:57 +00:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-05-11 13:17:27 +00:00
|
|
|
|
* @return array that maps internal variable names to database fields
|
2013-09-26 20:31:57 +00:00
|
|
|
|
*/
|
|
|
|
|
public function getConfigTranslationArray() {
|
|
|
|
|
//TODO: merge them into one representation
|
|
|
|
|
static $array = array(
|
2014-10-08 13:04:29 +00:00
|
|
|
|
'ldap_host' => 'ldapHost',
|
|
|
|
|
'ldap_port' => 'ldapPort',
|
|
|
|
|
'ldap_backup_host' => 'ldapBackupHost',
|
|
|
|
|
'ldap_backup_port' => 'ldapBackupPort',
|
|
|
|
|
'ldap_override_main_server' => 'ldapOverrideMainServer',
|
|
|
|
|
'ldap_dn' => 'ldapAgentName',
|
|
|
|
|
'ldap_agent_password' => 'ldapAgentPassword',
|
|
|
|
|
'ldap_base' => 'ldapBase',
|
|
|
|
|
'ldap_base_users' => 'ldapBaseUsers',
|
|
|
|
|
'ldap_base_groups' => 'ldapBaseGroups',
|
|
|
|
|
'ldap_userfilter_objectclass' => 'ldapUserFilterObjectclass',
|
|
|
|
|
'ldap_userfilter_groups' => 'ldapUserFilterGroups',
|
|
|
|
|
'ldap_userlist_filter' => 'ldapUserFilter',
|
|
|
|
|
'ldap_user_filter_mode' => 'ldapUserFilterMode',
|
|
|
|
|
'ldap_login_filter' => 'ldapLoginFilter',
|
|
|
|
|
'ldap_login_filter_mode' => 'ldapLoginFilterMode',
|
|
|
|
|
'ldap_loginfilter_email' => 'ldapLoginFilterEmail',
|
|
|
|
|
'ldap_loginfilter_username' => 'ldapLoginFilterUsername',
|
|
|
|
|
'ldap_loginfilter_attributes' => 'ldapLoginFilterAttributes',
|
|
|
|
|
'ldap_group_filter' => 'ldapGroupFilter',
|
|
|
|
|
'ldap_group_filter_mode' => 'ldapGroupFilterMode',
|
|
|
|
|
'ldap_groupfilter_objectclass' => 'ldapGroupFilterObjectclass',
|
|
|
|
|
'ldap_groupfilter_groups' => 'ldapGroupFilterGroups',
|
|
|
|
|
'ldap_display_name' => 'ldapUserDisplayName',
|
|
|
|
|
'ldap_group_display_name' => 'ldapGroupDisplayName',
|
|
|
|
|
'ldap_tls' => 'ldapTLS',
|
|
|
|
|
'ldap_nocase' => 'ldapNoCase',
|
|
|
|
|
'ldap_quota_def' => 'ldapQuotaDefault',
|
|
|
|
|
'ldap_quota_attr' => 'ldapQuotaAttribute',
|
|
|
|
|
'ldap_email_attr' => 'ldapEmailAttribute',
|
|
|
|
|
'ldap_group_member_assoc_attribute' => 'ldapGroupMemberAssocAttr',
|
|
|
|
|
'ldap_cache_ttl' => 'ldapCacheTTL',
|
|
|
|
|
'home_folder_naming_rule' => 'homeFolderNamingRule',
|
|
|
|
|
'ldap_turn_off_cert_check' => 'turnOffCertCheck',
|
|
|
|
|
'ldap_configuration_active' => 'ldapConfigurationActive',
|
|
|
|
|
'ldap_attributes_for_user_search' => 'ldapAttributesForUserSearch',
|
|
|
|
|
'ldap_attributes_for_group_search' => 'ldapAttributesForGroupSearch',
|
|
|
|
|
'ldap_expert_username_attr' => 'ldapExpertUsernameAttr',
|
|
|
|
|
'ldap_expert_uuid_user_attr' => 'ldapExpertUUIDUserAttr',
|
|
|
|
|
'ldap_expert_uuid_group_attr' => 'ldapExpertUUIDGroupAttr',
|
|
|
|
|
'has_memberof_filter_support' => 'hasMemberOfFilterSupport',
|
|
|
|
|
'last_jpegPhoto_lookup' => 'lastJpegPhotoLookup',
|
2014-03-04 16:23:04 +00:00
|
|
|
|
'ldap_nested_groups' => 'ldapNestedGroups',
|
|
|
|
|
'ldap_paging_size' => 'ldapPagingSize',
|
2014-10-07 14:29:06 +00:00
|
|
|
|
'ldap_experienced_admin' => 'ldapExperiencedAdmin'
|
2013-09-26 20:31:57 +00:00
|
|
|
|
);
|
|
|
|
|
return $array;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-13 11:29:25 +00:00
|
|
|
|
}
|