summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/connection.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-06-11 13:35:35 +0200
committerArthur Schiwon <blizzz@owncloud.com>2014-06-25 11:45:55 +0200
commit452efa5fababa7c64ad450fda781c5d0c099c02e (patch)
treed4e91051dccc19d84ed791d768fbe385340c2b78 /apps/user_ldap/lib/connection.php
parentc6bcb07f8373b3a1515fc2f26872a0256ee3666d (diff)
downloadnextcloud-server-452efa5fababa7c64ad450fda781c5d0c099c02e.tar.gz
nextcloud-server-452efa5fababa7c64ad450fda781c5d0c099c02e.zip
Port of LDAP Wizard: get correct total no of users, groups and complete list of groups on big setups #9002
fix PHPdoc Conflicts: apps/user_ldap/lib/connection.php add method to count groups on LDAP Conflicts: apps/user_ldap/lib/access.php LDAP Wizard: count users and groups with the power of paged search Conflicts: apps/user_ldap/lib/wizard.php consolidate requirement check fix PHPdoc Conflicts: apps/user_ldap/lib/access.php Wizard: get really all groups from LDAP by power of Paged Search Conflicts: apps/user_ldap/lib/wizard.php make all this work in an early configuration state in the wizard by marking the config active and ignoring the validation state. Conflicts: apps/user_ldap/lib/connection.php simplify two methods a bit, because they are not used for group search anymore Conflicts: apps/user_ldap/lib/wizard.php remove unused vars; increase scrutinizer happiness
Diffstat (limited to 'apps/user_ldap/lib/connection.php')
-rw-r--r--apps/user_ldap/lib/connection.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 52f6c5ceb10..bafb0e0b895 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -41,11 +41,13 @@ class Connection extends LDAPUtility {
protected $doNotValidate = false;
+ protected $ignoreValidation = false;
+
/**
* Constructor
* @param ILDAPWrapper $ldap
* @param string $configPrefix a string with the prefix for the configkey column (appconfig table)
- * @param string $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections
+ * @param string|null $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections
*/
public function __construct(ILDAPWrapper $ldap, $configPrefix = '', $configID = 'user_ldap') {
parent::__construct($ldap);
@@ -117,6 +119,16 @@ class Connection extends LDAPUtility {
}
/**
+ * sets whether the result of the configuration validation shall
+ * be ignored when establishing the connection. Used by the Wizard
+ * in early configuration state.
+ * @param bool $state
+ */
+ public function setIgnoreValidation($state) {
+ $this->ignoreValidation = (bool)$state;
+ }
+
+ /**
* initializes the LDAP backend
* @param bool $force read the config settings no matter what
*/
@@ -466,7 +478,7 @@ class Connection extends LDAPUtility {
if(!$phpLDAPinstalled) {
return false;
}
- if(!$this->configured) {
+ if(!$this->ignoreValidation && !$this->configured) {
\OCP\Util::writeLog('user_ldap',
'Configuration is invalid, cannot connect',
\OCP\Util::WARN);