Skip to content
Snippets Groups Projects
Commit d2c090e3 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Gestion de LDAP si le module est activé

parent 3908d6fc
No related branches found
No related tags found
No related merge requests found
...@@ -94,6 +94,8 @@ class Contact ...@@ -94,6 +94,8 @@ class Contact
print $this->db->error() . '<br>' . $sql; print $this->db->error() . '<br>' . $sql;
} }
if (define('MAIN_MODULE_LDAP') && MAIN_MODULE_LDAP)
{
$ds = dolibarr_ldap_connect(); $ds = dolibarr_ldap_connect();
if ($ds) if ($ds)
...@@ -145,10 +147,9 @@ class Contact ...@@ -145,10 +147,9 @@ class Contact
{ {
echo "LDAP bind failed..."; echo "LDAP bind failed...";
} }
ldap_close($ds); ldap_close($ds);
} }
}
else else
{ {
echo "Unable to connect to LDAP server"; echo "Unable to connect to LDAP server";
...@@ -156,6 +157,29 @@ class Contact ...@@ -156,6 +157,29 @@ class Contact
return $result; return $result;
} }
/*
* Mise jour des infos persos
*
*/
Function update_perso($id, $user=0)
{
$sql = "UPDATE llx_socpeople SET ";
$sql .= " birthday='".$db->idate($this->birthday)."'";
$sql .= " WHERE idp=$id";
$result = $this->db->query($sql);
if (!$result)
{
print $this->db->error() . '<br>' . $sql;
}
return $result;
}
/* /*
* *
* *
...@@ -241,6 +265,8 @@ class Contact ...@@ -241,6 +265,8 @@ class Contact
print $this->db->error() . '<br>' . $sql; print $this->db->error() . '<br>' . $sql;
} }
if (define('MAIN_MODULE_LDAP') && MAIN_MODULE_LDAP)
{
$ds = dolibarr_ldap_connect(); $ds = dolibarr_ldap_connect();
if ($ds) if ($ds)
...@@ -260,10 +286,9 @@ class Contact ...@@ -260,10 +286,9 @@ class Contact
{ {
echo "LDAP bind failed..."; echo "LDAP bind failed...";
} }
ldap_close($ds); ldap_close($ds);
} }
}
else else
{ {
echo "Unable to connect to LDAP server"; echo "Unable to connect to LDAP server";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment