From 9796a9f0886a5b84037679a8c04be885cdf82921 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2007 19:08:48 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20warning=20sur=20modif=20champ=20mot=20d?= =?UTF-8?q?e=20passe=20si=20mode=20authentification=20externe=20=E0=20Doli?= =?UTF-8?q?barr.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 5 +++-- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/main.inc.php | 2 +- htdocs/master.inc.php | 1 - htdocs/user/fiche.php | 14 ++++++++++---- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index e3067f71e65..fd3df64e8d2 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -67,7 +67,7 @@ class Form /** \brief Affiche un texte+picto avec tooltip sur texte ou sur picto \param text Texte à afficher - \param htmltext Contenu html du tooltip + \param htmltext Contenu html du tooltip, codé en html \param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2 \param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après \param img Code img du picto @@ -85,6 +85,7 @@ class Form { // Sanitize tooltip $htmltext=ereg_replace("'","\'",$htmltext); + $htmltext=ereg_replace("'","\'",$htmltext); if ($tooltipon==1 || $tooltipon==3) { $paramfortooltiptext.=' onmouseover="showtip(\''.$htmltext.'\')"'; @@ -145,7 +146,7 @@ class Form */ function textwithwarning($text,$htmltext,$direction=1) { - return $this->textwithtooltip($text,$htmltext,2,$direction,img_warning("default")); + return $this->textwithtooltip($text,$htmltext,2,$direction,img_warning("")); } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 5ee5bae7804..a7ffb549209 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -31,6 +31,7 @@ ErrorDuplicateField=Duplicate value in a unique field ErrorSomeErrorWereFoundRollbackIsDone=Some errors were found. We rollback changes. ErrorConfigParameterNotDefined=Parameter %s is not defined inside Dolibarr config file conf.php. ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr database. +DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is setup to %s in configuration file conf.php.
This means that password database is extern to Dolibarr, so changing this field may have no effects. SeeAbove=See above HomeArea=Home area LastConnexion=Last connection diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index ac4e9722a38..80a49c17b52 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -31,6 +31,7 @@ ErrorDuplicateField=Doublon dans un champ unique ErrorSomeErrorWereFoundRollbackIsDone=Des erreurs ont été trouvés. On rollback les modifications. ErrorConfigParameterNotDefined=Le parametre %s n'est pas défini dans le fichier de configuration Dolibarr conf.php. ErrorCantLoadUserFromDolibarrDatabase=Impossible de trouver l'utilisateur %s dans la base Dolibarr. +DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr est configuré en mode authentification %s dans son fichier de configuration conf.php.
Cela signifie que la base des mots de passe est externe à Dolibarr, aussi toute modification de ce champ peut s'avérer sans effet. SeeAbove=Voir ci-dessus HomeArea=Espace accueil LastConnexion=Dernière connexion diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d291674c81c..5c9827502e4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -655,7 +655,7 @@ function top_menu($head, $title="", $target="") { $title=$langs->trans("Logout"); $title.='
'.$langs->trans("ConnectedSince").': '.dolibarr_print_date($user->datelastlogin,"%d/%m/%Y %H:%M:%S"); - $title.='
'.$langs->trans("AuthenticationMode").': '.$dolibarr_main_authentication; + if ($dolibarr_main_authentication) $title.='
'.$langs->trans("AuthenticationMode").': '.$dolibarr_main_authentication; $text.='atarget?(' target="'.$menutop->atarget.'"'):''; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 5f2dafe9354..3b593059688 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -94,7 +94,6 @@ $pos = strstr ($uri, '/'); // $pos contient alors url sans nom domaine if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' define('DOL_URL_ROOT', $pos); // URL racine relative - /* * Creation objet $conf */ diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 84ffa051a50..f50f5c96513 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1167,18 +1167,24 @@ else // Pass print ''.$langs->trans("Password").''; - if ($fuser->ldap_sid) + print ''; + if ($fuser->ldap_sid) { - print 'Mot de passe du domaine'; + $text='Mot de passe du domaine'; } else if ($caneditpassword) { - print ''; + $text=''; + if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http') + { + $text=$html->textwithwarning($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication)); + } } else { - print ''.eregi_replace('.','*',$fuser->pass); + $text=eregi_replace('.','*',$fuser->pass); } + print $text; print "\n"; // Administrateur