summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-05-07 18:37:44 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-05-07 18:38:02 +0200
commit5a1ea62437673d24407515eb2deabdac1210bfcb (patch)
tree8c5d1bb1195997895d7a591f4dc12cc38d48c22c
parentbf8b3b0696cc59021309fea7fc578977d4aa52de (diff)
downloadnextcloud-server-5a1ea62437673d24407515eb2deabdac1210bfcb.tar.gz
nextcloud-server-5a1ea62437673d24407515eb2deabdac1210bfcb.zip
LDAP: Fall back to Base DN if user/group base settings are blanked
-rwxr-xr-xapps/user_ldap/lib_ldap.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index c71c0cb7e54..4c2c22cbbee 100755
--- a/apps/user_ldap/lib_ldap.php
+++ b/apps/user_ldap/lib_ldap.php
@@ -568,6 +568,15 @@ class OC_LDAP {
self::$ldapUserFilter = OCP\Config::getAppValue('user_ldap', 'ldap_userlist_filter','objectClass=person');
self::$ldapGroupDisplayName = OCP\Config::getAppValue('user_ldap', 'ldap_group_display_name', LDAP_GROUP_DISPLAY_NAME_ATTR);
+ if(empty(self::$ldapBaseUsers)) {
+ OCP\Util::writeLog('ldap', 'Base for Users is empty, using Base DN', OCP\Util::INFO);
+ self::$ldapBaseUsers = self::$ldapBase;
+ }
+ if(empty(self::$ldapBaseGroups)) {
+ OCP\Util::writeLog('ldap', 'Base for Groups is empty, using Base DN', OCP\Util::INFO);
+ self::$ldapBaseGroups = self::$ldapBase;
+ }
+
if(
!empty(self::$ldapHost)
&& !empty(self::$ldapPort)
@@ -576,8 +585,6 @@ class OC_LDAP {
|| ( empty(self::$ldapAgentName) && empty(self::$ldapAgentPassword))
)
&& !empty(self::$ldapBase)
- && !empty(self::$ldapBaseUsers)
- && !empty(self::$ldapBaseGroups)
&& !empty(self::$ldapUserDisplayName)
)
{
@@ -591,6 +598,7 @@ class OC_LDAP {
*/
static private function establishConnection() {
if(!self::$configured) {
+ OCP\Util::writeLog('ldap', 'Configuration is invalid, cannot connect', OCP\Util::INFO);
return false;
}
if(!self::$ldapConnectionRes) {