Sec: Add warning if conf.php is not in read only mode.
Sec: Use a more common way to save the encoded password in conf file.
This commit is contained in:
parent
dace319301
commit
7edaddcd17
@ -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%">';
|
||||
|
||||
|
||||
@ -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<EFBFBD>curit<EFBFBD>
|
||||
* \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 <EFBFBD>tre d<>cod<6F>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<EFBFBD>n<EFBFBD>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<EFBFBD>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 <EFBFBD>tre d<>cod<6F>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>';
|
||||
|
||||
|
||||
@ -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].">";
|
||||
|
||||
@ -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'<EFBFBD>tats Dolibarr (statistiques)
|
||||
* Non affich<EFBFBD> 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 <EFBFBD> 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<EFBFBD> de tableau retourn<72> 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<EFBFBD>alis<EFBFBD>
|
||||
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 <EFBFBD> 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 <EFBFBD> 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<EFBFBD>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<EFBFBD>es sign<67>es (<28> 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 <EFBFBD> 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 (<EFBFBD> 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 (<EFBFBD> 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 <EFBFBD> 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 <EFBFBD> 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<EFBFBD>rent valides (attente cotisation)
|
||||
if ($conf->adherent->enabled && $user->rights->adherent->lire && ! $user->societe_id)
|
||||
{
|
||||
$langs->load("members");
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<EFBFBD>tails commandes dans les d<EFBFBD>tails livraisons
|
||||
*/
|
||||
function migrate_detail_livraison($db,$langs,$conf)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
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.
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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<EFBFBD>r<EFBFBD>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<EFBFBD>n<EFBFBD>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<EFBFBD>es dans Dolibarr, d<EFBFBD>finir les constantes adequates:
|
||||
* Pour FPDF: FPDF_PATH
|
||||
* Pour PHP_WriteExcel: PHP_WRITEEXCEL_PATH
|
||||
* Pour MagpieRss: MAGPIERSS_PATH
|
||||
|
||||
Loading…
Reference in New Issue
Block a user