diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 1946125dbc2..f850cdff35c 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -208,9 +208,12 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; } - if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + if ($conf->global->ADHERENT_MAIL_REQUIRED && empty(GETPOST('email'))) { + $error++; + $errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."
\n"; + } elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) { ++ $langs->load('errors'); $error++; - $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } $birthday = dol_mktime($_POST["birthhour"], $_POST["birthmin"], $_POST["birthsec"], $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]); @@ -586,7 +589,7 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } // EMail -print ''.$langs->trans("Email").' *'."\n"; +print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''."\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Login").' *'."\n";