New: More robust LDAP synchronizing

This commit is contained in:
Laurent Destailleur 2009-08-12 00:40:16 +00:00
parent 37cb774ae7
commit aaca78bb6b
2 changed files with 7 additions and 4 deletions

View File

@ -1957,7 +1957,7 @@ class Adherent extends CommonObject
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->pays_code && $conf->global->LDAP_MEMBER_FIELD_COUNTRY) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->pays_code;
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;

View File

@ -49,7 +49,8 @@ class Contact extends CommonObject
var $address;
var $cp;
var $ville;
var $fk_pays;
var $fk_pays; // Id of country
var $pays_code; // Code of country
var $socid; // fk_soc
var $status; // 0=brouillon, 1=4=actif, 5=inactif
@ -268,7 +269,7 @@ class Contact extends CommonObject
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->pays_code && $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;
@ -895,7 +896,7 @@ class Contact extends CommonObject
}
}
// Initialise param<EFBFBD>tres
// Initialise parameters
$this->id=0;
$this->specimen=1;
$this->nom = 'DOLIBARR';
@ -906,6 +907,8 @@ class Contact extends CommonObject
$this->cp = '75000';
$this->ville = 'Paris';
$this->fk_pays = 1;
$this->pays_code = 'FR';
$this->pays = 'France';
$this->email = 'specimen@specimen.com';
$socid = rand(1, $num_socs);
$this->socid = $socids[$socid];