Fix: Forging email content must use dol_concatdesc.
This commit is contained in:
parent
b74bdb8f7d
commit
5086450f35
@ -617,11 +617,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
|||||||
else
|
else
|
||||||
$subject = $langs->transnoentities('Propal') . ' ' . $object->ref;
|
$subject = $langs->transnoentities('Propal') . ' ' . $object->ref;
|
||||||
$actiontypecode = 'AC_PROP';
|
$actiontypecode = 'AC_PROP';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||||
if ($message) {
|
if ($message) {
|
||||||
$actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg .= $message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
$actionmsg2 = $langs->transnoentities('Action' . $actiontypecode);
|
$actionmsg2 = $langs->transnoentities('Action' . $actiontypecode);
|
||||||
|
|
||||||
|
|||||||
@ -1225,11 +1225,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
|||||||
else
|
else
|
||||||
$subject = $langs->transnoentities('Order') . ' ' . $object->ref;
|
$subject = $langs->transnoentities('Order') . ' ' . $object->ref;
|
||||||
$actiontypecode = 'AC_COM';
|
$actiontypecode = 'AC_COM';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||||
if ($message) {
|
if ($message) {
|
||||||
$actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg .= $message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
$actionmsg2 = $langs->transnoentities('Action' . $actiontypecode);
|
$actionmsg2 = $langs->transnoentities('Action' . $actiontypecode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1627,31 +1627,19 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||||
|
|
||||||
if ($action == 'send') {
|
if ($action == 'send' || $action == 'relance')
|
||||||
|
{
|
||||||
if (dol_strlen($_POST['subject']))
|
if (dol_strlen($_POST['subject']))
|
||||||
$subject = $_POST['subject'];
|
$subject = $_POST['subject'];
|
||||||
else
|
else
|
||||||
$subject = $langs->transnoentities('Bill') . ' ' . $object->ref;
|
$subject = $langs->transnoentities('Bill') . ' ' . $object->ref;
|
||||||
$actiontypecode = 'AC_FAC';
|
$actiontypecode = 'AC_FAC';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||||
if ($message) {
|
if ($message) {
|
||||||
$actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg .= $message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
}
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
// $actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
|
||||||
}
|
|
||||||
if ($action == 'relance') {
|
|
||||||
if (dol_strlen($_POST['subject']))
|
|
||||||
$subject = $_POST['subject'];
|
|
||||||
else
|
|
||||||
$subject = $langs->transnoentities('Relance facture ' . $object->ref);
|
|
||||||
$actiontypecode = 'AC_FAC';
|
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n";
|
|
||||||
if ($message) {
|
|
||||||
$actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n";
|
|
||||||
$actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n";
|
|
||||||
$actionmsg .= $message;
|
|
||||||
}
|
}
|
||||||
// $actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
// $actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
||||||
}
|
}
|
||||||
@ -1661,9 +1649,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
$attachedfiles = $formmail->get_attached_files();
|
$attachedfiles = $formmail->get_attached_files();
|
||||||
$filepath = $attachedfiles ['paths'];
|
$filepath = $attachedfiles['paths'];
|
||||||
$filename = $attachedfiles ['names'];
|
$filename = $attachedfiles['names'];
|
||||||
$mimetype = $attachedfiles ['mimes'];
|
$mimetype = $attachedfiles['mimes'];
|
||||||
|
|
||||||
// Send mail
|
// Send mail
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||||
|
|||||||
@ -136,12 +136,13 @@ if ($action == 'presend' && GETPOST('sendmail'))
|
|||||||
$message=make_substitutions($message, $substitutionarray);
|
$message=make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
$actiontypecode='AC_FAC';
|
$actiontypecode='AC_FAC';
|
||||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg.=$message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create form object
|
// Create form object
|
||||||
|
|||||||
@ -126,13 +126,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
if ($action == 'send' || $action == 'relance')
|
if ($action == 'send' || $action == 'relance')
|
||||||
{
|
{
|
||||||
if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
|
if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
|
||||||
$actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg.=$message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
|||||||
*/
|
*/
|
||||||
class Interfaces
|
class Interfaces
|
||||||
{
|
{
|
||||||
var $dir; // Directory with all core and external triggers files
|
var $db;
|
||||||
|
var $dir; // Directory with all core and external triggers files
|
||||||
var $errors = array(); // Array for errors
|
var $errors = array(); // Array for errors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -83,7 +83,8 @@ abstract class DolibarrTriggers
|
|||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
if (!isset($this->name)) {
|
if (empty($this->name))
|
||||||
|
{
|
||||||
$this->name = preg_replace('/^Interface/i', '', get_class($this));
|
$this->name = preg_replace('/^Interface/i', '', get_class($this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -462,12 +462,13 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile'
|
|||||||
if (dol_strlen(GETPOST('subject','alpha'))) $subject=GETPOST('subject','alpha');
|
if (dol_strlen(GETPOST('subject','alpha'))) $subject=GETPOST('subject','alpha');
|
||||||
else $subject = $langs->transnoentities('Shipping').' '.$object->ref;
|
else $subject = $langs->transnoentities('Shipping').' '.$object->ref;
|
||||||
$actiontypecode='AC_SHIP';
|
$actiontypecode='AC_SHIP';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg.=$message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -745,12 +745,13 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
|
|||||||
if (strlen(GETPOST('subject','alphs'))) $subject = GETPOST('subject','alpha');
|
if (strlen(GETPOST('subject','alphs'))) $subject = GETPOST('subject','alpha');
|
||||||
else $subject = $langs->transnoentities('Intervention').' '.$object->ref;
|
else $subject = $langs->transnoentities('Intervention').' '.$object->ref;
|
||||||
$actiontypecode='AC_OTH_AUTO';
|
$actiontypecode='AC_OTH_AUTO';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg.=$message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
$actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
|
$actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -944,12 +944,13 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
|||||||
if (dol_strlen(GETPOST('subject'))) $subject=GETPOST('subject');
|
if (dol_strlen(GETPOST('subject'))) $subject=GETPOST('subject');
|
||||||
else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref;
|
else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref;
|
||||||
$actiontypecode='AC_SUP_ORD';
|
$actiontypecode='AC_SUP_ORD';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg.=$message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -903,12 +903,13 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
|
|||||||
if (dol_strlen($_POST['subject'])) $subject=$_POST['subject'];
|
if (dol_strlen($_POST['subject'])) $subject=$_POST['subject'];
|
||||||
else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref;
|
else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref;
|
||||||
$actiontypecode='AC_SUP_INV';
|
$actiontypecode='AC_SUP_INV';
|
||||||
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
|
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||||
if ($message)
|
if ($message)
|
||||||
{
|
{
|
||||||
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
|
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||||
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||||
$actionmsg.=$message;
|
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||||
|
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||||
}
|
}
|
||||||
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user