diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index 8af1d9ad7e1f87674266d525ee06e778c2bc05a0..c8adb5a2277a813c59f959acb56ab81b14739f16 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -69,8 +69,6 @@ $head=security_prepare_head();
 
 dol_fiche_head($head, 'default', $langs->trans("Security"));
 
-print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
-
 
 print '<table class="noborder" width="100%">';
 
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 1c2660233dc93f1bcdb2bd8ed310654419d8e4da..9ebd0d98ad23fe578820c90680d11426f907eb2e 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -1,5 +1,5 @@
 <?php
-/* Copyright (C) 2004-2008 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2004-2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005-2007 Regis Houssin        <regis@dolibarr.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -20,7 +20,7 @@
 /**
  *		\file       htdocs/admin/security.php
  *      \ingroup    setup
- *      \brief      Page de configuration du module s�curit�
+ *      \brief      Page de configuration du module s�curit�
  *		\version    $Id$
  */
 
@@ -83,7 +83,7 @@ if ($_GET["action"] == 'activate_encrypt')
 }
 else if ($_GET["action"] == 'disable_encrypt')
 {
-	//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas �tre d�cod�s
+	//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas �tre d�cod�s
 	//Do not allow "disable encryption" as passwords cannot be decrypted
 	if ($allow_disable_encryption)
 	{
@@ -105,7 +105,7 @@ if ($_GET["action"] == 'activate_encryptdbpassconf')
 	}
 	else
 	{
-		$mesg='<div class="error">'.$langs->trans('ConfigFileIsInReadOnly').'</div>';
+		$mesg='<div class="warning">'.$langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)).'</div>';
 	}
 }
 else if ($_GET["action"] == 'disable_encryptdbpassconf')
@@ -120,7 +120,7 @@ else if ($_GET["action"] == 'disable_encryptdbpassconf')
 	}
 	else
 	{
-		$mesg = '<div class="error">'.$langs->trans('ConfigFileIsInReadOnly').'</div>';
+		$mesg='<div class="warning">'.$langs->trans('InstrucToClearPass',$dolibarr_main_db_pass).'</div>';
 	}
 }
 
