2
0
forked from Wavyzz/dolibarr

All data from conf file are stored into conf->file->xxx

Multicompany should be ok to logon with no breaking sessions when disabled
This commit is contained in:
Laurent Destailleur
2009-05-08 01:11:04 +00:00
parent 14afe7a82f
commit cbdd29a51a
23 changed files with 70 additions and 71 deletions

View File

@@ -78,7 +78,7 @@ class CMailFile
// If ending method not defined
if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
dol_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to", LOG_DEBUG);
dol_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to", LOG_DEBUG);
dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG);
// Detect if message is HTML (use fast method)
@@ -162,7 +162,7 @@ class CMailFile
require_once(DOL_DOCUMENT_ROOT."/includes/smtps/SMTPs.php");
$smtps = new SMTPs();
$smtps->setCharSet($conf->character_set_client);
$smtps->setCharSet($conf->file->character_set_client);
$smtps->setSubject($subject);
$smtps->setTO($to);
$smtps->setFrom($from);
@@ -419,12 +419,12 @@ class CMailFile
if ($this->msgishtml)
{
if (! $this->atleastonefile) $out.= "Content-Type: text/html; charset=".$conf->character_set_client.$this->eol;
if (! $this->atleastonefile) $out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol;
$out.= "Content-Transfer-Encoding: 8bit".$this->eol;
}
else
{
if (! $this->atleastonefile) $out.= "Content-Type: text/plain; charset=".$conf->character_set_client.$this->eol;
if (! $this->atleastonefile) $out.= "Content-Type: text/plain; charset=".$conf->file->character_set_client.$this->eol;
$out.= "Content-Transfer-Encoding: 8bit".$this->eol;
}
@@ -476,11 +476,11 @@ class CMailFile
$out.= "--" . $this->mime_boundary . $this->eol;
if ($this->msgishtml)
{
$out.= "Content-Type: text/html; charset=".$conf->character_set_client.$this->eol;
$out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol;
}
else
{
$out.= "Content-Type: text/plain; charset=".$conf->character_set_client.$this->eol;
$out.= "Content-Type: text/plain; charset=".$conf->file->character_set_client.$this->eol;
}
$out.= $this->eol;
}

View File

@@ -139,8 +139,8 @@ class DoliDb
// If client connected with different charset than Dolibarr HTML output
$clientmustbe='';
if (eregi('UTF-8',$conf->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->character_set_client)) $clientmustbe='latin1';
if (eregi('UTF-8',$conf->file->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->file->character_set_client)) $clientmustbe='latin1';
if (mysql_client_encoding($this->db) != $clientmustbe)
{
$this->query("SET NAMES '".$clientmustbe."'", $this->db);
@@ -165,8 +165,8 @@ class DoliDb
{
// If client connected with different charset than Dolibarr HTML output
$clientmustbe='';
if (eregi('UTF-8',$conf->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->character_set_client)) $clientmustbe='latin1';
if (eregi('UTF-8',$conf->file->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->file->character_set_client)) $clientmustbe='latin1';
if (mysql_client_encoding($this->db) != $clientmustbe)
{
$this->query("SET NAMES '".$clientmustbe."'", $this->db);

View File

@@ -141,8 +141,8 @@ class DoliDb
// If client connected with different charset than Dolibarr HTML output
$clientmustbe='';
if (eregi('UTF-8',$conf->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->character_set_client)) $clientmustbe='latin1';
if (eregi('UTF-8',$conf->file->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->file->character_set_client)) $clientmustbe='latin1';
if (mysqli_client_encoding($this->db) != $clientmustbe)
{
$this->query("SET NAMES '".$clientmustbe."'", $this->db);
@@ -167,8 +167,8 @@ class DoliDb
{
// If client connected with different charset than Dolibarr HTML output
$clientmustbe='';
if (eregi('UTF-8',$conf->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->character_set_client)) $clientmustbe='latin1';
if (eregi('UTF-8',$conf->file->character_set_client)) $clientmustbe='utf8';
if (eregi('ISO-8859-1',$conf->file->character_set_client)) $clientmustbe='latin1';
if (mysqli_client_encoding($this->db) != $clientmustbe)
{
$this->query("SET NAMES '".$clientmustbe."'", $this->db);

View File

@@ -72,7 +72,7 @@ class DoliDb
{
global $conf,$langs;
$this->forcecharset=$conf->character_set_client;
$this->forcecharset=$conf->file->character_set_client;
$this->forcecollate=$conf->db->dolibarr_main_db_collation;
$this->database_user=$user;

View File

@@ -1109,8 +1109,8 @@ class Ldap
function convToOutputCharset($str,$pagecodefrom='UTF-8')
{
global $conf;
if ($pagecodefrom == 'ISO-8859-1' && $conf->character_set_client == 'UTF-8') $str=utf8_encode($str);
if ($pagecodefrom == 'UTF-8' && $conf->character_set_client == 'ISO-8859-1') $str=utf8_decode($str);
if ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_encode($str);
if ($pagecodefrom == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_decode($str);
return $str;
}
@@ -1123,8 +1123,8 @@ class Ldap
function convFromOutputCharset($str,$pagecodeto='UTF-8')
{
global $conf;
if ($pagecodeto == 'ISO-8859-1' && $conf->character_set_client == 'UTF-8') $str=utf8_decode($str);
if ($pagecodeto == 'UTF-8' && $conf->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);
if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);
return $str;
}
}

View File

@@ -331,13 +331,13 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
* \param format vcal or ical
* \param string string to encode
* \return string string encoded
* \remarks string must be encoded in conf->character_set_client
* \remarks string must be encoded in conf->file->character_set_client
*/
function format_cal($format,$string)
{
global $conf;
if ($conf->character_set_client == 'ISO-8859-1') $newstring=utf8_encode($string);
if ($conf->file->character_set_client == 'ISO-8859-1') $newstring=utf8_encode($string);
else $newstring=$string;
// Now newstring is always UTF8 string