diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 3faf6f2fe6e..8cbeb22bacd 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -186,7 +186,8 @@ function dolibarr_syslog($message, $level=LOG_INFO) * Si SYSLOG_FILE_NO_ERROR defini, on ne gere pas erreur ecriture log * \param message Line to log. Ne doit pas etre traduit si level = LOG_ERR * \param level Log level - * \remarks Cette fonction n'a un effet que si le module syslog est active. + * \remarks This function works only if syslog module is enabled. + * \remarks This must must not use any call to other function calling dol_syslog (avoid infinite loop). * \remarks On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=LOG_DEBUG=6 * On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7 */ @@ -225,8 +226,10 @@ function dol_syslog($message, $level=LOG_INFO) $filelog=eregi_replace('DOL_DATA_ROOT',DOL_DATA_ROOT,$filelog); if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen($filelog,"a+"); else $file=fopen($filelog,"a+"); + if ($file) { + $ip='unknown_ip'; if (! empty($_SERVER["REMOTE_ADDR"])) $ip=$_SERVER["REMOTE_ADDR"]; @@ -250,8 +253,8 @@ function dol_syslog($message, $level=LOG_INFO) } elseif (! defined("SYSLOG_FILE_NO_ERROR")) { - $langs->load("main"); - print $langs->trans("ErrorFailedToOpenFile",$filelog); + // Do not use call to functions that make call to dol_syslog, so no call to langs. + print "Error, failed to open file ".$filelog."\n"; } } else diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6672a5acb5f..81b70d48524 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -145,6 +145,7 @@ if ($conf->main_force_https) } } + // Chargement des includes complementaires de presentation if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); // Need 11ko memory (11ko in 2.2) if (! defined('NOREQUIREHTML')) require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php"); // Need 690ko memory (800ko in 2.2) @@ -340,6 +341,7 @@ else // Remarks: On ne sauvegarde pas objet user car pose pb dans certains cas mal identifies $login=$_SESSION["dol_login"]; $resultFetchUser=$user->fetch($login); + dolibarr_syslog("This is an already logged session. _SESSION['dol_login']=".$login); if ($resultFetchUser <= 0) { diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index ca6d419fdf2..8d75a2a73ff 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -181,8 +181,8 @@ class Translate { // Check parameters if (empty($domain)) { - dolibarr_syslog("Translate::Load ErrorWrongParameters",LOG_WARNING); - return -1; + dolibarr_print_error('',"Translate::Load ErrorWrongParameters"); + exit; } // Check cache @@ -282,7 +282,8 @@ class Translate { // Pour les langues aux fichiers parfois incomplets, on charge la langue alternative if (! $newalt && $this->defaultlang != "fr_FR" && $this->defaultlang != "en_US") { - dolibarr_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG); + // This function must not contains call to syslog + dolibarr_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$domain.".lang file)", LOG_DEBUG); $this->load($domain,1); } diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 9b991bd911e..391b891c237 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -228,13 +228,10 @@ class User extends CommonObject } // Recupere parametrage global propre a l'utilisateur - // \TODO a stocker/recuperer en session pour eviter ce select a chaque page - // \TODO Remove where on page and remove page field in databse (not used) if ($loadpersonalconf) { $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; $sql.= " WHERE fk_user = ".$this->id; - $sql.= " AND page = ''"; $result=$this->db->query($sql); if ($result) { @@ -868,7 +865,7 @@ class User extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql.= " SET fk_member=".$member->id; $sql.= " WHERE rowid=".$this->id; - + dolibarr_syslog("User::create_from_member sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/mysql/migration/2.5.0-2.6.0.sql b/mysql/migration/2.5.0-2.6.0.sql index 369473b4564..b3d2dfd87fa 100644 --- a/mysql/migration/2.5.0-2.6.0.sql +++ b/mysql/migration/2.5.0-2.6.0.sql @@ -54,3 +54,5 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (19 -- SAINT MARTIN insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT Rate 0',1); + +alter table llx_user_param drop column page; diff --git a/mysql/tables/llx_user_param.sql b/mysql/tables/llx_user_param.sql index 5afb3997331..c8330fc84d6 100644 --- a/mysql/tables/llx_user_param.sql +++ b/mysql/tables/llx_user_param.sql @@ -1,6 +1,6 @@ -- ============================================================================ --- Copyright (C) 2004 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2004-2009 Laurent Destailleur -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -22,7 +22,6 @@ create table llx_user_param ( fk_user integer NOT NULL, - page varchar(255) NOT NULL, param varchar(64) NOT NULL, value varchar(255) NOT NULL,