@@ -154,15 +154,16 @@ else if ($_GET["action"] == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
 
 
 /*
- * Affichage onglet
+ * View
  */
+$html = new Form($db);
 
 llxHeader('',$langs->trans("Passwords"));
 
-if ($mesg) print "$mesg\n";
-
 print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
 
+if ($mesg) print $mesg."<br>\n";
+
 print $langs->trans("GeneratedPasswordDesc")."<br>\n";
 print "<br>\n";
 
@@ -173,10 +174,9 @@ dol_fiche_head($head, 'passwords', $langs->trans("Security"));
 
 
 $var=false;
-$html = new Form($db);
 
 
-// Choix du gestionnaire du g�n�rateur de mot de passe
+// Choix du gestionnaire du g�n�rateur de mot de passe
 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<input type="hidden" name="action" value="update">';
@@ -192,7 +192,7 @@ while (($file = readdir($handle))!==false)
 {
     if (eregi('(modGeneratePass[a-z]+).class.php',$file,$reg))
     {
-        // Chargement de la classe de num�rotation
+        // Chargement de la classe de num�rotation
         $classname = $reg[1];
         require_once($dir.'/'.$file);
 
@@ -222,7 +222,8 @@ foreach ($arrayhandler as $key => $module)
         print '<tr '.$bc[$var].'><td width="100">';
         print ucfirst($key);
         print "</td><td>\n";
-        print $module->getDescription();
+        print $module->getDescription().'<br>';
+        print $langs->trans("MinLength").': '.$module->length;
         print '</td>';
 
         // Affiche example
@@ -280,7 +281,7 @@ if($conf->global->DATABASE_PWD_ENCRYPTED)
 	print '<td align="center" width="100">';
 	if ($allow_disable_encryption)
 	{
-		//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas �tre d�cod�s
+		//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas �tre d�cod�s
 	  	//Do not allow "disable encryption" as passwords cannot be decrypted
 	  	print '<a href="security.php?action=disable_encrypt">'.$langs->trans("Disable").'</a>';
 	}
@@ -293,39 +294,12 @@ if($conf->global->DATABASE_PWD_ENCRYPTED)
 print "</td>";
 print '</tr>';
 
-
-// Disable link "Forget password" on logon
-$var=!$var;
-print "<tr ".$bc[$var].">";
-print '<td colspan="3">'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").'</td>';
-print '<td align="center" width="60">';
-if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
-{
-	print img_tick();
-}
-print '</td>';
-if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 0)
-{
-	print '<td align="center" width="100">';
-	print '<a href="security.php?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK">'.$langs->trans("Activate").'</a>';
-	print "</td>";
-}
-if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
-{
-	print '<td align="center" width="100">';
-	print '<a href="security.php?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK">'.$langs->trans("Disable").'</a>';
-	print "</td>";
-}
-print "</td>";
-print '</tr>';
-
-
 // Cryptage du mot de base de la base dans conf.php
 $var=!$var;
 print "<tr ".$bc[$var].">";
 print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
 print '<td align="center" width="60">';
-if (! empty($dolibarr_main_db_encrypted_pass))
+if (eregi('crypted:',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
 {
 	print img_tick();
 }
@@ -333,7 +307,6 @@ if (! empty($dolibarr_main_db_encrypted_pass))
 print '</td>';
 
 print '<td align="center" width="100">';
-// TODO Impossibilit� de crypter le mot de passe lorsqu'il y a en a un, il affiche qu'il n'y en a pas !!
 if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass))
 {
 	$langs->load("errors");
@@ -385,6 +358,34 @@ print "</td>";
 print "</td>";
 print '</tr>';
 
+
+
+// Disable link "Forget password" on logon
+$var=!$var;
+print "<tr ".$bc[$var].">";
+print '<td colspan="3">'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").'</td>';
+print '<td align="center" width="60">';
+if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
+{
+	print img_tick();
+}
+print '</td>';
+if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 0)
+{
+	print '<td align="center" width="100">';
+	print '<a href="security.php?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK">'.$langs->trans("Activate").'</a>';
+	print "</td>";
+}
+if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
+{
+	print '<td align="center" width="100">';
+	print '<a href="security.php?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK">'.$langs->trans("Disable").'</a>';
+	print "</td>";
+}
+print "</td>";
+print '</tr>';
+
+
 print '</table>';
 print '</form>';
 
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index 5dcf5b056c4306dc4b2e4e40010b67c5ee96a135..389387c359ba05a5023b3bae8297af78bbf71677 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -170,7 +170,8 @@ print '</table>';
 
 print '<br>';
 
-// Autre Options
+
+// Other Options
 
 $var=true;
 
@@ -214,6 +215,22 @@ print "</td>";
 print "</td>";
 print '</tr>';
 
+print '</table>';
+
+
+print '<br>';
+
+// Antivirus options
+
+$var=true;
+
+print '<table class="noborder" width="100%">';
+print '<tr class="liste_titre">';
+print '<td colspan="3">'.$langs->trans("AntiVirus").'</td>';
+print '<td align="center" width="80">'.$langs->trans("Activated").'</td>';
+print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
+print '</tr>';
+
 // Enable AV scanner
 $var=!$var;
 print "<tr ".$bc[$var].">";
diff --git a/htdocs/index.php b/htdocs/index.php
index eeb69c16d7f682efc99f9b4582a6bf671ffee725..16f91289947f8ae4aa9b8620a357bb098628f226 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -63,16 +63,23 @@ if (! empty($conf->global->MAIN_MOTD))
 	}
 }
 
-// Affiche warning r�pertoire install existe (si utilisateur admin)
-if ($user->admin && ! defined("MAIN_REMOVE_INSTALL_WARNING"))
+// Security warning repertoire install existe (si utilisateur admin)
+if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
 {
+	// Install lock missing
 	if (is_dir(DOL_DOCUMENT_ROOT."/install") && ! file_exists('../install.lock'))
 	{
 		$langs->load("other");
 		$message=$langs->trans("WarningInstallDirExists",DOL_DOCUMENT_ROOT."/install");
 		$message.=$langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install");
 		print info_admin($message);
-		print "<br>\n";
+	}
+
+	// Conf files must be in read only mode
+	if (is_writable(DOL_DOCUMENT_ROOT.'/conf/conf.php'))
+	{
+		$langs->load("errors");
+		print info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly"));
 	}
 }
 
@@ -109,8 +116,8 @@ print "</table>\n";
 
 
 /*
- * Tableau de bord d'�tats Dolibarr (statistiques)
- * Non affich� pour un utilisateur externe
+ * Tableau de bord d'�tats Dolibarr (statistiques)
+ * Non affich� pour un utilisateur externe
  */
 $langs->load("commercial");
 $langs->load("bills");
