From 2b0102c78be3206eb136a7470bf9f80cda1f4b6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Aug 2009 00:15:40 +0000 Subject: [PATCH] Fix: Setup of member synchronization does not conflict with contact or user synchronization --- htdocs/adherents/adherent.class.php | 34 ++++++------ htdocs/adherents/ldap.php | 8 +-- htdocs/admin/ldap.php | 11 ++-- htdocs/admin/ldap_contacts.php | 78 +++++++++++++-------------- htdocs/admin/ldap_groups.php | 18 +++---- htdocs/admin/ldap_members.php | 82 ++++++++++++++--------------- htdocs/contact.class.php | 40 +++++++------- htdocs/contact/ldap.php | 4 +- htdocs/usergroup.class.php | 6 +-- 9 files changed, 141 insertions(+), 140 deletions(-) diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index 89691d41d3f..336e633f694 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -1948,23 +1948,23 @@ class Adherent extends CommonObject $info["objectclass"]=split(',',$conf->global->LDAP_MEMBER_OBJECT_CLASS); // Member - if ($this->fullname && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname; - if ($this->nom && $conf->global->LDAP_FIELD_NAME) $info[$conf->global->LDAP_FIELD_NAME] = $this->nom; - if ($this->prenom && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->prenom; - if ($this->login && $conf->global->LDAP_FIELD_LOGIN) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login; - if ($this->pass && $conf->global->LDAP_FIELD_PASSWORD) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte - if ($this->poste && $conf->global->LDAP_FIELD_TITLE) $info[$conf->global->LDAP_FIELD_TITLE] = $this->poste; - if ($this->adresse && $conf->global->LDAP_FIELD_ADDRESS) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->adresse; - if ($this->cp && $conf->global->LDAP_FIELD_ZIP) $info[$conf->global->LDAP_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_FIELD_TOWN) $info[$conf->global->LDAP_FIELD_TOWN] = $this->ville; - if ($this->pays && $conf->global->LDAP_FIELD_COUNTRY) $info[$conf->global->LDAP_FIELD_COUNTRY] = $this->pays; - if ($this->email && $conf->global->LDAP_FIELD_MAIL) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email; - if ($this->phone && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = $this->phone; - if ($this->phone_perso && $conf->global->LDAP_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_FIELD_PHONE_PERSO] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_FIELD_FAX) $info[$conf->global->LDAP_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note; - if ($this->naiss && $conf->global->LDAP_FIELD_BIRTHDATE) $info[$conf->global->LDAP_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); + if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; + if ($this->nom && $conf->global->LDAP_MEMBER_FIELD_NAME) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom; + if ($this->prenom && $conf->global->LDAP_MEMBER_FIELD_FIRSTNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom; + if ($this->login && $conf->global->LDAP_MEMBER_FIELD_LOGIN) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; + if ($this->pass && $conf->global->LDAP_MEMBER_FIELD_PASSWORD) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte + if ($this->poste && $conf->global->LDAP_MEMBER_FIELD_TITLE) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; + if ($this->adresse && $conf->global->LDAP_MEMBER_FIELD_ADDRESS) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse; + if ($this->cp && $conf->global->LDAP_MEMBER_FIELD_ZIP) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp; + if ($this->ville && $conf->global->LDAP_MEMBER_FIELD_TOWN) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville; + if ($this->pays && $conf->global->LDAP_MEMBER_FIELD_COUNTRY) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->pays; + if ($this->email && $conf->global->LDAP_MEMBER_FIELD_MAIL) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; + if ($this->phone && $conf->global->LDAP_MEMBER_FIELD_PHONE) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; + if ($this->phone_perso && $conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; + if ($this->phone_mobile && $conf->global->LDAP_MEMBER_FIELD_MOBILE) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && $conf->global->LDAP_MEMBER_FIELD_FAX) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; + if ($this->note && $conf->global->LDAP_MEMBER_FIELD_DESCRIPTION) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; + if ($this->naiss && $conf->global->LDAP_MEMBER_FIELD_BIRTHDATE) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); if (isset($this->statut) && $conf->global->LDAP_FIELD_MEMBER_STATUS) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 07f1f51548a..8fd322e7690 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -130,7 +130,7 @@ print ''; print ''.$langs->trans("Login").''.$adh->login.' '; // Password not crypted -if ($conf->global->LDAP_FIELD_PASSWORD) +if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD) { print ''.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''.$fuser->pass.''; @@ -138,7 +138,7 @@ if ($conf->global->LDAP_FIELD_PASSWORD) } // Password crypted -if ($conf->global->LDAP_FIELD_PASSWORD_CRYPTED) +if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED) { print ''.$langs->trans("LDAPFieldPasswordCrypted").''; print ''.$fuser->pass_crypted.''; @@ -177,14 +177,14 @@ if ($message) { print $message; } print '
'; -if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') +if ($conf->global->LDAP_MEMBER_SYNCHRO_ACTIVE == 'dolibarr2ldap') { print ''.$langs->trans("ForceSynchronize").''; } print "
\n"; -if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "
\n"; +if ($conf->global->LDAP_MEMBER_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "
\n"; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 93a8b361fc3..26b81cc1f47 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -22,7 +22,7 @@ * $Id$ * $Source$ */ - + /** \file htdocs/admin/ldap.php \ingroup ldap @@ -44,11 +44,11 @@ if (!$user->admin) /* * Actions */ - + if ($_GET["action"] == 'setvalue' && $user->admin) { $error=0; - + if (! dolibarr_set_const($db, 'LDAP_SERVER_TYPE',$_POST["type"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION',$_POST["version"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST',$_POST["host"],'chaine',0,'',$conf->entity)) $error++; @@ -58,8 +58,9 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_ADMIN_DN',$_POST["admin"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_ADMIN_PASS',$_POST["pass"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS',$_POST["usetls"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',$_POST["activecontact"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE',$_POST["activesynchro"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',$_POST["activecontact"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE',$_POST["activemembers"],'chaine',0,'',$conf->entity)) $error++; if ($error) @@ -149,7 +150,7 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print ''.$langs->trans("Example").''; print "\n"; - + // Type $var=!$var; print ''.$langs->trans("Type").''; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 67b28142afe..ef4fc3f0e7e 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -52,19 +52,19 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN',$_POST["contactdn"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS',$_POST["objectclass"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',$_POST["fieldfirstname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY',$_POST["fieldcompany"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',$_POST["fieldmail"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',$_POST["fieldphone"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_HOMEPHONE',$_POST["fieldhomephone"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',$_POST["fieldmobile"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',$_POST["fieldfax"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS',$_POST["fieldaddress"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP',$_POST["fieldzip"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN',$_POST["fieldtown"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY',$_POST["fieldcountry"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FULLNAME',$_POST["fieldfullname"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FIRSTNAME',$_POST["fieldfirstname"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COMPANY',$_POST["fieldcompany"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MAIL',$_POST["fieldmail"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE',$_POST["fieldphone"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE',$_POST["fieldhomephone"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE',$_POST["fieldmobile"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX',$_POST["fieldfax"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS',$_POST["fieldaddress"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP',$_POST["fieldzip"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN',$_POST["fieldtown"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY',$_POST["fieldcountry"],'chaine',0,'',$conf->entity)) $error++; if ($error) { @@ -140,105 +140,105 @@ print "\n"; // Common name $var=!$var; print ''.$langs->trans("LDAPFieldFullname").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldFullnameExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_FULLNAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FULLNAME?' checked="true"':'').">"; print ''; // Name $var=!$var; print ''.$langs->trans("LDAPFieldName").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldNameExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_NAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_NAME?' checked="true"':'').">"; print ''; // Firstname $var=!$var; print ''.$langs->trans("LDAPFieldFirstName").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_FIRSTNAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME?' checked="true"':'').">"; print ''; // Company $var=!$var; print ''.$langs->trans("LDAPFieldCompany").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldCompanyExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_COMPANY?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COMPANY?' checked="true"':'').">"; print ''; // Mail $var=!$var; print ''.$langs->trans("LDAPFieldMail").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldMailExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_MAIL?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MAIL?' checked="true"':'').">"; print ''; // Phone pro $var=!$var; print ''.$langs->trans("LDAPFieldPhone").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldPhoneExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_PHONE?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_PHONE?' checked="true"':'').">"; print ''; // Phone home $var=!$var; print ''.$langs->trans("LDAPFieldHomePhone").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_HOMEPHONE?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE?' checked="true"':'').">"; print ''; // Mobile $var=!$var; print ''.$langs->trans("LDAPFieldMobile").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldMobileExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_MOBILE?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked="true"':'').">"; print ''; // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldFaxExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_FAX?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FAX?' checked="true"':'').">"; print ''; // Address $var=!$var; print ''.$langs->trans("LDAPFieldAddress").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldAddressExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_ADDRESS?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked="true"':'').">"; print ''; // CP $var=!$var; print ''.$langs->trans("LDAPFieldZip").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldZipExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_ZIP?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked="true"':'').">"; print ''; // Ville $var=!$var; print ''.$langs->trans("LDAPFieldTown").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldTownExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_TOWN?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked="true"':'').">"; print ''; // Pays $var=!$var; print ''.$langs->trans("LDAPFieldCountry").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldCountryExample").''; -print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_COUNTRY?' checked="true"':'').">"; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked="true"':'').">"; print ''; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 2d1e2bb4bfb..668e23c3bc3 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -53,9 +53,9 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',$_POST["group"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS',$_POST["objectclass"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',$_POST["fielddescription"],'chaine',0,'',$conf->entity)) $error++; + 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 ($error) { @@ -140,25 +140,25 @@ print ''; // Common name $var=!$var; print ''.$langs->trans("LDAPFieldCommonName").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").''; -print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_FIELD_FULLNAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_FULLNAME?' checked="true"':'').">"; print ''; // Name $var=!$var; print ''.$langs->trans("LDAPFieldName").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldNameExample").''; -print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_FIELD_NAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_NAME?' checked="true"':'').">"; print ''; // Description $var=!$var; print ''.$langs->trans("LDAPFieldDescription").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").''; -print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_FIELD_DESCRIPTION?' checked="true"':'').">"; +print 'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION?' checked="true"':'').">"; print ''; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 62200f49221..51eccccf2c8 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -53,24 +53,24 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',$_POST["user"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',$_POST["objectclass"],'chaine',0,'',$conf->entity)) $error++; // Members - if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN',$_POST["fieldlogin"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN_SAMBA',$_POST["fieldloginsamba"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD',$_POST["fieldpassword"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD_CRYPTED',$_POST["fieldpasswordcrypted"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',$_POST["fieldfirstname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',$_POST["fieldmail"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',$_POST["fieldphone"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE_PERSO',$_POST["fieldphoneperso"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',$_POST["fieldmobile"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',$_POST["fieldfax"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS',$_POST["fieldaddress"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP',$_POST["fieldzip"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN',$_POST["fieldtown"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY',$_POST["fieldcountry"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',$_POST["fielddescription"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_BIRTHDATE',$_POST["fieldbirthdate"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FULLNAME',$_POST["fieldfullname"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN',$_POST["fieldlogin"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN_SAMBA',$_POST["fieldloginsamba"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD',$_POST["fieldpassword"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD_CRYPTED',$_POST["fieldpasswordcrypted"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FIRSTNAME',$_POST["fieldfirstname"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MAIL',$_POST["fieldmail"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE',$_POST["fieldphone"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO',$_POST["fieldphoneperso"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',$_POST["fieldmobile"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',$_POST["fieldfax"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',$_POST["fieldaddress"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',$_POST["fieldzip"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN',$_POST["fieldtown"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COUNTRY',$_POST["fieldcountry"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_DESCRIPTION',$_POST["fielddescription"],'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_BIRTHDATE',$_POST["fieldbirthdate"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_STATUS',$_POST["fieldstatus"],'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', $_POST["fieldendlastsubscription"],'chaine',0,'',$conf->entity)) $error++; @@ -164,23 +164,23 @@ print ''; // Common name $var=!$var; print ''.$langs->trans("LDAPFieldFullname").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldFullnameExample").''; -print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_FIELD_FULLNAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_FULLNAME?' checked="true"':'').">"; print ''; // Name $var=!$var; print ''.$langs->trans("LDAPFieldName").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldNameExample").''; -print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_FIELD_NAME?' checked="true"':'').">"; +print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_NAME?' checked="true"':'').">"; print ''; // Firstname $var=!$var; print ''.$langs->trans("LDAPFieldFirstName").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").''; print ' '; print ''; @@ -188,23 +188,23 @@ print ''; // Login unix $var=!$var; print ''.$langs->trans("LDAPFieldLoginUnix").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldLoginExample").''; -print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_FIELD_LOGIN?' checked="true"':'').">"; +print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN?' checked="true"':'').">"; print ''; // Login samba $var=!$var; print ''.$langs->trans("LDAPFieldLoginSamba").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").''; -print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_FIELD_LOGIN_SAMBA?' checked="true"':'').">"; +print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA?' checked="true"':'').">"; print ''; // Password not crypted $var=!$var; print ''.$langs->trans("LDAPFieldPasswordNotCrypted").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldPasswordExample").''; print ' '; print ''; @@ -212,7 +212,7 @@ print ''; // Password crypted $var=!$var; print ''.$langs->trans("LDAPFieldPasswordCrypted").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldPasswordExample").''; print ' '; print ''; @@ -220,15 +220,15 @@ print ''; // Mail $var=!$var; print ''.$langs->trans("LDAPFieldMail").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldMailExample").''; -print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_FIELD_MAIL?' checked="true"':'').">"; +print 'global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_MAIL?' checked="true"':'').">"; print ''; // Phone pro $var=!$var; print ''.$langs->trans("LDAPFieldPhone").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldPhoneExample").''; print ' '; print ''; @@ -236,7 +236,7 @@ print ''; // Phone perso $var=!$var; print ''.$langs->trans("LDAPFieldHomePhone").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").''; print ' '; print ''; @@ -244,7 +244,7 @@ print ''; // Mobile $var=!$var; print ''.$langs->trans("LDAPFieldMobile").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldMobileExample").''; print ' '; print ''; @@ -252,7 +252,7 @@ print ''; // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldFaxExample").''; print ' '; print ''; @@ -260,7 +260,7 @@ print ''; // Address $var=!$var; print ''.$langs->trans("LDAPFieldAddress").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldAddressExample").''; print ' '; print ''; @@ -268,7 +268,7 @@ print ''; // CP $var=!$var; print ''.$langs->trans("LDAPFieldZip").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldZipExample").''; print ' '; print ''; @@ -276,7 +276,7 @@ print ''; // Ville $var=!$var; print ''.$langs->trans("LDAPFieldTown").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldTownExample").''; print ' '; print ''; @@ -284,7 +284,7 @@ print ''; // Pays $var=!$var; print ''.$langs->trans("LDAPFieldCountry").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldCountryExample").''; print ' '; print ''; @@ -292,7 +292,7 @@ print ''; // Description $var=!$var; print ''.$langs->trans("LDAPFieldDescription").''; -print ''; +print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").''; print ' '; print ''; @@ -300,7 +300,7 @@ print ''; // Date naissance $var=!$var; print ''.$langs->trans("LDAPFieldBirthdate").''; -print ''; +print ''; print ' '; print ' '; print ''; diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index d155c5024e5..af6431c95cd 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -22,18 +22,18 @@ */ /** - \file htdocs/contact.class.php - \ingroup societe - \brief Fichier de la classe des contacts - \version $Id$ + * \file htdocs/contact.class.php + * \ingroup societe + * \brief Fichier de la classe des contacts + * \version $Id$ */ require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); /** - \class Contact - \brief Classe permettant la gestion des contacts + * \class Contact + * \brief Classe permettant la gestion des contacts */ class Contact extends CommonObject { @@ -250,9 +250,9 @@ class Contact extends CommonObject $info["objectclass"]=split(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS); // Champs - if ($this->getFullName($langs) && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->getFullName($langs); - if ($this->name && $conf->global->LDAP_FIELD_NAME) $info[$conf->global->LDAP_FIELD_NAME] = $this->name; - if ($this->firstname && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname; + if ($this->getFullName($langs) && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->getFullName($langs); + if ($this->name && $conf->global->LDAP_CONTACT_FIELD_NAME) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->name; + if ($this->firstname && $conf->global->LDAP_CONTACT_FIELD_FIRSTNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; if ($this->poste) $info["title"] = $this->poste; if ($this->socid > 0) @@ -260,21 +260,21 @@ class Contact extends CommonObject $soc = new Societe($this->db); $soc->fetch($this->socid); - $info[$conf->global->LDAP_FIELD_COMPANY] = $soc->nom; + $info[$conf->global->LDAP_CONTACT_FIELD_COMPANY] = $soc->nom; if ($soc->client == 1) $info["businessCategory"] = "Customers"; if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; } - if ($this->address && $conf->global->LDAP_FIELD_ADDRESS) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address; - if ($this->cp && $conf->global->LDAP_FIELD_ZIP) $info[$conf->global->LDAP_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_FIELD_TOWN) $info[$conf->global->LDAP_FIELD_TOWN] = $this->ville; - if ($this->pays && $conf->global->LDAP_FIELD_COUNTRY) $info[$conf->global->LDAP_FIELD_COUNTRY] = $this->pays_code; - if ($this->phone_pro && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = $this->phone_pro; - if ($this->phone_perso && $conf->global->LDAP_FIELD_HOMEPHONE) $info[$conf->global->LDAP_FIELD_HOMEPHONE] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_FIELD_FAX) $info[$conf->global->LDAP_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note; - if ($this->email && $conf->global->LDAP_FIELD_MAIL) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email; + if ($this->address && $conf->global->LDAP_CONTACT_FIELD_ADDRESS) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; + if ($this->cp && $conf->global->LDAP_CONTACT_FIELD_ZIP) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; + if ($this->ville && $conf->global->LDAP_CONTACT_FIELD_TOWN) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; + if ($this->pays && $conf->global->LDAP_CONTACT_FIELD_COUNTRY) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->pays_code; + if ($this->phone_pro && $conf->global->LDAP_CONTACT_FIELD_PHONE) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; + if ($this->phone_perso && $conf->global->LDAP_CONTACT_FIELD_HOMEPHONE) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; + if ($this->phone_mobile && $conf->global->LDAP_CONTACT_FIELD_MOBILE) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && $conf->global->LDAP_CONTACT_FIELD_FAX) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; + if ($this->note && $conf->global->LDAP_CONTACT_FIELD_DESCRIPTION) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; + if ($this->email && $conf->global->LDAP_CONTACT_FIELD_MAIL) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 9d8adff1df4..417a66d186e 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -144,14 +144,14 @@ if ($message) { print $message; } print '
'; -if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') +if ($conf->global->LDAP_CONTACT_SYNCHRO_ACTIVE == 'dolibarr2ldap') { print ''.$langs->trans("ForceSynchronize").''; } print "
\n"; -if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "
\n"; +if ($conf->global->LDAP_CONTACT_SYNCHRO_ACTIVE == 'dolibarr2ldap') print "
\n"; diff --git a/htdocs/usergroup.class.php b/htdocs/usergroup.class.php index bf1fe87ea25..75c3ec949d8 100644 --- a/htdocs/usergroup.class.php +++ b/htdocs/usergroup.class.php @@ -560,9 +560,9 @@ class UserGroup extends CommonObject $info["objectclass"]=split(',',$conf->global->LDAP_GROUP_OBJECT_CLASS); // Champs - if ($this->nom && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->nom; - if ($this->nom && $conf->global->LDAP_FIELD_NAME) $info[$conf->global->LDAP_FIELD_NAME] = $this->nom; - if ($this->note && $conf->global->LDAP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note; + 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; return $info; }