diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php
index 8bdfb0800a1..9f1eec0fc68 100644
--- a/htdocs/adherents/adherent.class.php
+++ b/htdocs/adherents/adherent.class.php
@@ -21,15 +21,10 @@
*/
/**
- \file htdocs/adherents/adherent.class.php
- \ingroup adherent
- \brief Fichier de la classe permettant la gestion d'un adherent
- \author Rodolphe Qiedeville
- \author Jean-Louis Bergamo
- \author Laurent Destailleur
- \author Sebastien Di Cintio
- \author Benoit Mortier
- \version $Id$
+ * \file htdocs/adherents/adherent.class.php
+ * \ingroup adherent
+ * \brief Fichier de la classe permettant la gestion d'un adherent
+ * \version $Id$
*/
require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php");
@@ -1923,8 +1918,8 @@ class Adherent extends CommonObject
/**
* \brief Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
* \param info Info string loaded by _load_ldap_info
- * \param mode 0=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb)
- * 1=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
+ * \param mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
+ * 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb)
* 2=Return key only (uid=qqq)
* \return string DN
*/
diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index ad97e1d4ef8..4186c97718c 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -45,16 +45,6 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
-
-/*
- * Affichage page
- */
-
-llxHeader();
-
-$html = new Form($db);
-
-
$adh = new Adherent($db);
$adh->id = $rowid;
$result=$adh->fetch($rowid);
@@ -75,17 +65,22 @@ if (! $result)
+
+
+
/*
- * Affichage onglets
+ * View
*/
+
+llxHeader();
+
+$html = new Form($db);
+
$head = member_prepare_head($adh);
dol_fiche_head($head, 'ldap', $langs->trans("Member"), 0, 'user');
-/*
- * Fiche en mode visu
- */
print '
';
// Ref
@@ -129,7 +124,7 @@ $langs->load("admin");
// LDAP DN
print '| LDAP '.$langs->trans("LDAPMemberDn").' | '.$conf->global->LDAP_MEMBER_DN." |
\n";
-// LDAP Cl�
+// LDAP Cle
print '| LDAP '.$langs->trans("LDAPNamingAttribute").' | '.$conf->global->LDAP_KEY_MEMBERS." |
\n";
// LDAP Server
@@ -146,9 +141,10 @@ print '';
print '
';
-print_titre($langs->trans("LDAPInformationsForThisMember"));
// Affichage attributs LDAP
+print_titre($langs->trans("LDAPInformationsForThisMember"));
+
print '';
print '';
diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php
index 86a48c095b4..721812b379b 100644
--- a/htdocs/admin/ldap_contacts.php
+++ b/htdocs/admin/ldap_contacts.php
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/**
\file htdocs/admin/ldap_contacts.php
\ingroup ldap
@@ -50,7 +50,7 @@ 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++;
@@ -64,7 +64,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
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 ($error)
{
dol_print_error($db->error());
@@ -107,7 +107,7 @@ $var=true;
print '
';
print '| '.$langs->trans("LDAPSynchronizeUsers").' | ';
print "
\n";
-
+
// DN Pour les contacts
$var=!$var;
@@ -280,8 +280,9 @@ if (function_exists("ldap_connect"))
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
- $result2=$ldap->update($dn,$info,$user);
- $result3=$ldap->delete($dn);
+ $result1=$ldap->delete($dn); // To be sure to delete existing records
+ $result2=$ldap->add($dn,$info,$user); // Now the test
+ $result3=$ldap->delete($dn); // Clean what we did
if ($result2 > 0)
{
diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php
index b1dde21cf08..9a41285dc3d 100644
--- a/htdocs/admin/ldap_groups.php
+++ b/htdocs/admin/ldap_groups.php
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/**
\file htdocs/admin/ldap_groups.php
\ingroup ldap
@@ -43,7 +43,7 @@ if (!$user->admin)
/*
* Actions
*/
-
+
if ($_GET["action"] == 'setvalue' && $user->admin)
{
$error=0;
@@ -51,7 +51,7 @@ 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++;
@@ -202,8 +202,9 @@ if (function_exists("ldap_connect"))
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
- $result2=$ldap->update($dn,$info,$user);
- $result3=$ldap->delete($dn);
+ $result1=$ldap->delete($dn); // To be sure to delete existing records
+ $result2=$ldap->add($dn,$info,$user); // Now the test
+ $result3=$ldap->delete($dn); // Clean what we did
if ($result2 > 0)
{
diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php
index 162cf5a3873..05d36c00e6a 100644
--- a/htdocs/admin/ldap_members.php
+++ b/htdocs/admin/ldap_members.php
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/**
\file htdocs/admin/ldap_members.php
\ingroup ldap adherent
@@ -43,12 +43,12 @@ if (!$user->admin)
/*
* Actions
*/
-
+
if ($_GET["action"] == 'setvalue' && $user->admin)
{
$error=0;
if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$_POST["key"],'chaine',0,'',$conf->entity)) $error++;
-
+
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
@@ -394,8 +394,9 @@ if (function_exists("ldap_connect"))
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
- $result2=$ldap->update($dn,$info,$user);
- $result3=$ldap->delete($dn);
+ $result1=$ldap->delete($dn); // To be sure to delete existing records
+ $result2=$ldap->add($dn,$info,$user); // Now the test
+ $result3=$ldap->delete($dn); // Clean what we did
if ($result2 > 0)
{
@@ -419,7 +420,7 @@ if (function_exists("ldap_connect"))
print '
';
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
';
}
-
+
print "
\n";
print "LDAP input file used for test:
\n";
print nl2br($ldap->dump_content($dn,$info));
diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index 584f3ddb73f..41f6afaec14 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/**
\file htdocs/admin/ldap_users.php
\ingroup ldap
@@ -43,7 +43,7 @@ if (!$user->admin)
/*
* Actions
*/
-
+
if ($_GET["action"] == 'setvalue' && $user->admin)
{
$error=0;
@@ -51,7 +51,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_USER_DN',$_POST["user"],'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS',$_POST["objectclass"],'chaine',0,'',$conf->entity)) $error++;
-
+
if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',$_POST["filterconnection"],'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_LOGIN',$_POST["fieldlogin"],'chaine',0,'',$conf->entity)) $error++;
@@ -102,7 +102,7 @@ print '
';
print '