summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/connection.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-09-10 17:11:02 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-09-27 13:34:15 +0200
commitd4f92494a23747af545d7ebb70eaf3e417f46eaa (patch)
treee0b0610eca24fb38028bc50ada7bd7b397358c97 /apps/user_ldap/lib/connection.php
parentb9cc2ad660fb7a43f2b0a12e1290527fcebb995a (diff)
downloadnextcloud-server-d4f92494a23747af545d7ebb70eaf3e417f46eaa.tar.gz
nextcloud-server-d4f92494a23747af545d7ebb70eaf3e417f46eaa.zip
LDAP: make Access be a dependency to the user and group backend instead of inheriting it.
Diffstat (limited to 'apps/user_ldap/lib/connection.php')
-rw-r--r--apps/user_ldap/lib/connection.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index dd627a4e1b1..0bf13a19377 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -23,7 +23,7 @@
namespace OCA\user_ldap\lib;
-class Connection extends BackendBase {
+class Connection extends LDAPUtility {
private $ldapConnectionRes = null;
private $configPrefix;
private $configID;
@@ -60,7 +60,7 @@ class Connection extends BackendBase {
'ldapQuotaDefault' => null,
'ldapEmailAttribute' => null,
'ldapCacheTTL' => null,
- 'ldapUuidAttribute' => null,
+ 'ldapUuidAttribute' => 'auto',
'ldapOverrideUuidAttribute' => null,
'ldapOverrideMainServer' => false,
'ldapConfigurationActive' => false,
@@ -77,8 +77,8 @@ class Connection extends BackendBase {
* @param $configPrefix a string with the prefix for the configkey column (appconfig table)
* @param $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections
*/
- public function __construct($configPrefix = '', $configID = 'user_ldap') {
- parent::__construct();
+ public function __construct(ILDAPWrapper $ldap, $configPrefix = '', $configID = 'user_ldap') {
+ parent::__construct($ldap);
$this->configPrefix = $configPrefix;
$this->configID = $configID;
$memcache = new \OC\Memcache\Factory();
@@ -363,6 +363,14 @@ class Connection extends BackendBase {
&& $params[$parameter] === 'homeFolderNamingRule'))
&& !empty($value)) {
$value = 'attr:'.$value;
+ } else if (strpos($parameter, 'ldapBase') !== false
+ || (isset($params[$parameter])
+ && strpos($params[$parameter], 'ldapBase') !== false)) {
+ $this->readBase($params[$parameter], $value);
+ if(is_array($setParameters)) {
+ $setParameters[] = $parameter;
+ }
+ continue;
}
if(isset($this->config[$parameter])) {
$this->config[$parameter] = $value;
@@ -433,10 +441,6 @@ class Connection extends BackendBase {
$config[$dbKey] = '';
}
continue;
- } else if((strpos($classKey, 'ldapBase') !== false)
- || (strpos($classKey, 'ldapAttributes') !== false)) {
- $config[$dbKey] = implode("\n", $this->config[$classKey]);
- continue;
}
$config[$dbKey] = $this->config[$classKey];
}
@@ -553,7 +557,7 @@ class Connection extends BackendBase {
* @returns an associative array with the default values. Keys are correspond
* to config-value entries in the database table
*/
- public function getDefaults() {
+ static public function getDefaults() {
return array(
'ldap_host' => '',
'ldap_port' => '389',