FIX : To have only the sender's entity when sending mail (#31053)

* fix

* Update html.formmail.class.php

* Update html.formmail.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: lvessiller-opendsi <lvessiller@open-dsi.fr>
This commit is contained in:
Thomas C. 2025-10-01 19:18:31 +02:00 committed by GitHub
parent 40e4a6959f
commit e1b919366e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -627,7 +627,7 @@ class FormMail extends Form
// Add also email aliases from the c_email_senderprofile table
$sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile";
$sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")";
$sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity in getEntity('c_email_senderprofile')";
$sql .= " ORDER BY position";
$resql = $this->db->query($sql);
if ($resql) {