New: add crypt key for cookie in conf.php

This commit is contained in:
Regis Houssin 2010-10-20 14:37:00 +00:00
parent 46eacb1b1a
commit 1b6fda21af

View File

@ -514,6 +514,8 @@ function write_conf_file($conffile)
global $dolibarr_main_db_type,$dolibarr_main_db_character_set,$dolibarr_main_db_collation,$dolibarr_main_authentication;
$error=0;
$key = md5(uniqid(mt_rand(),TRUE)); // Genere un hash d'un nombre aleatoire
$fp = fopen("$conffile", "w");
if($fp)
@ -575,6 +577,9 @@ function write_conf_file($conffile)
fputs($fp, '$dolibarr_main_force_https=\''.$_POST["main_force_https"].'\';');
fputs($fp,"\n");
fputs($fp, '$dolibarr_main_cookie_cryptkey=\''.$key.'\';');
fputs($fp,"\n");
fputs($fp, '?>');
fclose($fp);