From 9679724a4db1dc54d976c7dc187324652937221b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jun 2026 11:33:43 +0200 Subject: [PATCH 1/4] FIX in list we must not make DNS checks to validate emails --- htdocs/adherents/list.php | 5 +++-- htdocs/contact/list.php | 5 +++-- htdocs/contrat/list.php | 4 ++-- htdocs/resource/list.php | 3 ++- htdocs/societe/list.php | 3 ++- htdocs/user/list.php | 3 ++- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index b5a5477c240..4c9542ee623 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1494,8 +1494,9 @@ while ($i < $imaxinloop) { } // EMail if (!empty($arrayfields['d.email']['checked'])) { - print ''; - print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1); + print ''; + $showinvalidemail = getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1); // in list, we check only syntax of emails + print dol_print_email($obj->email, 0, 0, 1, 64, $showinvalidemail, 1); print "\n"; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index bafa70f8bf6..fecf988bb50 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1684,11 +1684,12 @@ while ($i < $imaxinloop) { // EMail if (!empty($arrayfields['p.email']['checked'])) { - print ''; + print ''; if ($contextpage == 'poslist') { print $obj->email; } else { - print dol_print_email($obj->email, $obj->rowid, $obj->socid, 1, 18, 0, 1); + $showinvalidemail = getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1); // in list, we check only syntax of emails + print dol_print_email($obj->email, $obj->rowid, $obj->socid, 1, 18, $showinvalidemail, 1); } print ''; if (!$i) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a341e7d8fbd..0299d39aa3b 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1274,8 +1274,8 @@ while ($i < $imaxinloop) { } // Email if (!empty($arrayfields['s.email']['checked'])) { - $showinvalidemail = (int) !getDolGlobalInt('MAIN_DISABLE_SHOW_INVALID_EMAIL'); // to avoid slow display - print ''.dol_print_email($obj->email, 0, $obj->socid, 1, 0, $showinvalidemail, 1).''; + $showinvalidemail = (int) !getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST'); // to avoid slow display + print ''.dol_print_email($obj->email, 0, $obj->socid, 1, 0, $showinvalidemail, 1).''; } // Town if (!empty($arrayfields['s.town']['checked'])) { diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 4146d800d43..498440bd602 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -705,7 +705,8 @@ while ($i < $imaxinloop) { } if (!empty($arrayfields['t.email']['checked'])) { - print ''.dol_print_email($objectstatic->email, 0, 0, 1, 0, 0, 1).''; + $showinvalidemail = (int) !getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST'); // to avoid slow display + print ''.dol_print_email($objectstatic->email, 0, 0, 1, 0, $showinvalidemail, 1).''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index aa540dabae7..1e18b87713c 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -2182,7 +2182,8 @@ while ($i < $imaxinloop) { } // Email if (!empty($arrayfields['s.email']['checked'])) { - print ''.dol_print_email($obj->email, $obj->rowid, $obj->rowid, 1, 0, 0, 1)."\n"; + $showinvalidemail = (int) !getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST'); // to avoid slow display + print ''.dol_print_email($obj->email, $obj->rowid, $obj->rowid, 1, 0, $showinvalidemail, 1)."\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 48d6993f668..b652c3a0ba3 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1246,7 +1246,8 @@ while ($i < $imaxinloop) { } // Email if (!empty($arrayfields['u.email']['checked'])) { - print ''.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc, 1, 0, 0, 1)."\n"; + $showinvalidemail = (int) !getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST'); // to avoid slow display + print ''.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc, 1, 0, $showinvalidemail, 1)."\n"; if (!$i) { $totalarray['nbfield']++; } From a8713b2e7db6502009fb14170e8408183ff9856a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jun 2026 17:35:35 +0200 Subject: [PATCH 2/4] Fix css --- htdocs/public/members/new.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index bc389ac86a0..2469af930f4 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -656,13 +656,14 @@ print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"' print '
'; print '
'; -print '
'; +print '

