diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index b67fd7ae930..a0bae7e3be8 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -66,6 +66,7 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++;
+ if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE',GETPOST("fieldtitle"),'chaine',0,'',$conf->entity)) $error++;
// This one must be after the others
$valkey='';
@@ -247,7 +248,15 @@ print '
'.$langs->trans("Note").' ';
print ' ';
@@ -364,19 +373,22 @@ if (function_exists("ldap_connect"))
if ($result > 0)
{
$required_fields = array(
- $conf->global->LDAP_KEY_USERS,
- $conf->global->LDAP_FIELD_FULLNAME,
- $conf->global->LDAP_FIELD_NAME,
- $conf->global->LDAP_FIELD_FIRSTNAME,
- $conf->global->LDAP_FIELD_LOGIN,
- $conf->global->LDAP_FIELD_LOGIN_SAMBA,
- $conf->global->LDAP_FIELD_PASSWORD,
- $conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
- $conf->global->LDAP_FIELD_PHONE,
- $conf->global->LDAP_FIELD_FAX,
- $conf->global->LDAP_FIELD_MOBILE,
- $conf->global->LDAP_FIELD_MAIL,
- $conf->global->LDAP_FIELD_SID);
+ $conf->global->LDAP_KEY_USERS,
+ $conf->global->LDAP_FIELD_FULLNAME,
+ $conf->global->LDAP_FIELD_NAME,
+ $conf->global->LDAP_FIELD_FIRSTNAME,
+ $conf->global->LDAP_FIELD_LOGIN,
+ $conf->global->LDAP_FIELD_LOGIN_SAMBA,
+ $conf->global->LDAP_FIELD_PASSWORD,
+ $conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
+ $conf->global->LDAP_FIELD_PHONE,
+ $conf->global->LDAP_FIELD_FAX,
+ $conf->global->LDAP_FIELD_MOBILE,
+ $conf->global->LDAP_FIELD_MAIL,
+ $conf->global->LDAP_FIELD_TITLE,
+ $conf->global->LDAP_FIELD_DESCRIPTION,
+ $conf->global->LDAP_FIELD_SID
+ );
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
$required_fields=array_unique(array_values(array_filter($required_fields, "dol_validElement")));
diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php
index 296293d60e6..538a9a7cf8d 100644
--- a/htdocs/core/modules/modLdap.class.php
+++ b/htdocs/core/modules/modLdap.class.php
@@ -70,9 +70,9 @@ class modLdap extends DolibarrModules
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),
+ 3=>array('LDAP_USER_DN','chaine','ou=users,dc=example,dc=com','',0),
+ 4=>array('LDAP_GROUP_DN','chaine','ou=groups,dc=example,dc=com','',0),
+ 5=>array('LDAP_FILTER_CONNECTION','chaine','&(objectClass=inetOrgPerson)','',0),
6=>array('LDAP_FIELD_LOGIN','chaine','uid','',0),
7=>array('LDAP_FIELD_FULLNAME','chaine','cn','',0),
8=>array('LDAP_FIELD_NAME','chaine','sn','',0),
diff --git a/htdocs/langs/ar_SA/errors.lang b/htdocs/langs/ar_SA/errors.lang
index 40d8ebd63e0..d16a371da66 100644
--- a/htdocs/langs/ar_SA/errors.lang
+++ b/htdocs/langs/ar_SA/errors.lang
@@ -9,7 +9,6 @@
// START - Lines generated via autotranslator.php tool.
// Reference language: en_US
CHARSET=UTF-8
-MenuManager=قائمة مدير
ErrorLoginAlreadyExists=ادخل ٪ ق موجود بالفعل.
ErrorGroupAlreadyExists=المجموعة ٪ ق موجود بالفعل.
ErrorFailToDeleteFile=فشل إزالة الملف '٪ ق.
diff --git a/htdocs/langs/bg_BG/errors.lang b/htdocs/langs/bg_BG/errors.lang
index db5a549fae8..83d491cae38 100644
--- a/htdocs/langs/bg_BG/errors.lang
+++ b/htdocs/langs/bg_BG/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2012-09-08 17:16:45).
// Reference language: en_US -> bg_BG
CHARSET=UTF-8
-MenuManager=Меню мениджър
Error=Грешка
Errors=Грешки
ErrorBadEMail=EMail %s не е
diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang
index b55edc77412..fd43de81c10 100644
--- a/htdocs/langs/ca_ES/errors.lang
+++ b/htdocs/langs/ca_ES/errors.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - ca_ES - errors
CHARSET=UTF-8
-MenuManager=Gestor de menú
# Errors=
Error=Error
Errors=Errors
diff --git a/htdocs/langs/da_DK/errors.lang b/htdocs/langs/da_DK/errors.lang
index 57060c0314f..7d845bada5d 100644
--- a/htdocs/langs/da_DK/errors.lang
+++ b/htdocs/langs/da_DK/errors.lang
@@ -60,15 +60,9 @@ ErrorRecordHasChildren=Det lykkedes ikke at slette poster, da det har nogle Chil
// STOP - Lines generated via parser
-// START - Lines generated via autotranslator.php tool (2009-08-13 20:39:59).
+// START - Lines generated via autotranslator.php tool (2010-07-17 11:19:38).
// Reference language: en_US
-MenuManager=Menu manager
ErrorUrlNotValid=Adressen på webstedet er forkert
-// STOP - Lines generated via autotranslator.php tool (2009-08-13 20:39:59).
-
-
-// START - Lines generated via autotranslator.php tool (2010-07-17 11:19:38).
-// Reference language: en_US
Error=Fejl
Errors=Fejl
ErrorBadEMail=EMail %s er forkert
diff --git a/htdocs/langs/de_AT/errors.lang b/htdocs/langs/de_AT/errors.lang
index 8694d13fac4..803c688633b 100644
--- a/htdocs/langs/de_AT/errors.lang
+++ b/htdocs/langs/de_AT/errors.lang
@@ -51,7 +51,6 @@ ErrorRefAlreadyExists=Die Nr. für den Erstellungsvorgang ist bereits vergeben
ErrorPleaseTypeBankTransactionReportName=Bitte geben Sie den Bankbeleg zu dieser Transaktion ein (Format MMYYYY oder TTMMYYYY)
ErrorRecordHasChildren=Kann diesen Eintrag nicht löschen da er noch über Kindelemente verfügt.
-MenuManager=Menüverwaltung
ErrorUrlNotValid=Die angegebene Website-Adresse ist ungültig
Error=Fehler
diff --git a/htdocs/langs/de_DE/errors.lang b/htdocs/langs/de_DE/errors.lang
index f4d9a8af339..593f18bde01 100644
--- a/htdocs/langs/de_DE/errors.lang
+++ b/htdocs/langs/de_DE/errors.lang
@@ -7,8 +7,6 @@
CHARSET=UTF-8
-MenuManager=Menü Verwaltung
-
# Errors
Error=Fehler
Errors=Fehler
diff --git a/htdocs/langs/el_GR/errors.lang b/htdocs/langs/el_GR/errors.lang
index fd9c6bd8daa..3e21c71b43e 100644
--- a/htdocs/langs/el_GR/errors.lang
+++ b/htdocs/langs/el_GR/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2011-06-26 15:35:22).
// Reference language: en_US -> el_GR
CHARSET=UTF-8
-MenuManager=Διευθυντής Μενού
Error=Σφάλμα
Errors=Λάθη
ErrorBadEMail=%s email είναι λάθος
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index efefb67f7ce..acf2a6095aa 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1147,6 +1147,8 @@ LDAPFieldCompanyExample=Example : o
LDAPFieldSid=SID
LDAPFieldSidExample=Example : objectsid
LDAPFieldEndLastSubscription=Date of subscription end
+LDAPFieldTitle=Post/Function
+LDAPFieldTitleExample=Example: title
LDAPParametersAreStillHardCoded=LDAP parametres are still hardcoded (in contact class)
LDAPSetupNotComplete=LDAP setup not complete (go on others tabs)
LDAPNoUserOrPasswordProvidedAccessIsReadOnly=No administrator or password provided. LDAP access will be anonymous and in read only mode.
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index a1f45f4ca1f..19a36f64c22 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -1,10 +1,13 @@
# Dolibarr language file - en_US - errors
CHARSET=UTF-8
-MenuManager=Menu manager
+
+# No errors
+NoErrorCommitIsDone=No error, we commit
# Errors
Error=Error
Errors=Errors
+ErrorButCommitIsDone=Errors found but we validate despite this
ErrorBadEMail=EMail %s is wrong
ErrorBadUrl=Url %s is wrong
ErrorLoginAlreadyExists=Login %s already exists.
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 2f329143fc3..36866d73a8a 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -582,6 +582,7 @@ CloneMainAttributes=Clone object with its main attributes
PDFMerge=PDF Merge
Merge=Merge
PrintContentArea=Show page to print main content area
+MenuManager=Menu manager
NoMenu=No sub-menu
WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only login %s is allowed to use application at the moment.
CoreErrorTitle=System error
diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang
index b238a2d3802..580627e6cab 100644
--- a/htdocs/langs/es_ES/errors.lang
+++ b/htdocs/langs/es_ES/errors.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - es_ES - errors
CHARSET=UTF-8
-MenuManager=Gestor de menú
# Errors
Error=Error
Errors=Errores
diff --git a/htdocs/langs/et_EE/errors.lang b/htdocs/langs/et_EE/errors.lang
index eafe9f45621..a5f8d78fd06 100644
--- a/htdocs/langs/et_EE/errors.lang
+++ b/htdocs/langs/et_EE/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2012-02-29 22:15:30).
// Reference language: en_US -> et_EE
CHARSET=UTF-8
-MenuManager=Menüü juht
Error=Viga
Errors=Vead
ErrorBadEMail=E-post %s on vale
diff --git a/htdocs/langs/fa_IR/errors.lang b/htdocs/langs/fa_IR/errors.lang
index 51a3bbca1fd..a26cf6eb48b 100644
--- a/htdocs/langs/fa_IR/errors.lang
+++ b/htdocs/langs/fa_IR/errors.lang
@@ -9,7 +9,6 @@
// START - Lines generated via autotranslator.php tool.
// Reference language: en_US
CHARSET=UTF-8
-MenuManager=قائمة مدير
ErrorLoginAlreadyExists=ادخل ٪ ق موجود بالفعل.
ErrorGroupAlreadyExists=المجموعة ٪ ق موجود بالفعل.
ErrorFailToDeleteFile=فشل إزالة الملف '٪ ق.
diff --git a/htdocs/langs/fi_FI/errors.lang b/htdocs/langs/fi_FI/errors.lang
index 544b89ef544..4e9fe51a2a7 100644
--- a/htdocs/langs/fi_FI/errors.lang
+++ b/htdocs/langs/fi_FI/errors.lang
@@ -60,13 +60,7 @@ ErrorRecordHasChildren=Poistaminen ei onnistunut kirjaa, koska se on noin lapsen
// START - Lines generated via autotranslator.php tool (2009-08-13 20:45:19).
// Reference language: en_US
-MenuManager=Valikko johtaja
ErrorUrlNotValid=Www-sivuston osoite on virheellinen
-// STOP - Lines generated via autotranslator.php tool (2009-08-13 20:45:19).
-
-
-// START - Lines generated via autotranslator.php tool (2010-07-17 11:26:22).
-// Reference language: en_US
Error=Virhe
Errors=Virheet
ErrorBadEMail=EMail %s on väärä
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index deef7609e55..6afab6c47ab 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -1154,6 +1154,8 @@ LDAPFieldCompanyExample= Exemple : o
LDAPFieldSid= SID
LDAPFieldSidExample= Exemple : objectsid
LDAPFieldEndLastSubscription= Date fin validité adhésion
+LDAPFieldTitle=Poste/Fonction
+LDAPFieldTitleExample=Exemple: title
LDAPParametersAreStillHardCoded= Les paramètres LDAP sont codés en dur (dans classe contact)
LDAPSetupNotComplete= Configuration LDAP incomplète (à compléter sur les autres onglets)
LDAPNoUserOrPasswordProvidedAccessIsReadOnly= Administrateur ou mot de passe non renseigné. Les accès LDAP seront donc anonymes et en lecture seule.
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 6f4a790a6d6..87715bea1fe 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -1,10 +1,13 @@
# Dolibarr language file - fr_FR - errors
CHARSET=UTF-8
-MenuManager=Gestionnaire de menu
+
+# No errors
+NoErrorCommitIsDone=Pas d'erreur, on valide
# Errors
Error=Erreur
Errors=Erreurs
+ErrorButCommitIsDone=Erreurs trouvées mais on valide malgré tout
ErrorBadEMail=e-mail %s invalide
ErrorBadUrl=Url %s invalide
ErrorLoginAlreadyExists=Le login %s existe déjà.
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 5a4f9ebdbb4..b2147ce7e20 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -584,6 +584,7 @@ CloneMainAttributes=Cloner l'objet avec ces attributs principaux
PDFMerge=Fusion PDF
Merge=Fusion
PrintContentArea=Afficher page d'impression de la zone centrale
+MenuManager=Gestionnaire de menu
NoMenu=Aucun sous-menu
WarningYouAreInMaintenanceMode=Attention, vous êtes en mode maintenance, aussi seul le login %s est autorisé à utiliser l'application en ce moment.
CoreErrorTitle=Erreur système
diff --git a/htdocs/langs/he_IL/errors.lang b/htdocs/langs/he_IL/errors.lang
index 09e35168204..8ebd4928871 100644
--- a/htdocs/langs/he_IL/errors.lang
+++ b/htdocs/langs/he_IL/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2012-03-10 15:14:54).
// Reference language: en_US -> he_IL
CHARSET=UTF-8
-MenuManager=תפריט מנהל
Error=שגיאה
Errors=שגיאות
ErrorBadEMail=%s אימייל הוא בסדר
diff --git a/htdocs/langs/hu_HU/errors.lang b/htdocs/langs/hu_HU/errors.lang
index 87d8531c815..50e6875d84d 100644
--- a/htdocs/langs/hu_HU/errors.lang
+++ b/htdocs/langs/hu_HU/errors.lang
@@ -13,7 +13,6 @@ ErrorLoginDisabled=A fiók le van tiltva
// START - Lines generated via autotranslator.php tool (2012-02-29 16:13:31).
// Reference language: en_US -> hu_HU
-MenuManager=Menükezelőben
Error=Hiba
Errors=Hibák
ErrorBadEMail=E-mail %s rossz
diff --git a/htdocs/langs/is_IS/errors.lang b/htdocs/langs/is_IS/errors.lang
index c896905ef3f..ae238fb5951 100644
--- a/htdocs/langs/is_IS/errors.lang
+++ b/htdocs/langs/is_IS/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2010-06-30 00:15:29).
// Reference language: en_US
CHARSET=UTF-8
-MenuManager=Valmynd framkvæmdastjóri
Error=Villa
Errors=Villur
ErrorBadEMail=Netfang %s er rangt
diff --git a/htdocs/langs/it_IT/errors.lang b/htdocs/langs/it_IT/errors.lang
index 8061c07fd6a..e00684424f5 100644
--- a/htdocs/langs/it_IT/errors.lang
+++ b/htdocs/langs/it_IT/errors.lang
@@ -106,7 +106,6 @@ ErrorUrlNotValid =L'indirizzo del sito è errato
ErrorUserCannotBeDelete =L'utente non può essere eliminato. Probabilmente è necessario al funzionamento di Dolibarr.
ErrorWebServerUserHasNotPermission =L'account utente %s utilizzato per eseguire il server web non ha i permessi necessari
ErrorWrongValueForField =Valore errato nel campo numero %s (il valore '%s' non corrisponde alla regex %s )
-MenuManager =Gestore dei menu
UserCannotBeDelete =L'utente non può essere eliminato. Forse è associato ad alcuni elementi di Dolibarr.
WarningAllowUrlFopenMustBeOn =Il parametro allow_url_fopen deve essere impostato su on nel file php.ini perché questo modulo funzioni correttamente. È necessario modificare questo file manualmente.
WarningBookmarkAlreadyExists =Un segnalibro per questo link (URL) o con lo stesso titolo esiste già.
diff --git a/htdocs/langs/ja_JP/errors.lang b/htdocs/langs/ja_JP/errors.lang
index 8e1c9b8c371..b48f72828dd 100644
--- a/htdocs/langs/ja_JP/errors.lang
+++ b/htdocs/langs/ja_JP/errors.lang
@@ -15,7 +15,6 @@ WarningUntilDirRemoved=すべてのセキュリティ警告は、(のみの管
// START - Lines generated via autotranslator.php tool (2012-02-29 16:41:06).
// Reference language: en_US -> ja_JP
-MenuManager=メニューマネージャ
Error=エラー
Errors=エラー
ErrorBadEMail=メールして%sが間違っている
diff --git a/htdocs/langs/nb_NO/errors.lang b/htdocs/langs/nb_NO/errors.lang
index 0776a78c04d..0ee9583b99d 100644
--- a/htdocs/langs/nb_NO/errors.lang
+++ b/htdocs/langs/nb_NO/errors.lang
@@ -44,7 +44,6 @@ ErrorLDAPMakeManualTest=En .ldif fil er opprettet i mappen %s. Prøv å lese den
// START - Lines generated via autotranslator.php tool (2010-07-17 11:45:17).
// Reference language: en_US
-MenuManager=Meny manager
Error=Feil
Errors=Feil
ErrorBadEMail=E-post %s er feil
diff --git a/htdocs/langs/nl_NL/errors.lang b/htdocs/langs/nl_NL/errors.lang
index 495aeaa6efb..728b4eddbdb 100644
--- a/htdocs/langs/nl_NL/errors.lang
+++ b/htdocs/langs/nl_NL/errors.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - nl_NL - errors
CHARSET = UTF-8
-MenuManager = Menubeheer
Error = Fout
Errors = Fouten
ErrorBadEMail = Ongeldige e-mail %s
diff --git a/htdocs/langs/pl_PL/errors.lang b/htdocs/langs/pl_PL/errors.lang
index d905639743d..46c5ac0d97b 100644
--- a/htdocs/langs/pl_PL/errors.lang
+++ b/htdocs/langs/pl_PL/errors.lang
@@ -62,7 +62,6 @@ ErrorRecordHasChildren=Nie można usunąć rekordy, ponieważ ma pewne Childs.
// START - Lines generated via autotranslator.php tool (2009-08-13 21:07:31).
// Reference language: en_US
-MenuManager=Menu menedżera
ErrorUrlNotValid=Adres strony internetowej jest nieprawidłowy
Error=Błąd
Errors=Błędy
diff --git a/htdocs/langs/pt_BR/errors.lang b/htdocs/langs/pt_BR/errors.lang
index 689e880ef87..012cdbb20fb 100644
--- a/htdocs/langs/pt_BR/errors.lang
+++ b/htdocs/langs/pt_BR/errors.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - pt_BR rev. 0.0 - errors
CHARSET=UTF-8
-MenuManager=Gerente de menu
ErrorLoginAlreadyExists=o login %s já existe.
ErrorGroupAlreadyExists=o grupo %s já existe.
ErrorDuplicateTrigger=um Arquivo trigger de Nome '%s ' está utilizado. Elimine o duplicado da pasta '%s '.
diff --git a/htdocs/langs/pt_PT/errors.lang b/htdocs/langs/pt_PT/errors.lang
index ffe03099555..885eb064467 100644
--- a/htdocs/langs/pt_PT/errors.lang
+++ b/htdocs/langs/pt_PT/errors.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - pt_PT - errors
CHARSET=UTF-8
-MenuManager=Gestor de menu
ErrorLoginAlreadyExists=O login %s já existe.
ErrorGroupAlreadyExists=O grupo %s já existe.
ErrorDuplicateTrigger=Um Ficheiro trigger de Nome '%s ' está utilizado. Elimine o duplicado da pasta '%s '.
diff --git a/htdocs/langs/ro_RO/errors.lang b/htdocs/langs/ro_RO/errors.lang
index 512c8267605..df2d969d797 100644
--- a/htdocs/langs/ro_RO/errors.lang
+++ b/htdocs/langs/ro_RO/errors.lang
@@ -60,7 +60,6 @@ ErrorRecordHasChildren=Nu a reuşit să ştergeţi înregistrări, deoarece aces
// START - Lines generated via autotranslator.php tool (2009-08-13 21:12:07).
// Reference language: en_US
-MenuManager=Meniu manager
ErrorUrlNotValid=Site-ul este incorect adresa
// STOP - Lines generated via autotranslator.php tool (2009-08-13 21:12:07).
diff --git a/htdocs/langs/ru_RU/errors.lang b/htdocs/langs/ru_RU/errors.lang
index abd8ef5cdc1..d4cc21e6723 100644
--- a/htdocs/langs/ru_RU/errors.lang
+++ b/htdocs/langs/ru_RU/errors.lang
@@ -54,7 +54,6 @@ ErrorCantSaveADoneUserWithZeroPercentage=Не удается сохранить
ErrorRefAlreadyExists=Ссылки, используемые для создания, уже существует.
ErrorPleaseTypeBankTransactionReportName=Введите название банка, где получение сделки (в формате ГГГГММ или ГГГГММДД)
ErrorRecordHasChildren=Не удается удалить записи, поскольку он имеет некоторые хлеб.
-MenuManager=Меню менеджера
ErrorUrlNotValid=Адрес веб-сайта, является неверным
Error=Ошибка
Errors=Ошибки
diff --git a/htdocs/langs/sl_SI/errors.lang b/htdocs/langs/sl_SI/errors.lang
index 1a8aa88e71d..304eccafb7f 100644
--- a/htdocs/langs/sl_SI/errors.lang
+++ b/htdocs/langs/sl_SI/errors.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - en_US - errors =
CHARSET = UTF-8
-MenuManager = Upravljanje z meniji
Error = Napaka
Errors = Napake
ErrorBadEMail = EMail %s je napačen
diff --git a/htdocs/langs/sv_SE/errors.lang b/htdocs/langs/sv_SE/errors.lang
index c5bed69914b..c2c1a4de446 100644
--- a/htdocs/langs/sv_SE/errors.lang
+++ b/htdocs/langs/sv_SE/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2010-08-27 08:47:44).
// Reference language: en_US
CHARSET=UTF-8
-MenuManager=Meny chef
Error=Fel
Errors=Fel
ErrorBadEMail=EMail %s är fel
diff --git a/htdocs/langs/tr_TR/errors.lang b/htdocs/langs/tr_TR/errors.lang
index 5fa48260db6..51328ab6ffe 100644
--- a/htdocs/langs/tr_TR/errors.lang
+++ b/htdocs/langs/tr_TR/errors.lang
@@ -5,7 +5,6 @@
*/
// Reference language: en_US -> TR – errors
CHARSET=UTF-8
-MenuManager=Menü yöneticisi
# Hatalar
Error=Hata
diff --git a/htdocs/langs/zh_CN/errors.lang b/htdocs/langs/zh_CN/errors.lang
index 4ad29980eb9..43acc3de5b8 100644
--- a/htdocs/langs/zh_CN/errors.lang
+++ b/htdocs/langs/zh_CN/errors.lang
@@ -8,7 +8,6 @@
// START - Lines generated via autotranslator.php tool (2010-06-08 21:22:55).
// Reference language: en_US
CHARSET=UTF-8
-MenuManager=菜单管理
Error=错误
Errors=错误
ErrorBadEMail=电子邮件%s是错误的
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 3ff5c7bd8be..314a8b6d584 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -797,7 +797,7 @@ class User extends CommonObject
// Set default rights
if ($this->set_default_rights() < 0)
{
- $this->error=$this->db->error();
+ $this->error='ErrorFailedToSetDefaultRightOfUser';
$this->db->rollback();
return -5;
}
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 6a78003324d..263a28fad30 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -473,6 +473,8 @@ if ($action == 'adduserldap')
$conf->global->LDAP_FIELD_FAX,
$conf->global->LDAP_FIELD_MOBILE,
$conf->global->LDAP_FIELD_MAIL,
+ $conf->global->LDAP_FIELD_TITLE,
+ $conf->global->LDAP_FIELD_DESCRIPTION,
$conf->global->LDAP_FIELD_SID);
$ldap = new Ldap();
@@ -546,12 +548,23 @@ if (($action == 'create') || ($action == 'adduserldap'))
$result = $ldap->connect_bind();
if ($result >= 0)
{
- $required_fields=array($conf->global->LDAP_KEY_USERS,
- $conf->global->LDAP_FIELD_FULLNAME,
- $conf->global->LDAP_FIELD_NAME,
- $conf->global->LDAP_FIELD_FIRSTNAME,
- $conf->global->LDAP_FIELD_LOGIN,
- $conf->global->LDAP_FIELD_LOGIN_SAMBA);
+ $required_fields=array(
+ $conf->global->LDAP_KEY_USERS,
+ $conf->global->LDAP_FIELD_FULLNAME,
+ $conf->global->LDAP_FIELD_NAME,
+ $conf->global->LDAP_FIELD_FIRSTNAME,
+ $conf->global->LDAP_FIELD_LOGIN,
+ $conf->global->LDAP_FIELD_LOGIN_SAMBA,
+ $conf->global->LDAP_FIELD_PASSWORD,
+ $conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
+ $conf->global->LDAP_FIELD_PHONE,
+ $conf->global->LDAP_FIELD_FAX,
+ $conf->global->LDAP_FIELD_MOBILE,
+ $conf->global->LDAP_FIELD_MAIL,
+ $conf->global->LDAP_FIELD_TITLE,
+ $conf->global->LDAP_FIELD_DESCRIPTION,
+ $conf->global->LDAP_FIELD_SID
+ );
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
$required_fields=array_unique(array_values(array_filter($required_fields, "dol_validElement")));
diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php
old mode 100644
new mode 100755
index 7fdf7831d59..af564b6f67b
--- a/scripts/members/sync_members_dolibarr2ldap.php
+++ b/scripts/members/sync_members_dolibarr2ldap.php
@@ -1,6 +1,6 @@
#!/usr/bin/php
* Copyright (C) 2006-2008 Laurent Destailleur
*
diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php
old mode 100644
new mode 100755
index b54d3f1a33e..7e7d55fbf90
--- a/scripts/members/sync_members_ldap2dolibarr.php
+++ b/scripts/members/sync_members_ldap2dolibarr.php
@@ -1,6 +1,6 @@
#!/usr/bin/php
* Copyright (C) 2006-2010 Laurent Destailleur
*
@@ -48,18 +48,53 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php");
-$langs->load("main");
+$langs->load("main");
+$langs->load("errors");
+// List of fields to get from LDAP
+$required_fields = array(
+ $conf->global->LDAP_KEY_MEMBERS,
+ $conf->global->LDAP_FIELD_FULLNAME,
+ $conf->global->LDAP_FIELD_LOGIN,
+ $conf->global->LDAP_FIELD_LOGIN_SAMBA,
+ $conf->global->LDAP_FIELD_PASSWORD,
+ $conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
+ $conf->global->LDAP_FIELD_NAME,
+ $conf->global->LDAP_FIELD_FIRSTNAME,
+ $conf->global->LDAP_FIELD_MAIL,
+ $conf->global->LDAP_FIELD_PHONE,
+ $conf->global->LDAP_FIELD_PHONE_PERSO,
+ $conf->global->LDAP_FIELD_MOBILE,
+ $conf->global->LDAP_FIELD_FAX,
+ $conf->global->LDAP_FIELD_ADDRESS,
+ $conf->global->LDAP_FIELD_ZIP,
+ $conf->global->LDAP_FIELD_TOWN,
+ $conf->global->LDAP_FIELD_COUNTRY,
+ $conf->global->LDAP_FIELD_DESCRIPTION,
+ $conf->global->LDAP_FIELD_BIRTHDATE,
+ $conf->global->LDAP_FIELD_MEMBER_STATUS,
+ $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION,
+ // Subscriptions
+ $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE,
+ $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT,
+ $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE,
+ $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT
+);
+
+// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
+$required_fields=array_unique(array_values(array_filter($required_fields, "dolValidElement")));
+
-if ($argv[2]) $conf->global->LDAP_SERVER_HOST=$argv[2];
+if ($argv[3]) $conf->global->LDAP_SERVER_HOST=$argv[2];
print "***** $script_file ($version) *****\n";
-if (! isset($argv[1]) || ! is_numeric($argv[1])) {
- print "Usage: $script_file id_member_type\n";
+if (! isset($argv[2]) || ! is_numeric($argv[2])) {
+ print "Usage: $script_file (nocommitiferror|commitiferror) id_member_type [ldapserverhost]\n";
exit;
}
-$typeid=$argv[1];
+$typeid=$argv[2];
+if ($argv[1] == 'commitiferror') $forcecommit=1;
print "Mails sending disabled (useless in batch mode)\n";
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // On bloque les mails
@@ -77,15 +112,17 @@ print "host=".$conf->db->host."\n";
print "port=".$conf->db->port."\n";
print "login=".$conf->db->user."\n";
print "database=".$conf->db->name."\n";
+print "----- Options:\n";
+print "commitiferror=".$forcecommit."\n";
+print "Mapped LDAP fields=".join(',',$required_fields)."\n";
print "\n";
-print "Press a key to confirm...\n";
+print "Press a key to confirm...";
$input = trim(fgets(STDIN));
-print "Warning, this operation may result in data loss if it failed.\n";
print "Hit Enter to continue or CTRL+C to stop...\n";
$input = trim(fgets(STDIN));
-if (! $conf->global->LDAP_MEMBER_DN)
+if (empty($conf->global->LDAP_MEMBER_DN))
{
print $langs->trans("Error").': '.$langs->trans("LDAP setup for members not defined inside Dolibarr");
exit(1);
@@ -134,42 +171,9 @@ if ($result >= 0)
$justthese=array();
- // On d�sactive la synchro Dolibarr vers LDAP
+ // We disable synchro Dolibarr-LDAP
$conf->global->LDAP_MEMBER_ACTIVE=0;
- // Liste des champs a r�cup�rer de LDAP
- $required_fields = array(
- $conf->global->LDAP_FIELD_FULLNAME,
- $conf->global->LDAP_FIELD_LOGIN,
- $conf->global->LDAP_FIELD_LOGIN_SAMBA,
- $conf->global->LDAP_FIELD_PASSWORD,
- $conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
- $conf->global->LDAP_FIELD_NAME,
- $conf->global->LDAP_FIELD_FIRSTNAME,
- $conf->global->LDAP_FIELD_MAIL,
- $conf->global->LDAP_FIELD_PHONE,
- $conf->global->LDAP_FIELD_PHONE_PERSO,
- $conf->global->LDAP_FIELD_MOBILE,
- $conf->global->LDAP_FIELD_FAX,
- $conf->global->LDAP_FIELD_ADDRESS,
- $conf->global->LDAP_FIELD_ZIP,
- $conf->global->LDAP_FIELD_TOWN,
- $conf->global->LDAP_FIELD_COUNTRY,
- $conf->global->LDAP_FIELD_DESCRIPTION,
- $conf->global->LDAP_FIELD_BIRTHDATE,
- $conf->global->LDAP_FIELD_MEMBER_STATUS,
- $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION,
-
- // Subscriptions
- $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE,
- $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT,
- $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE,
- $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT
- );
-
- // Remove from required_fields all entries not configured in LDAP (empty) and duplicated
- $required_fields=array_unique(array_values(array_filter($required_fields, "dolValidElement")));
-
$ldaprecords = $ldap->getRecords('*',$conf->global->LDAP_MEMBER_DN, $conf->global->LDAP_KEY_MEMBERS, $required_fields, 0);
if (is_array($ldaprecords))
{
@@ -301,6 +305,7 @@ if ($result >= 0)
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone",$error)."\n";
$db->rollback();
}
+ print "\n";
}
else
{
@@ -318,7 +323,14 @@ else
return $error;
-function dolValidElement($element) {
+/**
+ * Function to say if a value is empty or not
+ *
+ * @param string $element Value to test
+ * @return boolean True of false
+ */
+function dolValidElement($element)
+{
return (trim($element) != '');
}
diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php
old mode 100644
new mode 100755
index 0deafa514e9..32086f51752
--- a/scripts/user/sync_groups_dolibarr2ldap.php
+++ b/scripts/user/sync_groups_dolibarr2ldap.php
@@ -1,6 +1,6 @@
#!/usr/bin/php
* Copyright (C) 2006 Laurent Destailleur
*
diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php
old mode 100644
new mode 100755
index 044b3f133ac..a4931d91d32
--- a/scripts/user/sync_users_dolibarr2ldap.php
+++ b/scripts/user/sync_users_dolibarr2ldap.php
@@ -1,6 +1,6 @@
#!/usr/bin/php
* Copyright (C) 2006 Laurent Destailleur
*
diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php
new file mode 100755
index 00000000000..e94c2cd618a
--- /dev/null
+++ b/scripts/user/sync_users_ldap2dolibarr.php
@@ -0,0 +1,282 @@
+#!/usr/bin/php
+
+ * Copyright (C) 2006-2012 Laurent Destailleur
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file scripts/user/sync_users_ldap2dolibarr.php
+ * \ingroup ldap member
+ * \brief Script to update users into Dolibarr from LDAP
+ */
+
+$sapi_type = php_sapi_name();
+$script_file = basename(__FILE__);
+$path=dirname(__FILE__).'/';
+
+// Test if batch mode
+if (substr($sapi_type, 0, 3) == 'cgi') {
+ echo "Error: You ar usingr PH for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
+ exit;
+}
+
+
+
+
+// Main
+
+$version='1.14';
+@set_time_limit(0);
+$error=0;
+$forcecommit=0;
+
+require_once($path."../../htdocs/master.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/core/class/ldap.class.php");
+require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
+
+$langs->load("main");
+$langs->load("errors");
+
+// List of fields to get from LDAP
+$required_fields = array(
+ $conf->global->LDAP_KEY_USERS,
+ $conf->global->LDAP_FIELD_FULLNAME,
+ $conf->global->LDAP_FIELD_NAME,
+ $conf->global->LDAP_FIELD_FIRSTNAME,
+ $conf->global->LDAP_FIELD_LOGIN,
+ $conf->global->LDAP_FIELD_LOGIN_SAMBA,
+ $conf->global->LDAP_FIELD_PASSWORD,
+ $conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
+ $conf->global->LDAP_FIELD_PHONE,
+ $conf->global->LDAP_FIELD_FAX,
+ $conf->global->LDAP_FIELD_MOBILE,
+ //$conf->global->LDAP_FIELD_ADDRESS,
+ //$conf->global->LDAP_FIELD_ZIP,
+ //$conf->global->LDAP_FIELD_TOWN,
+ //$conf->global->LDAP_FIELD_COUNTRY,
+ $conf->global->LDAP_FIELD_MAIL,
+ $conf->global->LDAP_FIELD_TITLE,
+ $conf->global->LDAP_FIELD_DESCRIPTION,
+ $conf->global->LDAP_FIELD_SID
+);
+
+// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
+$required_fields=array_unique(array_values(array_filter($required_fields, "dolValidElement")));
+
+if ($argv[2]) $conf->global->LDAP_SERVER_HOST=$argv[2];
+
+print "***** $script_file ($version) *****\n";
+
+if (! isset($argv[1])) {
+ //print "Usage: $script_file (nocommitiferror|commitiferror) [id_group]\n";
+ print "Usage: $script_file (nocommitiferror|commitiferror) [ldapserverhost]\n";
+ exit;
+}
+$groupid=$argv[3];
+if ($argv[1] == 'commitiferror') $forcecommit=1;
+
+
+print "Mails sending disabled (useless in batch mode)\n";
+$conf->global->MAIN_DISABLE_ALL_MAILS=1; // On bloque les mails
+print "\n";
+print "----- Synchronize all records from LDAP database:\n";
+print "host=".$conf->global->LDAP_SERVER_HOST."\n";
+print "port=".$conf->global->LDAP_SERVER_PORT."\n";
+print "login=".$conf->global->LDAP_ADMIN_DN."\n";
+print "pass=".preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)."\n";
+print "DN to extract=".$conf->global->LDAP_USER_DN."\n";
+print 'Filter=('.$conf->global->LDAP_KEY_USERS.'=*)'."\n";
+print "----- To Dolibarr database:\n";
+print "type=".$conf->db->type."\n";
+print "host=".$conf->db->host."\n";
+print "port=".$conf->db->port."\n";
+print "login=".$conf->db->user."\n";
+print "database=".$conf->db->name."\n";
+print "----- Options:\n";
+print "commitiferror=".$forcecommit."\n";
+print "Mapped LDAP fields=".join(',',$required_fields)."\n";
+print "\n";
+print "Press a key to confirm...";
+$input = trim(fgets(STDIN));
+print "Hit Enter to continue or CTRL+C to stop...\n";
+$input = trim(fgets(STDIN));
+
+
+if (empty($conf->global->LDAP_USER_DN))
+{
+ print $langs->trans("Error").': '.$langs->trans("LDAP setup for users not defined inside Dolibarr");
+ exit(1);
+}
+
+
+// Charge tableau de correspondance des pays
+$hashlib2rowid=array();
+$countries=array();
+$sql = "SELECT rowid, code, libelle, active";
+$sql.= " FROM ".MAIN_DB_PREFIX."c_pays";
+$sql.= " WHERE active = 1";
+$sql.= " ORDER BY code ASC";
+$resql=$db->query($sql);
+if ($resql)
+{
+ $num = $db->num_rows($resql);
+ $i = 0;
+ if ($num)
+ {
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+ if ($obj)
+ {
+ //print 'Load cache for country '.strtolower($obj->libelle).' rowid='.$obj->rowid."\n";
+ $hashlib2rowid[strtolower($obj->libelle)]=$obj->rowid;
+ $countries[$obj->rowid]=array('rowid' => $obj->rowid, 'label' => $obj->libelle, 'code' => $obj->code);
+ }
+ $i++;
+ }
+ }
+}
+else
+{
+ dol_print_error($db);
+ exit;
+}
+
+
+
+$ldap = new Ldap();
+$result = $ldap->connect_bind();
+if ($result >= 0)
+{
+ $justthese=array();
+
+
+ // We disable synchro Dolibarr-LDAP
+ $conf->global->LDAP_SYNCHRO_ACTIVE=0;
+
+ $ldaprecords = $ldap->getRecords('*',$conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, $required_fields, 0);
+ if (is_array($ldaprecords))
+ {
+ $db->begin();
+
+ // Warning $ldapuser has a key in lowercase
+ foreach ($ldaprecords as $key => $ldapuser)
+ {
+ $fuser = new User($db);
+
+ // Propriete membre
+ $fuser->firstname=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME];
+ $fuser->lastname=$ldapuser[$conf->global->LDAP_FIELD_NAME];
+ $fuser->login=$ldapuser[$conf->global->LDAP_FIELD_LOGIN];
+ $fuser->pass=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD];
+ $fuser->pass_indatabase_crypted=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED];
+
+ //$user->societe;
+ /*
+ $fuser->address=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS];
+ $fuser->zip=$ldapuser[$conf->global->LDAP_FIELD_ZIP];
+ $fuser->town=$ldapuser[$conf->global->LDAP_FIELD_TOWN];
+ $fuser->country=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY];
+ $fuser->country_id=$countries[$hashlib2rowid[strtolower($fuser->country)]]['rowid'];
+ $fuser->country_code=$countries[$hashlib2rowid[strtolower($fuser->country)]]['code'];
+ */
+
+ $fuser->office_phone=$ldapuser[$conf->global->LDAP_FIELD_PHONE];
+ $fuser->user_mobile=$ldapuser[$conf->global->LDAP_FIELD_MOBILE];
+ $fuser->office_fax=$ldapuser[$conf->global->LDAP_FIELD_FAX];
+ $fuser->email=$ldapuser[$conf->global->LDAP_FIELD_MAIL];
+
+ $fuser->job=$ldapuser[$conf->global->LDAP_FIELD_TITLE];
+ $fuser->note=$ldapuser[$conf->global->LDAP_FIELD_DESCRIPTION];
+ $fuser->admin=0;
+ $fuser->societe_id=0;
+ $fuser->contact_id=0;
+ $fuser->fk_member=0;
+
+ $fuser->statut=1;
+ /*if (isset($ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS]))
+ {
+ $fuser->datec=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
+ $fuser->datevalid=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
+ $fuser->statut=$ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS];
+ }*/
+ //if ($fuser->statut > 1) $fuser->statut=1;
+
+ //print_r($ldapuser);
+
+ // Group of user
+ // We should use here $groupid
+
+ // Creation member
+ print $langs->transnoentities("UserCreate").' # '.$key.': login='.$fuser->login.', fullname='.$fuser->getFullName($langs);
+ $fuser_id=$fuser->create($user);
+ if ($fuser_id > 0)
+ {
+ print ' --> Created member id='.$fuser_id.' login='.$fuser->login;
+ }
+ else
+ {
+ $error++;
+ print ' --> '.$fuser_id.' '.$fuser->error;
+ }
+ print "\n";
+
+ //print_r($fuser);
+ }
+
+ if (! $error || $forcecommit)
+ {
+ if (! $error) print $langs->transnoentities("NoErrorCommitIsDone")."\n";
+ else print $langs->transnoentities("ErrorButCommitIsDone")."\n";
+ $db->commit();
+ }
+ else
+ {
+ print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone",$error)."\n";
+ $db->rollback();
+ }
+ print "\n";
+ }
+ else
+ {
+ dol_print_error('',$ldap->error);
+ $error++;
+ }
+}
+else
+{
+ dol_print_error('',$ldap->error);
+ $error++;
+}
+
+
+return $error;
+
+
+/**
+ * Function to say if a value is empty or not
+ *
+ * @param string $element Value to test
+ * @return boolean True of false
+ */
+function dolValidElement($element)
+{
+ return (trim($element) != '');
+}
+
+?>