diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 8af1d9ad7e1..c8adb5a2277 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 ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 1c2660233dc..9ebd0d98ad2 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * 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='
'.$langs->trans('ConfigFileIsInReadOnly').'
'; + $mesg='
'.$langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)).'
'; } } else if ($_GET["action"] == 'disable_encryptdbpassconf') @@ -120,7 +120,7 @@ else if ($_GET["action"] == 'disable_encryptdbpassconf') } else { - $mesg = '
'.$langs->trans('ConfigFileIsInReadOnly').'
'; + $mesg='
'.$langs->trans('InstrucToClearPass',$dolibarr_main_db_pass).'
'; } } @@ -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."
\n"; + print $langs->trans("GeneratedPasswordDesc")."
\n"; print "
\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 '
'; print ''; print ''; @@ -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 '
'; // Affiche example @@ -280,7 +281,7 @@ if($conf->global->DATABASE_PWD_ENCRYPTED) print '"; print ''; - -// Disable link "Forget password" on logon -$var=!$var; -print ""; -print ''; -print ''; -if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 0) -{ - print '"; -} -if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) -{ - print '"; -} -print ""; -print ''; - - // Cryptage du mot de base de la base dans conf.php $var=!$var; print ""; print ''; print ''; print '"; print ""; print ''; + + +// Disable link "Forget password" on logon +$var=!$var; +print ""; +print ''; +print ''; +if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 0) +{ + print '"; +} +if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) +{ + print '"; +} +print ""; +print ''; + + print '
'; print ucfirst($key); print "\n"; - print $module->getDescription(); + print $module->getDescription().'
'; + print $langs->trans("MinLength").': '.$module->length; print '
'; 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 ''.$langs->trans("Disable").''; } @@ -293,39 +294,12 @@ if($conf->global->DATABASE_PWD_ENCRYPTED) print "
'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").''; -if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) -{ - print img_tick(); -} -print ''; - print ''.$langs->trans("Activate").''; - print "'; - print ''.$langs->trans("Disable").''; - print "
'.$langs->trans("MainDbPasswordFileConfEncrypted").''; -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 ''; -// 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 "
'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").''; +if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) +{ + print img_tick(); +} +print ''; + print ''.$langs->trans("Activate").''; + print "'; + print ''.$langs->trans("Disable").''; + print "
'; print ''; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 5dcf5b056c4..389387c359b 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -170,7 +170,8 @@ print ''; print '
'; -// Autre Options + +// Other Options $var=true; @@ -214,6 +215,22 @@ print ""; print ""; print ''; +print ''; + + +print '
'; + +// Antivirus options + +$var=true; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + // Enable AV scanner $var=!$var; print ""; diff --git a/htdocs/index.php b/htdocs/index.php index eeb69c16d7f..16f91289947 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 "
\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 "
'.$langs->trans("AntiVirus").''.$langs->trans("Activated").''.$langs->trans("Action").'
\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 ''; } -// 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 63d9ff4acbd..3c5f57a915a 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -102,11 +102,17 @@ if ($_POST["action"] == "set" || eregi('upgrade',$_POST["action"])) print ''; $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 c38608e1f4c..20054d5fe34 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 '
'; $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 af0a578eac5..933a6f226f5 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -79,11 +79,17 @@ if (isset($_POST['action']) && eregi('upgrade',$_POST["action"])) print '
'; - // 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 a7277df51e4..7e8e0f44d16 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 70c0eba9901..4b4fa6a8d65 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 conf.php file, replace the line
$dolibarr_main_db_pass="..."
by
$dolibarr_main_db_pass="crypted:%s" +InstrucToClearPass=To have password decoded (clear) into the conf.php file, replace the line
$dolibarr_main_db_pass="crypted:..."
by
$dolibarr_main_db_pass="%s" +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 ?
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 dfb27190e00..5941b012093 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 conf.php 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 cb58545319f..d3952b271aa 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 default permissions that are automatically granted to a new created 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 2ee78fd8910..13e9f75e6f6 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 conf.php, remplacer dans ce fichier la ligne
$dolibarr_main_db_pass="..."
par
$dolibarr_main_db_pass="crypted:%s" +InstrucToClearPass = Pour avoir le mot de passe de la base décodé (en clair) dans le fichier de configuration conf.php, remplacer dans ce fichier la ligne
$dolibarr_main_db_pass="crypted:..."
par
$dolibarr_main_db_pass="%s" +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 ?
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 67274b607b0..db4a438faa3 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 conf.php 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.
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 937e21d1501..f96c0e9fce8 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 par défaut, c'est-à-dire les permissions qui seront attribuées automatiquement à un nouvel utilisateur lors de sa création. +DefaultRightsDesc=Définissez ici les permissions par défaut, c'est-à-dire les permissions qui seront attribuées automatiquement à un nouvel 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 4666591cb53..e4fe583a1c9 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 581e581ae93..19a1fe14ff7 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 { - $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 (! empty($val)) + { + $passwd_crypted = $val; + $val = dol_decode($val); + $passwd = $val; + $lineofpass=1; + } } - else if (strstr($buffer,"\$dolibarr_main_db_pass") && $level == 1) + elseif (eregi('^[^#]*dolibarr_main_db_pass[ ]*=[ ]*(.*)',$buffer,$reg)) { - $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"; + $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; + } + + // Output line + if ($lineofpass) + { + // 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 801898aea9d..57af97dbe44 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