';
+ }
+ }
+ return 1;
+ }
+
}
?>
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 636b68808b0..cec098e45a3 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -553,7 +553,7 @@ LDAPFieldName=Name
LDAPFieldNameExample=Suggested value : sn
LDAPFieldFirstName=Firstname
LDAPFieldFirstNameExample=Suggested value : givenname
-LDAPFieldMail=E-Mail address
+LDAPFieldMail=Email address
LDAPFieldMailExample=Suggested value : mail
LDAPFieldPhone=Phone number
LDAPFieldPhoneExample=Suggested value : telephonenumber
@@ -561,6 +561,12 @@ LDAPFieldFax=Fax number
LDAPFieldFaxExample=Suggested value : facsimiletelephonenumber
LDAPFieldMobile=Cellular phone
LDAPFieldMobileExample=Suggested value : mobile
+LDAPFieldAddress=Street
+LDAPFieldAddressExample=Valeur recommandée : street
+LDAPFieldZip=Zip
+LDAPFieldZipExample=Valeur recommandée : postalcode
+LDAPFieldTown=Town
+LDAPFieldTownExample=Valeur recommandée : l
LDAPParametersAreStillHardCoded=LDAP parametres are still hardcoded (in contact class)
LDAPSetupNotComplete=LDAP setup not complete (go on others tabs)
LDAPNoUserOrPasswordProvidedAccessIsReadOnly=No administrator or password provided. LDAP access will be anonymous and in read only mode.
diff --git a/htdocs/langs/fr_BE/admin.lang b/htdocs/langs/fr_BE/admin.lang
index b120c33dffd..5f9198a6c7a 100644
--- a/htdocs/langs/fr_BE/admin.lang
+++ b/htdocs/langs/fr_BE/admin.lang
@@ -525,11 +525,11 @@ LDAPFieldName=Non
LDAPFieldNameExample=Attribut par défaut : sn
LDAPFieldFirstName=Prénom
LDAPFieldFirstNameExample=Attribut par défaut: givenname
-LDAPFieldMail=Adresse e-mail
+LDAPFieldMail=Email
LDAPFieldMailExample=Attribut par défaut: mail
-LDAPFieldPhone=Numéro de téléphone
+LDAPFieldPhone=Téléphone
LDAPFieldPhoneExample=Attribut par défaut: telephonenumber
-LDAPFieldFax=Numéro de fax
+LDAPFieldFax=Fax
LDAPFieldFaxExample=Attribut par défaut: facsimiletelephonenumber
LDAPFieldMobile=Téléphone cellulaire
LDAPFieldMobileExample=Attribut par défault: mobile
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index b3cd803d905..5bccca9ff75 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -553,14 +553,20 @@ LDAPFieldName=Nom
LDAPFieldNameExample=Valeur recommandée : sn
LDAPFieldFirstName=Prénom
LDAPFieldFirstNameExample=Valeur recommandée : givenname
-LDAPFieldMail=Adresse E-Mail
+LDAPFieldMail=Email
LDAPFieldMailExample=Valeur recommandée : mail
-LDAPFieldPhone=Numéro de téléphone
+LDAPFieldPhone=Téléphone
LDAPFieldPhoneExample=Valeur recommandée : telephonenumber
-LDAPFieldFax=Numéro de fax
+LDAPFieldFax=Fax
LDAPFieldFaxExample=Valeur recommandée : facsimiletelephonenumber
LDAPFieldMobile=Téléphone portable
LDAPFieldMobileExample=Valeur recommandée : mobile
+LDAPFieldAddress=Adresse
+LDAPFieldAddressExample=Valeur recommandée : street
+LDAPFieldZip=Code postal
+LDAPFieldZipExample=Valeur recommandée : postalcode
+LDAPFieldTown=Ville
+LDAPFieldTownExample=Valeur recommandée : l
LDAPParametersAreStillHardCoded=Les parametres LDAP sont codés en dur (dans classe contact)
LDAPSetupNotComplete=Configuration LDAP incomplète (à compléter sur les autres onglets)
LDAPNoUserOrPasswordProvidedAccessIsReadOnly=Administrateur ou mot de passe non renseigné. Les accès LDAP seront donc anonymes et en lecture seule.
diff --git a/htdocs/langs/fr_FR/ldap.lang b/htdocs/langs/fr_FR/ldap.lang
index e0925ce956d..9e7c8d77146 100644
--- a/htdocs/langs/fr_FR/ldap.lang
+++ b/htdocs/langs/fr_FR/ldap.lang
@@ -3,4 +3,7 @@ DomainPassword=Mot de passe du domaine
UserMustChangePassNextLogon=L'utilisateur doit changer de mot de passe à la prochaine connexion
LdapUacf_NORMAL_ACCOUNT=Compte Utilisateur
LdapUacf_DONT_EXPIRE_PASSWORD=Le mot de passe n'expire jamais
-LdapUacf_ACCOUNTDISABLE=Le compte est désactivé sur le domaine
\ No newline at end of file
+LdapUacf_ACCOUNTDISABLE=Le compte est désactivé sur le domaine
+LDAPInformationsForThisContact=Informations en base LDAP pour ce contact
+LDAPInformationsForThisUser=Informations en base LDAP pour cet utilisateur
+LDAPAttribute=Attribut
diff --git a/htdocs/lib/authldap.lib.php b/htdocs/lib/authldap.lib.php
index 254cbd2f5d1..02ca9917d4a 100644
--- a/htdocs/lib/authldap.lib.php
+++ b/htdocs/lib/authldap.lib.php
@@ -108,7 +108,8 @@ class AuthLdap {
* Constructor- creates a new instance of the authentication class
*
*/
- function AuthLdap () {
+ function AuthLdap ()
+ {
global $conf;
//Server
@@ -431,8 +432,21 @@ class AuthLdap {
*/
function add($dn, $info)
{
- dolibarr_syslog("authldap::add Add LDAP entry dn=".$dn);
-
+ global $conf;
+
+ // Encode en UTF8
+ if ($conf->global->LDAP_SERVER_TYPE != 'activedirectory')
+ {
+ $dn=utf8_encode($dn);
+ foreach($info as $key => $val)
+ {
+ if (! is_array($val)) $info[$key]=utf8_encode($val);
+ }
+ }
+
+ dolibarr_syslog("authldap::add dn=".$dn);
+ dolibarr_syslog("authldap::add info=".join(',',$info));
+
//print_r($info);
$result=@ldap_add($this->connection, $dn, $info);
@@ -447,6 +461,14 @@ class AuthLdap {
*/
function delete($dn)
{
+ global $conf;
+
+ // Encode en UTF8
+ if ($conf->global->LDAP_SERVER_TYPE != 'activedirectory')
+ {
+ $dn=utf8_encode($dn);
+ }
+
dolibarr_syslog("authldap::delete Delete LDAP entry dn=".$dn);
$result=@ldap_delete($this->connection, $dn);
@@ -456,6 +478,7 @@ class AuthLdap {
}
+
// 2.4 Attribute methods -----------------------------------------------------
/**
* 2.4.1 : Returns an array containing a set of attribute values.
@@ -625,36 +648,37 @@ class AuthLdap {
return $result;
}
- /**
- * \brief fonction de recherche avec filtre
- * \param dn de recherche
- * \param filtre de recherche (ex: sn=nom_personne)
- */
- function search( $checkDn, $filter) {
+ /**
+ * \brief fonction de recherche avec filtre
+ * \param dn de recherche
+ * \param filtre de recherche (ex: sn=nom_personne)
+ */
+ function search( $checkDn, $filter) {
+
+ // Perform the search and get the entry handles
+
+ // if the directory is AD, then bind first with the search user first
+ if ($this->serverType == "activedirectory") {
+ $this->authBind($this->searchUser, $this->searchPassword);
+ }
+
+ $this->result = @ldap_search( $this->connection, $checkDn, $filter);
+
+ $result = @ldap_get_entries( $this->connection, $this->result);
+
+ if (!$result)
+ {
+ $this->ldapErrorCode = ldap_errno( $this->connection);
+ $this->ldapErrorText = ldap_error( $this->connection);
+ }
+ else
+ {
+ ldap_free_result($this->result);
+ return $result;
+ }
+ }
- // Perform the search and get the entry handles
-
- // if the directory is AD, then bind first with the search user first
- if ($this->serverType == "activedirectory") {
- $this->authBind($this->searchUser, $this->searchPassword);
- }
-
- $this->result = @ldap_search( $this->connection, $checkDn, $filter);
-
- $result = @ldap_get_entries( $this->connection, $this->result);
- if (!$result)
- {
- $this->ldapErrorCode = ldap_errno( $this->connection);
- $this->ldapErrorText = ldap_error( $this->connection);
- }
- else
- {
- ldap_free_result($this->result);
- return $result;
- }
- }
-
/**
* \brief récupère les attributs de l'utilisateur
* \param $user : utilisateur ldap
diff --git a/htdocs/lib/contact.lib.php b/htdocs/lib/contact.lib.php
new file mode 100644
index 00000000000..c0328381212
--- /dev/null
+++ b/htdocs/lib/contact.lib.php
@@ -0,0 +1,69 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * or see http://www.gnu.org/
+ *
+ * $Id$
+ * $Source$
+ */
+
+/**
+ \file htdocs/lib/contact.lib.php
+ \brief Ensemble de fonctions de base pour les contacts
+ \version $Revision$
+
+ Ensemble de fonctions de base de dolibarr sous forme d'include
+*/
+
+function contact_prepare_head($contrat)
+{
+ global $langs, $conf;
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = DOL_URL_ROOT.'/contact/fiche.php?id='.$_GET["id"];
+ $head[$h][1] = $langs->trans("General");
+ $head[$h][2] = 'general';
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT.'/contact/perso.php?id='.$_GET["id"];
+ $head[$h][1] = $langs->trans("PersonalInformations");
+ $head[$h][2] = 'perso';
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT.'/contact/exportimport.php?id='.$_GET["id"];
+ $head[$h][1] = $langs->trans("ExportImport");
+ $head[$h][2] = 'exportimport';
+ $h++;
+
+ if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
+ {
+ $head[$h][0] = DOL_URL_ROOT.'/contact/ldap.php?id='.$_GET["id"];
+ $head[$h][1] = $langs->trans("LDAP");
+ $head[$h][2] = 'ldap';
+ $h++;
+ }
+
+ $head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$_GET["id"];
+ $head[$h][1] = $langs->trans("Info");
+ $head[$h][2] = 'info';
+ $h++;
+
+ return $head;
+}
+
+?>
\ No newline at end of file