'; if (getDolGlobalString('MEMBER_NEWFORM_TEXT')) { print $langs->trans(getDolGlobalString('MEMBER_NEWFORM_TEXT'))."
\n"; } else { print $langs->trans("NewSubscriptionDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."
\n"; } print '
'; +print '
'; dol_htmloutput_errors($errmsg); dol_htmloutput_events(); @@ -1280,13 +1281,22 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR $amountbytype = $adht->amountByType(1); // Load the array of amount per type print ''; + // Label - print ''.dolPrintHTML($objp->label).''; + print ''; + print '
'; + print dolPrintHTML($objp->label); + print '
'; + print ''; + // Duration print ''; $unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration); + print ''; print max(1, intval($objp->duration)).' '.$units[$unit]; + print ''; print ''; + // Amount print ''; @@ -1319,7 +1329,8 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR print "–"; // No subscription required } print ''; - print ''; + + print ''; if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } elseif ($objp->morphy == 'mor') { @@ -1328,6 +1339,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR print $langs->trans("MorAndPhy"); } print ''; + if (empty($hidevoteallowed)) { print ''.yn($objp->vote).''; } From 7fb6093924e3231431071ee77d31163e9f47d9f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jun 2026 17:44:48 +0200 Subject: [PATCH 3/4] Fix MAIN_SHOW_INVALID_EMAIL_IN_LIST option --- htdocs/contrat/list.php | 2 +- htdocs/core/lib/functions.lib.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 0299d39aa3b..8704da77051 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1274,7 +1274,7 @@ while ($i < $imaxinloop) { } // Email if (!empty($arrayfields['s.email']['checked'])) { - $showinvalidemail = (int) !getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST'); // to avoid slow display + $showinvalidemail = getDolGlobalInt('MAIN_SHOW_INVALID_EMAIL_IN_LIST', 1); // in list, we check only syntax of emails print ''.dol_print_email($obj->email, 0, $obj->socid, 1, 0, $showinvalidemail, 1).''; } // Town diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3929ce7d290..6165accb8b7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4394,12 +4394,12 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor * @param int $socid Id of third party if known * @param int|string $addlink 0=no link, 1=email has a html email link (+ link to create action if constant AGENDA_ADDACTIONFOREMAIL is on), 'thirdparty'=link to the thirdparty presend email * @param int $max Max number of characters to show. Use -1 to hide the mail text and show only the picto. - * @param int $showinvalid 1=Show warning if syntax email is wrong + * @param int $showinvalid 0=no check on email, 1=Show warning if syntax email is wrong (fast), 2=Check also DNS domain (slow) * @param int|string $withpicto 0=Show email, 1=Show picto of email + email, 2=Show only picto * @param string $morecss More CSS * @return string HTML Link */ -function dol_print_email($email, $contactid = 0, $socid = 0, $addlink = 0, $max = 0, $showinvalid = 1, $withpicto = 0, $morecss = 'paddingrightonly') +function dol_print_email($email, $contactid = 0, $socid = 0, $addlink = 0, $max = 0, $showinvalid = 2, $withpicto = 0, $morecss = 'paddingrightonly') { global $user, $langs, $hookmanager; @@ -4440,7 +4440,7 @@ function dol_print_email($email, $contactid = 0, $socid = 0, $addlink = 0, $max if (!isValidEmail($emailonly)) { $langs->load("errors"); $newemail .= img_warning($langs->transnoentitiesnoconv("ErrorBadEMail", $emailonly), '', 'paddingrightonly'); - } elseif (!isValidMailDomain($emailonly)) { + } elseif ($showinvalid == 2 && !isValidMailDomain($emailonly)) { $langs->load("errors"); $newemail .= img_warning($langs->transnoentitiesnoconv("ErrorBadMXDomain", $emailonly), '', 'paddingrightonly'); } @@ -4475,7 +4475,7 @@ function dol_print_email($email, $contactid = 0, $socid = 0, $addlink = 0, $max if (!isValidEmail($emailonly)) { $langs->load("errors"); $newemail .= img_warning($langs->transnoentitiesnoconv("ErrorBadEMail", $email)); - } elseif (!isValidMailDomain($emailonly)) { + } elseif ($showinvalid == 2 && !isValidMailDomain($emailonly)) { $langs->load("errors"); $newemail .= img_warning($langs->transnoentitiesnoconv("ErrorBadMXDomain", $emailonly)); } From 3fa1a2cae60117c68aee9b2f8f055c8f581be741 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jun 2026 17:56:12 +0200 Subject: [PATCH 4/4] css --- htdocs/public/members/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 2469af930f4..d986ae156d6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -1256,7 +1256,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR $num = $db->num_rows($result); print '
'; - print ''."\n"; + print '
'."\n"; print ''; print '';