diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 26b81cc1f47..cdafba70c89 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -18,16 +18,13 @@ * 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. - * - * $Id$ - * $Source$ */ /** \file htdocs/admin/ldap.php \ingroup ldap \brief Page d'administration/configuration du module Ldap - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index ef4fc3f0e7e..b6009e3d11b 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -106,7 +106,7 @@ print ''; $var=true; print ''; -print ''; +print ''; print "\n"; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 668e23c3bc3..1caf859830e 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -98,7 +98,7 @@ print '
'.$langs->trans("LDAPSynchronizeUsers").''.$langs->trans("LDAPSynchronizeContacts").'
'; $var=true; print ''; -print ''; +print ''; print "\n"; // DN pour les groupes diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 51eccccf2c8..ea0a320ba7e 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -122,7 +122,7 @@ $var=true; print ''; -print ''; +print ''; print "\n"; // DN Pour les adherents diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php index c437f797569..9b802896329 100644 --- a/htdocs/includes/modules/DolibarrModules.class.php +++ b/htdocs/includes/modules/DolibarrModules.class.php @@ -770,7 +770,7 @@ class DolibarrModules { $row = $this->db->fetch_row($result); - if ($row[0] == 0) + if ($row[0] == 0) // If not found { if (! $visible) $visible='0'; if (strlen($note)) @@ -814,6 +814,10 @@ class DolibarrModules $err++; } } + else + { + dol_syslog("DolibarrModules::insert_const constant '".$name."' alreday exists"); + } } else { diff --git a/htdocs/includes/modules/modLdap.class.php b/htdocs/includes/modules/modLdap.class.php index f4ccddda59f..c4d9caa63e7 100644 --- a/htdocs/includes/modules/modLdap.class.php +++ b/htdocs/includes/modules/modLdap.class.php @@ -19,23 +19,21 @@ */ /** \defgroup ldap Module ldap - \brief Module pour interfacer les contacts avec un annuaire Ldap + \brief Module pour interfacer les contacts avec un annuaire Ldap */ /** - \file htdocs/includes/modules/modLdap.class.php - \ingroup ldap - \brief Fichier de description et activation du module Ldap - \version $Id$ + * \file htdocs/includes/modules/modLdap.class.php + * \ingroup ldap + * \brief Fichier de description et activation du module Ldap + * \version $Id$ */ - include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); -/** \class modLdap - \brief Classe de description et activation du module Ldap +/** \class modLdap + * \brief Classe de description et activation du module Ldap */ - class modLdap extends DolibarrModules { /** @@ -67,63 +65,21 @@ class modLdap extends DolibarrModules $this->requiredby = array(); // Constants - $this->const = array(); - $r=0; - - $this->const[$r][0] = "LDAP_USER_DN"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "ou=users,dc=my-domain,dc=com"; - $r++; - - $this->const[$r][0] = "LDAP_GROUP_DN"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "ou=groups,dc=my-domain,dc=com"; - $r++; - - $this->const[$r][0] = "LDAP_FILTER_CONNECTION"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "&(objectClass=user)(objectCategory=person)"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_LOGIN"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "uid"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_LOGIN_SAMBA"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "samaccountname"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_NAME"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "sn"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_FIRSTNAME"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "givenname"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_MAIL"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mail"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_PHONE"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "telephonenumber"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_FAX"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "facsimiletelephonenumber"; - $r++; - - $this->const[$r][0] = "LDAP_FIELD_MOBILE"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mobile"; - $r++; + $this->const = array( + 0=>array('LDAP_SERVER_TYPE','chaine','openldap','',0), + 1=>array('LDAP_SERVER_PROTOCOLVERSION','chaine','3','',0), + 2=>array('LDAP_SERVER_HOST','chaine','localhost','',0), + 3=>array('LDAP_USER_DN','chaine','ou=users,dc=my-domain,dc=com','',0), + 4=>array('LDAP_GROUP_DN','chaine','ou=groups,dc=my-domain,dc=com','',0), + 5=>array('LDAP_FILTER_CONNECTION','chaine','&(objectClass=user)(objectCategory=person)','',0), + 6=>array('LDAP_FIELD_LOGIN','chaine','uid','',0), + 7=>array('LDAP_FIELD_NAME','chaine','sn','',0), + 8=>array('LDAP_FIELD_FIRSTNAME','chaine','givenname','',0), + 9=>array('LDAP_FIELD_MAIL','chaine','mail','',0), + 10=>array('LDAP_FIELD_PHONE','chaine','telephonenumber','',0), + 11=>array('LDAP_FIELD_FAX','chaine','facsimiletelephonenumber','',0), + 12=>array('LDAP_FIELD_MOBILE','chaine','mobile','',0), + ); // Boites $this->boxes = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4c98385e17d..952002b10ae 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -810,10 +810,10 @@ LDAPFunctionsNotAvailableOnPHP=LDAP functions are not available on your PHP LDAPToDolibarr=LDAP -> Dolibarr DolibarrToLDAP=Dolibarr -> LDAP LDAPNamingAttribute=Key in LDAP -LDAPSynchronizeUsers=Synchronize Dolibarr users with LDAP -LDAPSynchronizeGroups=Synchronize Dolibarr groups with LDAP -LDAPSynchronizeContacts=Synchronize Dolibarr contacts with LDAP -LDAPSynchronizeMembers=Synchronize members of Dolibarr foundation module with LDAP +LDAPSynchronizeUsers=Organization of users in LDAP +LDAPSynchronizeGroups=Organization of groups in LDAP +LDAPSynchronizeContacts=Organization of contacts in LDAP +LDAPSynchronizeMembers=Organization of foundation's members in LDAP LDAPTypeExample=OpenLdap, Egroupware or Active Directory LDAPPrimaryServer=Primary server LDAPSecondaryServer=Secondary server diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index d38c2d5d7de..fd498a6b1db 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -810,10 +810,10 @@ LDAPFunctionsNotAvailableOnPHP = Les fonctions LDAP ne sont pas disponibles sur LDAPToDolibarr = LDAP -> Dolibarr DolibarrToLDAP = Dolibarr -> LDAP LDAPNamingAttribute = Clé dans LDAP -LDAPSynchronizeUsers = Synchronisation des utilisateurs Dolibarr avec LDAP -LDAPSynchronizeGroups = Synchronisation des groupes utilisateurs Dolibarr avec LDAP -LDAPSynchronizeContacts = Synchronisation des contacts Dolibarr avec LDAP -LDAPSynchronizeMembers = Synchronisation des membres du module adhérents de Dolibarr avec LDAP +LDAPSynchronizeUsers = Organisation des objets utilisateurs dans le LDAP +LDAPSynchronizeGroups = Organisation des objets groupes dans le LDAP +LDAPSynchronizeContacts = Organisation des objets contacts dans le LDAP +LDAPSynchronizeMembers = Organisation des objets adhérents dans le LDAP LDAPTypeExample = OpenLdap, Egroupware ou Active Directory LDAPPrimaryServer = Serveur primaire LDAPSecondaryServer = Serveur secondaire
'.$langs->trans("LDAPSynchronizeUsers").''.$langs->trans("LDAPSynchronizeGroups").'
'.$langs->trans("LDAPSynchronizeUsers").''.$langs->trans("LDAPSynchronizeMembers").'