Fix: affichage d'un message d'erreur si conf.php est en lecture seule

This commit is contained in:
Regis Houssin 2007-04-25 12:41:35 +00:00
parent 79cb71180f
commit b72ef4d967
3 changed files with 26 additions and 6 deletions

View File

@ -36,6 +36,8 @@ if (!$user->admin) accessforbidden();
// Do not allow change to clear model once passwords are crypted
$allow_disable_encryption=false;
$mesg = '';
/*
* Actions
@ -90,16 +92,30 @@ else if ($_GET["action"] == 'disable_encrypt')
if ($_GET["action"] == 'activate_encryptdbpassconf')
{
$result = encodedecode_dbpassconf(1);
if ($result > 0) dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
Header("Location: security.php");
exit;
if ($result > 0)
{
dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
Header("Location: security.php");
exit;
}
else
{
$mesg='<div class="error">'.$langs->trans('ConfigFilesIsReadOnly').'</div>';
}
}
else if ($_GET["action"] == 'disable_encryptdbpassconf')
{
$result = encodedecode_dbpassconf(0);
if ($result > 0) dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED");
Header("Location: security.php");
exit;
if ($result > 0)
{
dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED");
Header("Location: security.php");
exit;
}
else
{
$mesg = '<div class="error">'.$langs->trans('ConfigFilesIsReadOnly').'</div>';
}
}
/*
@ -108,6 +124,8 @@ else if ($_GET["action"] == 'disable_encryptdbpassconf')
llxHeader();
if ($mesg) print "$mesg\n";
print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
print $langs->trans("GeneratedPasswordDesc")."<br>\n";

View File

@ -94,6 +94,7 @@ Security=Security
Passwords=Passwords
DoNotStoreClearPassword=Do no store clear passwords in database
MainDbPasswordFileConfEncrypted=Password of the database encrypted in conf.php
ConfigFilesIsReadOnly=The file conf.php is in read only, check the rights.
Feature=Feature
DolibarrLicense=License
DolibarrProjectLeader=Project leader

View File

@ -94,6 +94,7 @@ Security=S
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
ConfigFilesIsReadOnly=Le fichier conf.php est lecture seule, vérifiez les droits d'écriture.
Feature=Fonction
DolibarrLicense=Licence
DolibarrProjectLeader=Chef de projet