From c938a6b8ebc7a0f3ab8a4624407d8563e8d886ba Mon Sep 17 00:00:00 2001 From: eldy Date: Sat, 3 Sep 2011 01:08:37 +0200 Subject: [PATCH] Fix: Third party emails must not be visible into notification page --- htdocs/core/class/html.formmail.class.php | 6 +++--- htdocs/install/check.php | 3 ++- htdocs/societe/class/societe.class.php | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 5f6b6db8fcb..70c0b46fa54 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -381,7 +381,7 @@ class FormMail $liste=array(); $soc=new Societe($this->db); $soc->fetch($this->withtosocid); - foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value) + foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value) { $liste[$key]=$value; } @@ -415,7 +415,7 @@ class FormMail $liste=array(); $soc=new Societe($this->db); $soc->fetch($this->withtoccsocid); - foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value) + foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value) { $liste[$key]=$value; } @@ -449,7 +449,7 @@ class FormMail $liste=array(); $soc=new Societe($this->db); $soc->fetch($this->withtosocid); - foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value) + foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value) { $liste[$key]=$value; } diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 9b19d9793fc..8db17047a1b 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -194,7 +194,7 @@ else else { # If failed, we try to create an empty file - dolibarr_install_syslog("failed to copy file ".$conffile.".example into ".$conffile.". We try to create it."); + dolibarr_install_syslog("failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING); $fp = @fopen($conffile, "w"); if ($fp) @@ -204,6 +204,7 @@ else @fputs($fp,"?>"); fclose($fp); } + else dolibarr_install_syslog("failed to create a new file ".$conffile." into current dir ".getcwd().". Check permission.", LOG_ERR); } // First install, on ne peut pas upgrader diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fc8450ad55c..33afee55676 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1527,14 +1527,16 @@ class Societe extends CommonObject /** * Return list of contacts emails existing for third party - * @return array Array of contacts emails + * + * @param int $addthirdparty 1=Add also a record for thirdparty email + * @return array Array of contacts emails */ - function thirdparty_and_contact_email_array() + function thirdparty_and_contact_email_array($addthirdparty=0) { global $langs; $contact_emails = $this->contact_property_array('email'); - if ($this->email) + if ($this->email && $addthirdparty) { if (empty($this->name)) $this->name=$this->nom; // TODO: Tester si email non deja present dans tableau contact