Fix: group ldap test need "uniqueMember" field

This commit is contained in:
Regis Houssin 2009-12-19 14:12:55 +00:00
parent 2c3ffabec0
commit 10b11948c8
2 changed files with 14 additions and 2 deletions

View File

@ -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 '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="'.$conf->global->LDAP_GROUP_FIELD_DESCRIPTION.'"'.($conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION?' checked="true"':'')."></td>";
print '</tr>';
// User group
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldUserGroup").'</td><td>';
print '<input size="25" type="text" name="fieldusergroup" value="'.$conf->global->LDAP_GROUP_FIELD_USERGROUP.'">';
print '</td><td>'.$langs->trans("LDAPFieldUserGroupExample").'</td>';
print '<td align="right"><input type="radio" name="key" value="'.$conf->global->LDAP_GROUP_FIELD_USERGROUP.'"'.($conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_USERGROUP?' checked="true"':'')."></td>";
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';

View File

@ -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();
}