Fix : empty email on public membership form
We can validate the public membership form whith an empty email when `$conf->global->ADHERENT_MAIL_REQUIRED` is set. This fix it.
This commit is contained in:
parent
b00628118a
commit
196ebbb8e8
@ -208,9 +208,12 @@ if (empty($reshook) && $action == 'add') {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
|
||||
}
|
||||
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && empty(GETPOST('email'))) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."<br>\n";
|
||||
} elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||
+ $langs->load('errors');
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\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 '</td></tr>';
|
||||
}
|
||||
// EMail
|
||||
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||
print '<tr><td>'.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' <span style="color:red;">*</span>' : '').'</td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user