@@ -125,7 +132,7 @@ if ($user->societe_id == 0)
 
 	$var=true;
 
-	// Condition � v�rifier pour affichage de chaque ligne du tableau de bord
+	// Condition � v�rifier pour affichage de chaque ligne du tableau de bord
 	$conditions=array(
 	! empty($conf->societe->enabled) && $user->rights->societe->lire,
 	! empty($conf->societe->enabled) && $user->rights->societe->lire,
@@ -162,7 +169,7 @@ if ($user->societe_id == 0)
 				   'Facture',
                    'LigneTel',
                    'Contrat');
-	// Cl� de tableau retourn� par la methode load_state_board pour chaque ligne
+	// Cl� de tableau retourn� par la methode load_state_board pour chaque ligne
 	$keys=array('customers',
                 'prospects',
                 'suppliers',
@@ -231,7 +238,7 @@ if ($user->societe_id == 0)
 		if ($conditions[$key])
 		{
 			$classe=$classes[$key];
-			// Cherche dans cache si le load_state_board deja r�alis�
+			// Cherche dans cache si le load_state_board deja r�alis�
 			if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe]))
 			{
 				include_once($includes[$key]);
@@ -279,7 +286,7 @@ $var=true;
 // Ne pas inclure de sections sans gestion de permissions
 //
 
-// Nbre actions � faire (en retard)
+// Nbre actions � faire (en retard)
 if ($conf->agenda->enabled && $user->rights->agenda->myactions->read)
 {
 	include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
@@ -305,7 +312,7 @@ if ($conf->agenda->enabled && $user->rights->agenda->myactions->read)
 	print "\n";
 }
 
-// Nbre commandes clients � traiter
+// Nbre commandes clients � traiter
 if ($conf->commande->enabled && $user->rights->commande->lire)
 {
 	include_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
@@ -329,7 +336,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
 	print "\n";
 }
 
-// Nbre propales ouvertes (expir�es)
+// Nbre propales ouvertes (expir�es)
 if ($conf->propal->enabled && $user->rights->propale->lire)
 {
 	$langs->load("propal");
@@ -354,7 +361,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
 	print '</tr>';
 }
 
-// Nbre propales ferm�es sign�es (� facturer)
+// Nbre propales ferm�es sign�es (� facturer)
 if ($conf->propal->enabled && $user->rights->propale->lire)
 {
 	$langs->load("propal");
@@ -380,7 +387,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
 	print "\n";
 }
 
-// Nbre services � activer (en retard)
+// Nbre services � activer (en retard)
 if ($conf->contrat->enabled && $user->rights->contrat->lire)
 {
 	$langs->load("contracts");
@@ -432,7 +439,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
 	print "\n";
 }
 
-// Nbre factures fournisseurs (� payer)
+// Nbre factures fournisseurs (� payer)
 if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->facture->lire)
 {
 	$langs->load("bills");
@@ -458,7 +465,7 @@ if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->fac
 	print "\n";
 }
 
-// Nbre factures clients (� payer)
+// Nbre factures clients (� payer)
 if ($conf->facture->enabled && $user->rights->facture->lire)
 {
 	$langs->load("bills");
@@ -484,7 +491,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 	print "\n";
 }
 
-// Nbre ecritures � rapprocher
+// Nbre ecritures � rapprocher
 if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id)
 {
 	$langs->load("banks");
@@ -510,7 +517,7 @@ if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id
 	print "\n";
 }
 
-// Nbre ecritures � rapprocher
+// Nbre ecritures � rapprocher
 if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id)
 {
 	$langs->load("banks");
@@ -536,7 +543,7 @@ if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id
 	print "\n";
 }
 
