|
@@ -246,13 +246,15 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|
|
$linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
|
|
|
if (empty($linked_contacts) && !empty($conf->global->TICKET_NOTIFY_AT_CLOSING) && !empty($object->fk_soc)) {
|
|
|
$object->fetch_thirdparty();
|
|
|
- $linked_contacts[] = $object->thirdparty->email;
|
|
|
+ $linked_contacts[]['email'] = $object->thirdparty->email;
|
|
|
}
|
|
|
|
|
|
$contactid = GETPOST('contactid', 'int');
|
|
|
$res = 0;
|
|
|
|
|
|
if ($contactid > 0) {
|
|
|
+ // TODO This security test has no sens. We must check that $contactid is inside $linked_contacts[]['id'] when $linked_contacts[]['source'] = 'external' or 'thirdparty'
|
|
|
+ // Refuse email if not
|
|
|
$contact = new Contact($this->db);
|
|
|
$res = $contact->fetch($contactid);
|
|
|
if (! in_array($contact, $linked_contacts)) {
|