Utilisation du DN de la config
This commit is contained in:
parent
9be6d3fa73
commit
dc7a8634c2
@ -69,7 +69,7 @@ class Contact
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
* Mise à jour des infos
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function update($id)
|
Function update($id)
|
||||||
@ -99,7 +99,7 @@ class Contact
|
|||||||
{
|
{
|
||||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||||
|
|
||||||
$ldapbind=dolibarr_ldap_bind($ds);
|
$ldapbind = dolibarr_ldap_bind($ds);
|
||||||
|
|
||||||
if ($ldapbind)
|
if ($ldapbind)
|
||||||
{
|
{
|
||||||
@ -122,15 +122,20 @@ class Contact
|
|||||||
|
|
||||||
//$info["homePostalAddress"] = "AdressePersonnelle\nVIlle";
|
//$info["homePostalAddress"] = "AdressePersonnelle\nVIlle";
|
||||||
|
|
||||||
$info["street"] = "street";
|
//$info["street"] = "street";
|
||||||
$info["postalCode"] = "postalCode";
|
//$info["postalCode"] = "postalCode";
|
||||||
$info["postalAddress"] = "postalAddress";
|
//$info["postalAddress"] = "postalAddress";
|
||||||
|
|
||||||
$info["objectclass"] = "inetOrgPerson";
|
$info["objectclass"] = "inetOrgPerson";
|
||||||
|
|
||||||
// add data to directory
|
// add data to directory
|
||||||
$r = @ldap_delete($ds, "cn=".$this->old_firstname." ".$this->old_name.", dc=rodo, dc=lan");
|
$dn = "cn=".$this->old_firstname." ".$this->old_name.", ".LDAP_SERVER_DN ;
|
||||||
$r = ldap_add($ds, "cn=".$info["cn"].", dc=rodo, dc=lan", $info);
|
|
||||||
|
$r = @ldap_delete($ds, $dn);
|
||||||
|
|
||||||
|
$dn = "cn=".$info["cn"].", ".LDAP_SERVER_DN ;
|
||||||
|
|
||||||
|
$r = ldap_add($ds, $dn, $info);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -214,15 +219,13 @@ class Contact
|
|||||||
{
|
{
|
||||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||||
|
|
||||||
$ldapbind=dolibarr_ldap_bind($ds);
|
$ldapbind = dolibarr_ldap_bind($ds);
|
||||||
|
|
||||||
if ($ldapbind)
|
if ($ldapbind)
|
||||||
{
|
{
|
||||||
// delete from ldap directory
|
// delete from ldap directory
|
||||||
$dn = "cn=".$this->old_firstname." ".$this->old_name.", ".LDAP_SERVER_DN ;
|
$dn = "cn=".$this->old_firstname." ".$this->old_name.", ".LDAP_SERVER_DN ;
|
||||||
|
|
||||||
print $dn;
|
|
||||||
|
|
||||||
$r = ldap_delete($ds, $dn);
|
$r = ldap_delete($ds, $dn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user