-// Nbre adh�rent valides (attente cotisation)
+// Nbre adh�rent valides (attente cotisation)
 if ($conf->adherent->enabled && $user->rights->adherent->lire && ! $user->societe_id)
 {
 	$langs->load("members");
diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php
index 63d9ff4acbd3554563825e77bcc917ea4ecae2ef..3c5f57a915a949697a505e8f278663aa22bf8b99 100644
--- a/htdocs/install/etape5.php
+++ b/htdocs/install/etape5.php
@@ -102,11 +102,17 @@ if ($_POST["action"] == "set" || eregi('upgrade',$_POST["action"]))
 	print '<table cellspacing="0" cellpadding="2" width="100%">';
 	$error=0;
 
-	// decode database pass if needed
-	if (! empty($dolibarr_main_db_encrypted_pass))
+	// If password is encoded, we decode it
+	if (eregi('crypted:',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
 	{
-		require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php");
-		$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
+		require_once($dolibarr_main_document_root."/lib/security.lib.php");
+		if (eregi('crypted:',$dolibarr_main_db_pass))
+		{
+			$dolibarr_main_db_pass = eregi_replace('crypted:', '', $dolibarr_main_db_pass);
+			$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
+			$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass;	// We need to set this as it is used to know the password was initially crypted
+		}
+		else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
 	}
 
 	$conf->db->type = $dolibarr_main_db_type;
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index c38608e1f4c40ef13b8a64f20c1f31c718ef4cd1..20054d5fe341888d4fe5b6d7e507134a207a78bf 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -85,11 +85,17 @@ if (! isset($_GET["action"]) || eregi('upgrade',$_GET["action"]) || $_GET["actio
 	print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
 	$error=0;
 
-	// decode database pass if needed
-	if (! empty($dolibarr_main_db_encrypted_pass))
+	// If password is encoded, we decode it
+	if (eregi('crypted:',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
 	{
 		require_once($dolibarr_main_document_root."/lib/security.lib.php");
-		$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
+		if (eregi('crypted:',$dolibarr_main_db_pass))
+		{
+			$dolibarr_main_db_pass = eregi_replace('crypted:', '', $dolibarr_main_db_pass);
+			$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
+			$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass;	// We need to set this as it is used to know the password was initially crypted
+		}
+		else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
 	}
 
 	// $conf is already instancied inside inc.php
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index af0a578eac5b857874fd2978f703a72d9959f67e..933a6f226f5cc8318fbfa2be2f80408b9544cafb 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -79,11 +79,17 @@ if (isset($_POST['action']) && eregi('upgrade',$_POST["action"]))
 
 	print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
 
-	// decode database pass if needed
-	if (! empty($dolibarr_main_db_encrypted_pass))
+	// If password is encoded, we decode it
+	if (eregi('crypted:',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
 	{
 		require_once($dolibarr_main_document_root."/lib/security.lib.php");
-		$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
+		if (eregi('crypted:',$dolibarr_main_db_pass))
+		{
+			$dolibarr_main_db_pass = eregi_replace('crypted:', '', $dolibarr_main_db_pass);
+			$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
+			$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass;	// We need to set this as it is used to know the password was initially crypted
+		}
+		else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
 	}
 
 	// $conf is already instancied inside inc.php
@@ -1840,7 +1846,7 @@ function migrate_commande_livraison($db,$langs,$conf)
 }
 
 /*
- * Migration des d�tails commandes dans les d�tails livraisons
+ * Migration des d�tails commandes dans les d�tails livraisons
  */
 function migrate_detail_livraison($db,$langs,$conf)
 {
diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang
index a7277df51e48e9bf3f38e6bd09f996498ddad68b..7e8e0f44d160dea09c712c0f1048672f1664b207 100644
--- a/htdocs/langs/de_DE/admin.lang
+++ b/htdocs/langs/de_DE/admin.lang
@@ -169,7 +169,6 @@ Passwords=Passwörter
 DoNotStoreClearPassword=Keine Passwörter im Klartext in der Datenbank
 MainDbPasswordFileConfEncrypted=Passwort für die Datenbank verschlüsselt conf.php
 ConfigFileIsInReadOnly=Die Datei conf.php kann nur gelesen werden, überprüfen Sie die Berechtigungen.
-ProtectAndEncryptPdfFiles=Schutz der erzeugten PDF-Dateien (nicht recommandd, bricht Masse PDF-Generierung)
 Feature=Merkmal
 DolibarrLicense=Lizenz
 DolibarrProjectLeader=Projektleiter
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 70c0eba9901d720fb21e58041a55f221e64bd9e6..4b4fa6a8d6534710e547e90e1947eb95d6ef2da2 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -165,10 +165,11 @@ AvailableOnlyIfJavascriptAndAjaxNotDisabled=Available only if JavaScript is not
 Required=Required
 Security=Security
 Passwords=Passwords
-DoNotStoreClearPassword=Do no store passwords in clear in the database
-MainDbPasswordFileConfEncrypted=Database password encrypted in conf.php
-ConfigFileIsInReadOnly=The file conf.php is read-only, check the permissions.
-ProtectAndEncryptPdfFiles=Protection of generated pdf files (not recommandd, breaks mass pdf generation)
+DoNotStoreClearPassword=Do no store clear passwords in database but store only encrypted value (Activated recommended)
+MainDbPasswordFileConfEncrypted=Database password encrypted in conf.php (Activated recommended)
+InstrucToEncodePass=To have password encoded into the <b>conf.php</b> file, replace the line <br><b>$dolibarr_main_db_pass="..."</b><br>by<br><b>$dolibarr_main_db_pass="crypted:%s"</b>
+InstrucToClearPass=To have password decoded (clear) into the <b>conf.php</b> file, replace the line <br><b>$dolibarr_main_db_pass="crypted:..."</b><br>by<br><b>$dolibarr_main_db_pass="%s"</b>
+ProtectAndEncryptPdfFiles=Protection of generated pdf files (Activated NOT recommended, breaks mass pdf generation)
 ProtectAndEncryptPdfFilesDesc=Protection of a PDF document keeps it available to read and print with any PDF browser. However, editing and copying is not possible anymore. Note that using this feature make building of a global cumulated pdf not working (like unpaid invoices).
 Feature=Feature
 DolibarrLicense=License
@@ -245,6 +246,7 @@ AddCRIfTooLong=There is no automatic wrapping, so if line is out of page on docu
 ModuleDisabled=Module disabled
 ModuleDisabledSoNoEvent=Module disabled so event never created
 ConfirmPurge=Are you sure you want to execute this purge ?<br>This will delete definitely all your file data with no way to restore them (ECM files, attached files...). 
+MinLength=Minimum length
 
 # Modules
 Module0Name=Users & groups
@@ -703,7 +705,7 @@ PasswordGenerationNone=Do not suggest any generated password. Password must be t
 ##### Users setup #####
 UserGroupSetup=Users and groups module setup
 GeneratePassword=Suggest a generated password
-RuleForGeneratedPasswords=Rule to generate suggested passwords
+RuleForGeneratedPasswords=Rule to generate suggested passwords or validate passwords
 DoNotSuggest=Do not suggest any password
 EncryptedPasswordInDatabase=To allow the encryption of the passwords in the database
 DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index dfb27190e007141da16055ad1945f46841ec6291..5941b01209347758172873d45add6a2748cb6299 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -47,3 +47,4 @@ ErrorCantSaveADoneUserWithZeroPercentage=Can't save an action with "statut not s
 ErrorBillRefAlreadyExists=Ref used for creation already exists.
 ErrorPleaseTypeBankTransactionReportName=Please type bank receipt name where transaction is reported (Format YYYYMM or YYYYMMDD) 
 ErrorRecordHasChildren=Failed to delete records since it has some childs.
+WarningConfFileMustBeReadOnly=Warning, your config file <b>conf.php</b> can be overwritten by the web server. This is a serious security hole. Modify permissions on file to be in read only mode for operating system user used by Web server. If you use Windows and FAT format for your disk, you must know that this file system does not allow to add permissions on file, so can't be completely safe.
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index cb58545319f3ddc8c14041cdc5f5500a3cadd1b9..d3952b271aa3112779d7f6c434883c28d16b4cd5 100755
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -46,7 +46,7 @@ Administrator=Administrator
 SuperAdministrator=Super Administrator
 SuperAdministratorDesc=Administrator with all rights
 DefaultRights=Default permissions
-DefaultRightsDesc=Define here default permissions that are automatically granted to a new created user.
+DefaultRightsDesc=Define here <u>default</u> permissions that are automatically granted to a <u>new created</u> user (Go on user card to change permission of an existing user).
 DolibarrUsers=Dolibarr users
 LastName=Name
 FirstName=First name
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 2ee78fd8910785f47bab6d242c7a21521d778eef..13e9f75e6f6b10bf435d06a9ae609156bd0ae63f 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -165,10 +165,11 @@ AvailableOnlyIfJavascriptAndAjaxNotDisabled = Disponible uniquement si Javascrip
 Required = Requis
 Security = Sécurité
 Passwords = Mots de passe
-DoNotStoreClearPassword = Ne pas stocker de mot de passe en clair dans la base
-MainDbPasswordFileConfEncrypted = Encrypter le mot de passe de la base dans le fichier conf.php
-ConfigFileIsInReadOnly = Le fichier conf.php est lecture seule, vérifiez les droits d'écriture.
-ProtectAndEncryptPdfFiles = Protection des pdf générés (non recommandé, rend inopérent la génération de PDF de masse)
+DoNotStoreClearPassword = Ne pas stocker de mot de passe en clair dans la base (Activation recommandée)
+MainDbPasswordFileConfEncrypted = Encrypter le mot de passe de la base dans le fichier conf.php (Activation recommandée)
+InstrucToEncodePass = Pour avoir le mot de passe de la base encodé dans le fichier de configuration <b>conf.php</b>, remplacer dans ce fichier la ligne<br><b>$dolibarr_main_db_pass="..."</b><br>par<br><b>$dolibarr_main_db_pass="crypted:%s"</b>
+InstrucToClearPass = Pour avoir le mot de passe de la base décodé (en clair) dans le fichier de configuration <b>conf.php</b>, remplacer dans ce fichier la ligne<br><b>$dolibarr_main_db_pass="crypted:..."</b><br>par<br><b>$dolibarr_main_db_pass="%s"</b>
+ProtectAndEncryptPdfFiles = Protection des pdf générés (Activation NON recommandé, rend inopérent la génération de PDF de masse)
 ProtectAndEncryptPdfFilesDesc = La protection d'un document pdf laisse le document libre à la lecture et à l'impression avec tout logiciel de lecture PDF. Par contre, la modification et la copie deviennent impossible. Notez de plus que l'utilisation de cette option empeche la génération de pdf cumulés (comme pour le pdf global des impayés).
 Feature = Fonction
 DolibarrLicense = Licence
@@ -245,6 +246,7 @@ AddCRIfTooLong=Il n'y a pas de coupures de lignes automatiques, aussi si votre t
 ModuleDisabled=Module désactivé
 ModuleDisabledSoNoEvent=Module désactivé donc évênement jamais créé
 ConfirmPurge=Etes vous sur de vouloir réaliser cette purge ?<br>Ceci effacera définitivement toutes vos données fichier (espace GED, pièces jointes, etc...). 
+MinLength=Longueur minimale
 
 # Modules = undefined
 Module0Name = Utilisateurs & groupes
@@ -703,9 +705,9 @@ PasswordGenerationNone = Ne propose pas de mots de passe générés. Le mot de p
 ##### Users setup ##### = undefined
 UserGroupSetup = Configuration module utilisateurs et groupes
 GeneratePassword = Proposer un mot de passe généré
-RuleForGeneratedPasswords = Règle pour la génération des mots de passe proposés
+RuleForGeneratedPasswords = Règle pour la génération des mots de passe proposés et leur validation
 DoNotSuggest = Ne pas proposer
-EncryptedPasswordInDatabase = Permettre l'encryption des mots de passe dans la base de données
+EncryptedPasswordInDatabase = Permettre l'encryption des mots de passe dans la base de données (Activation recommandée)
 DisableForgetPasswordLinkOnLogonPage = Ne pas afficher le lien "Mot de passe oublié" sur la page de connexion
 ##### Company setup ##### = undefined
 CompanySetup = Configuration du module Sociétés
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 67274b607b05909fe84d21b0b1d4735f31db1225..db4a438faa323007fd7e39f40c91f713791392be 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -47,4 +47,5 @@ ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire %
 ErrorCantSaveADoneUserWithZeroPercentage=Impossible sauver une action à l'état non commencé avec un utilisateur défini comme ayant fait l'action.
 ErrorBillRefAlreadyExists=La référence utilisée pour la création existe déjà
 ErrorPleaseTypeBankTransactionReportName=Veuiller saisir le nom de relevé bancaire sur lequel l'écriture est constaté (Format AAAAMM ou AAAMMJJ)
-ErrorRecordHasChildren=Impossible de supprimer l'enregistrement car il possède des fils. 
\ No newline at end of file
+ErrorRecordHasChildren=Impossible de supprimer l'enregistrement car il possède des fils.
+WarningConfFileMustBeReadOnly=Attention, votre fichier <b>conf.php</b> est accessible en écriture au serveur Web. Ceci représente une faille sérieuse de sécurité. Modifier les permissions pour qu'il soit en lecture seule pour le compte sous lequel tourne le serveur Web.<br>Si vous êtes sous Windows sur un disque dur utilisant un formatage FAT, sachez que ce système de fichier ne permet pas de protéger des fichiers et n'offre donc aucune solution rendre pour être sur.
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang
index 937e21d15013f21431a6d3abda1944859d345786..f96c0e9fce8a54d21f4c896cbd17b1204e6df028 100755
--- a/htdocs/langs/fr_FR/users.lang
+++ b/htdocs/langs/fr_FR/users.lang
@@ -46,7 +46,7 @@ Administrator=Administrateur
 SuperAdministrator=Super Administrateur
 SuperAdministratorDesc=Administrateur principal ayant tous les droits
 DefaultRights=Permissions par défaut
-DefaultRightsDesc=Définissez ici les permissions <b>par défaut</b>, c'est-à-dire les permissions qui seront attribuées automatiquement à un nouvel utilisateur lors de sa création.
+DefaultRightsDesc=Définissez ici les permissions <u>par défaut</u>, c'est-à-dire les permissions qui seront attribuées automatiquement à un <u>nouvel</u> utilisateur lors de sa création (Voir la fiche utilisateur pour changer les permissions d'un utilisateur existant).
 DolibarrUsers=Utilisateurs Dolibarr
 LastName=Nom
 FirstName=Prénom
diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang
index 4666591cb53ae6602b8bd197ba1b7d06218a9786..e4fe583a1c9d0b4c1b8d8229b0c90d2526734b07 100644
--- a/htdocs/langs/nl_NL/admin.lang
+++ b/htdocs/langs/nl_NL/admin.lang
@@ -171,7 +171,6 @@ Passwords=Wachtwoorden
 DoNotStoreClearPassword=Doe geen wachtwoorden opslaan in duidelijke in de database
 MainDbPasswordFileConfEncrypted=Database wachtwoord versleuteld conf.php
 ConfigFileIsInReadOnly=Het bestand conf.php read-only is, controleert u de machtigingen.
-ProtectAndEncryptPdfFiles=Bescherming van de gegenereerde PDF-bestanden (niet recommandd, pauzes massa pdf generatie)
 ProtectAndEncryptPdfFilesDesc=Bescherming van een PDF-document houdt deze ter beschikking te lezen en te printen met een PDF-browser. Echter, het bewerken en kopiëren is niet meer mogelijk. Merk op dat het gebruik van deze functie maakt de bouw van een globale gecumuleerde pdf niet werkt (zoals unpaid facturen).
 Feature=Kenmerk
 DolibarrLicense=Licentie
diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php
index 581e581ae936144cbb8cd85b5c644a24fd227978..19a1fe14ff77e5ec3cd9ac77194fd749f8cefb75 100644
--- a/htdocs/lib/security.lib.php
+++ b/htdocs/lib/security.lib.php
@@ -333,13 +333,15 @@ function makesalt($type=CRYPT_SALT_LENGTH)
 
 /**
  *  \brief   	Encode\decode database password in config file
- *  \param   	level   Encode level : 0 no enconding, 1 encoding
- *	\return		int		<0 if KO, >0 if OK
+ *  \param   	level   	Encode level: 0 no encoding, 1 encoding
+ *	\return		int			<0 if KO, >0 if OK
  */
 function encodedecode_dbpassconf($level=0)
 {
 	dol_syslog("security.lib::encodedecode_dbpassconf level=".$level, LOG_DEBUG);
 	$config = '';
+	$passwd='';
+	$passwd_crypted='';
 
 	if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php','r'))
 	{
@@ -347,19 +349,57 @@ function encodedecode_dbpassconf($level=0)
 		{
 			$buffer = fgets($fp,4096);
 
-			if (strstr($buffer,"\$dolibarr_main_db_encrypted_pass") && $level == 0)
+			$lineofpass=0;
+
+			if (eregi('^[^#]*dolibarr_main_db_encrypted_pass[ ]*=[ ]*(.*)',$buffer,$reg))	// Old way to save crypted value
+			{
+				$val = trim($reg[1]);	// This also remove CR/LF
+				$val=eregi_replace('^["\']','',$val);
+				$val=eregi_replace('["\'][ ;]*$','',$val);
+				if (! empty($val))
+				{
+					$passwd_crypted = $val;
+					$val = dol_decode($val);
+					$passwd = $val;
+					$lineofpass=1;
+				}
+			}
+			elseif (eregi('^[^#]*dolibarr_main_db_pass[ ]*=[ ]*(.*)',$buffer,$reg))
 			{
-				$passwd = strstr($buffer,"$dolibarr_main_db_encrypted_pass=");
-				$passwd = substr(substr($passwd,2),0,-3);
-				$passwd = dol_decode($passwd);
-				$config .= "\$dolibarr_main_db_pass=\"$passwd\";\n";
+				$val = trim($reg[1]);	// This also remove CR/LF
+				$val=eregi_replace('^["\']','',$val);
+				$val=eregi_replace('["\'][ ;]*$','',$val);
+				if (eregi('crypted:',$buffer))
+				{
+					$val = eregi_replace('crypted:','',$val);
+					$passwd_crypted = $val;
+					$val = dol_decode($val);
+					$passwd = $val;
+				}
+				else
+				{
+					$passwd = $val;
+					$val = dol_encode($val);
+					$passwd_crypted = $val;
+				}
+				$lineofpass=1;
 			}
-			else if (strstr($buffer,"\$dolibarr_main_db_pass") && $level == 1)
+
+			// Output line
+			if ($lineofpass)
 			{
-				$passwd = strstr($buffer,"$dolibarr_main_db_pass=");
-				$passwd = substr(substr($passwd,2),0,-3);
-				$passwd = dol_encode($passwd);
-				$config .= "\$dolibarr_main_db_encrypted_pass=\"$passwd\";\n";
+				// Add value at end of file
+				if ($level == 0)
+				{
+					$config .= '$dolibarr_main_db_pass="'.$passwd.'";'."\n";
+				}
+				if ($level == 1)
+				{
+					$config .= '$dolibarr_main_db_pass="crypted:'.$passwd_crypted.'";'."\n";
+				}
+
+				//print 'passwd = '.$passwd.' - passwd_crypted = '.$passwd_crypted;
+				//exit;
 			}
 			else
 			{
@@ -368,13 +408,15 @@ function encodedecode_dbpassconf($level=0)
 		}
 		fclose($fp);
 
+		// Write new conf file
 		$file=DOL_DOCUMENT_ROOT.'/conf/conf.php';
 		if ($fp = @fopen($file,'w'))
 		{
 			fputs($fp, $config, strlen($config));
 			fclose($fp);
-			// It's config file, so we set permission for creator only
-			// @chmod($file, octdec('0600'));
+			// It's config file, so we set read permission for creator only.
+			// Should set permission to web user and groups for users used by batch
+			//@chmod($file, octdec('0600'));
 
 			return 1;
 		}
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 801898aea9d6e100a5ba1d1ab340cbffd5b51b51..57af97dbe44f136d61211f93a644b3c557971540 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -103,12 +103,19 @@ if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"))
  * Create $conf object
  */
 
-// on d�code le mot de passe de la base si besoin
 require_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php");	// Need 970ko memory (1.1 in 2.2)
-if (! empty($dolibarr_main_db_encrypted_pass))
+
+// If password is encoded, we decode it
+if (eregi('crypted:',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
 {
 	require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php");
-	$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
+	if (eregi('crypted:',$dolibarr_main_db_pass))
+	{
+		$dolibarr_main_db_pass = eregi_replace('crypted:', '', $dolibarr_main_db_pass);
+		$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
+		$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass;	// We need to set this as it is used to know the password was initially crypted
+	}
+	else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
 }
 //print memory_get_usage();
 
@@ -252,7 +259,7 @@ if (! defined('NOREQUIREDB'))
 
 /*
  * Creation objet $mysoc
- * Objet Societe qui contient carac de l'institution g�r�e par Dolibarr.
+ * Objet Societe qui contient carac de l'institution g�r�e par Dolibarr.
  */
 if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
 {
@@ -293,7 +300,7 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
 	$mysoc->siret=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
 	$mysoc->ape=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
 	$mysoc->rcs=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS;
-	// Id prof g�n�riques
+	// Id prof g�n�riques
 	$mysoc->profid1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN;
 	$mysoc->profid2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
 	$mysoc->profid3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
@@ -322,7 +329,7 @@ if (! defined('NOREQUIRETRAN'))
 
 /*
  * Pour utiliser d'autres versions des librairies externes que les
- * versions embarqu�es dans Dolibarr, d�finir les constantes adequates:
+ * versions embarqu�es dans Dolibarr, d�finir les constantes adequates:
  * Pour FPDF:           FPDF_PATH
  * Pour PHP_WriteExcel: PHP_WRITEEXCEL_PATH
  * Pour MagpieRss:      MAGPIERSS_PATH