From 10b11948c872281324d2c7c6de320742b573e2c8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 19 Dec 2009 14:12:55 +0000 Subject: [PATCH] Fix: group ldap test need "uniqueMember" field --- htdocs/admin/ldap_groups.php | 9 +++++++++ htdocs/usergroup.class.php | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index b175d5cc9ce..bf953d33b18 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -56,6 +56,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME',$_POST["fieldfullname"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION',$_POST["fielddescription"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_USERGROUP',$_POST["fieldusergroup"],'chaine',0,'',$conf->entity)) $error++; if ($error) { @@ -161,6 +162,14 @@ print ''.$langs->trans("LDAPFieldDescriptionExample").''; print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION?' checked="true"':'').">"; print ''; +// User group +$var=!$var; +print ''.$langs->trans("LDAPFieldUserGroup").''; +print ''; +print ''.$langs->trans("LDAPFieldUserGroupExample").''; +print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_USERGROUP?' checked="true"':'').">"; +print ''; + $var=!$var; print ''; diff --git a/htdocs/usergroup.class.php b/htdocs/usergroup.class.php index 85de6598e8f..b8421282143 100644 --- a/htdocs/usergroup.class.php +++ b/htdocs/usergroup.class.php @@ -40,9 +40,10 @@ class UserGroup extends CommonObject var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; // Group id - var $entity; // Entity of group + var $entity; // Entity of group var $nom; // Name of group var $note; // Note on group + var $user; // Users of group var $datec; // Creation date of group var $datem; // Modification date of group @@ -561,6 +562,7 @@ class UserGroup extends CommonObject if ($this->nom && $conf->global->LDAP_GROUP_FIELD_FULLNAME) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom; if ($this->nom && $conf->global->LDAP_GROUP_FIELD_NAME) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom; if ($this->note && $conf->global->LDAP_GROUP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note; + if ($this->user && $conf->global->LDAP_GROUP_FIELD_USERGROUP) $info[$conf->global->LDAP_GROUP_FIELD_USERGROUP] = $this->user; return $info; } @@ -571,7 +573,7 @@ class UserGroup extends CommonObject */ function initAsSpecimen() { - global $user,$langs; + global $conf, $user, $langs; // Initialise parametres $this->id=0; @@ -580,6 +582,7 @@ class UserGroup extends CommonObject $this->nom='DOLIBARR GROUP SPECIMEN'; $this->note='This is a note'; + $this->user=$conf->global->LDAP_KEY_USERS.'=DOLIBARR USER,'.$conf->global->LDAP_USER_DN; $this->datec=time(); $this->datem=time(); }