From 51fcb18d30595ddbc6bbca497d826e2e7de81983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be> Date: Wed, 7 Jun 2017 10:13:58 +0200 Subject: [PATCH] Fixes #5574 Cleaned up groups RDN handling, moved POSIX groups RDN to POSIX plugin --- contrib/bin/fusiondirectory-setup | 4 ++-- include/class_config.inc | 4 ---- include/functions.inc | 15 ++------------- plugins/config/class_configInLdap.inc | 5 ----- plugins/config/class_mainPluginsConfig.inc | 4 ++-- 5 files changed, 6 insertions(+), 26 deletions(-) diff --git a/contrib/bin/fusiondirectory-setup b/contrib/bin/fusiondirectory-setup index 38d6123a9..7b75f813b 100644 --- a/contrib/bin/fusiondirectory-setup +++ b/contrib/bin/fusiondirectory-setup @@ -1724,8 +1724,8 @@ sub read_ldap_config { if (($mesg->entries)[0]->exists('fdUserRDN')) { $userrdn = ($mesg->entries)[0]->get_value('fdUserRDN'); } - if (($mesg->entries)[0]->exists('fdGroupRDN')) { - $grouprdn = ($mesg->entries)[0]->get_value('fdGroupRDN'); + if (($mesg->entries)[0]->exists('fdOGroupRDN')) { + $grouprdn = ($mesg->entries)[0]->get_value('fdOGroupRDN'); } if (($mesg->entries)[0]->exists('fdAclRoleRDN')) { $aclrolerdn = ($mesg->entries)[0]->get_value('fdAclRoleRDN'); diff --git a/include/class_config.inc b/include/class_config.inc index d63109e72..f54334346 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -398,10 +398,6 @@ class config /* Load in-ldap configuration */ $this->load_inldap_config(); - /* Remove possibly added ',' from end of group and people ou */ - $this->current['GROUPRDN'] = preg_replace("/,*$/", "", $this->current['GROUPRDN']); - $this->current['USERRDN'] = preg_replace("/,*$/", "", $this->current['USERRDN']); - /* We update LDAPSIZELIMIT as it may have been changed by ldap config */ session::global_set('size_limit', $this->current['LDAPSIZELIMIT']); diff --git a/include/functions.inc b/include/functions.inc index a12047269..458607756 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1116,17 +1116,6 @@ function get_people_ou() return get_ou('userRDN'); } -/*! \brief Get the OU for groups - * - * Function for getting the groupRDN - * - * \return the ou of the groupRDN - */ -function get_groups_ou() -{ - return get_ou('groupRDN'); -} - /*! \brief Return a base from a given user DN * * \code @@ -1328,8 +1317,8 @@ function dn2base($dn, $ou = NULL) if (get_people_ou() != '') { $dn = preg_replace('/,'.get_people_ou().'/i', ',', $dn); } - if (get_groups_ou() != '') { - $dn = preg_replace('/,'.get_groups_ou().'/i', ',', $dn); + if (get_ou('groupRDN') != '') { + $dn = preg_replace('/,'.get_ou('groupRDN').'/i', ',', $dn); } } else { $dn = preg_replace("/,$ou/i", ',', $dn); diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc index f4ae437a3..58696221b 100644 --- a/plugins/config/class_configInLdap.inc +++ b/plugins/config/class_configInLdap.inc @@ -299,11 +299,6 @@ class configInLdap extends simplePlugin 'fdUserRDN', TRUE, 'ou=people' ), - new StringAttribute ( - _('Groups RDN'), _('The branch where groups are stored.'), - 'fdGroupRDN', TRUE, - 'ou=groups' - ), new StringAttribute ( _('ACL role RDN'), _('The branch where ACL roles are stored.'), 'fdAclRoleRDN', TRUE, diff --git a/plugins/config/class_mainPluginsConfig.inc b/plugins/config/class_mainPluginsConfig.inc index 6024cbe89..db2479fec 100644 --- a/plugins/config/class_mainPluginsConfig.inc +++ b/plugins/config/class_mainPluginsConfig.inc @@ -1,7 +1,7 @@ <?php /* This code is part of FusionDirectory (http://www.fusiondirectory.org/) - Copyright (C) 2012-2016 FusionDirectory + Copyright (C) 2012-2017 FusionDirectory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,7 +42,7 @@ class mainPluginsConfig extends simplePlugin 'name' => _('Object groups'), 'attrs' => array( new StringAttribute ( - _('OGroup RDN'), _('Branch in which object groups will be stored'), + _('Groups RDN'), _('Branch in which object groups will be stored'), 'fdOGroupRDN', TRUE, 'ou=groups' ), -- GitLab