diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index e6b7a3e7a38..19fa23af080 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -201,12 +201,12 @@ if (empty($reshook) && $action == 'add') {
$langs->load("errors");
$errmsg .= $langs->trans("ErrorPasswordsMustMatch")."
\n";
}
- if (!GETPOST("email")) {
+ if (!GETPOST('email')) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("EMail"))."
\n";
}
}
- if (GETPOST('type') <= 0) {
+ if (GETPOST('typeid') <= 0) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
\n";
}
@@ -214,21 +214,21 @@ if (empty($reshook) && $action == 'add') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('Nature'))."
\n";
}
- if (!GETPOST("lastname")) {
+ if (!GETPOST('lastname')) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n";
}
- if (!GETPOST("firstname")) {
+ if (!GETPOST('firstname') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n";
}
- if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
+ if (GETPOST('email') && !isValidEmail(GETPOST('email'))) {
$error++;
$langs->load("errors");
- $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n";
+ $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n";
}
- $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int'));
- if (GETPOSTISSET("birthmonth") && empty($birthday)) {
+ $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int'));
+ if GETPOSTISSET('birthmonth') && empty($birthday)) {
$error++;
$langs->load("errors");
$errmsg .= $langs->trans("ErrorBadDateFormat")."
\n";
@@ -240,36 +240,32 @@ if (empty($reshook) && $action == 'add') {
}
}
- if (GETPOSTISSET('public')) {
- $public = 1;
- } else {
- $public = 0;
- }
+ $public = GETPOSTISSET('public') ? 1 : 0;
if (!$error) {
// email a peu pres correct et le login n'existe pas
$adh = new Adherent($db);
$adh->statut = -1;
$adh->public = $public;
- $adh->firstname = GETPOST("firstname");
- $adh->lastname = GETPOST("lastname");
- $adh->gender = GETPOST("gender");
- $adh->civility_id = GETPOST("civility_id");
- $adh->societe = GETPOST("societe");
- $adh->address = GETPOST("address");
- $adh->zip = GETPOST("zipcode");
- $adh->town = GETPOST("town");
- $adh->email = GETPOST("email");
+ $adh->firstname = GETPOST('firstname');
+ $adh->lastname = GETPOST('lastname');
+ $adh->gender = GETPOST('gender');
+ $adh->civility_id = GETPOST('civility_id');
+ $adh->societe = GETPOST('societe');
+ $adh->address = GETPOST('address');
+ $adh->zip = GETPOST('zipcode');
+ $adh->town = GETPOST('town');
+ $adh->email = GETPOST('email');
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
- $adh->login = GETPOST("login");
- $adh->pass = GETPOST("pass1");
+ $adh->login = GETPOST('login');
+ $adh->pass = GETPOST('pass1');
}
- $adh->photo = GETPOST("photo");
- $adh->country_id = GETPOST("country_id", 'int');
- $adh->state_id = GETPOST("state_id", 'int');
- $adh->typeid = GETPOST("type", 'int');
- $adh->note_private = GETPOST("note_private");
- $adh->morphy = GETPOST("morphy");
+ $adh->photo = GETPOST('photo');
+ $adh->country_id = $conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE ? $conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE : GETPOST('country_id', 'int');
+ $adh->state_id = GETPOST('state_id', 'int');
+ $adh->typeid = $conf->global->MEMBER_NEWFORM_FORCETYPE ? $conf->global->MEMBER_NEWFORM_FORCETYPE : GETPOST('typeid', 'int');
+ $adh->note_private = GETPOST('note_private');
+ $adh->morphy = $conf->global->MEMBER_NEWFORM_FORCEMORPHY ? $conf->global->MEMBER_NEWFORM_FORCEMORPHY : GETPOST('morphy');
$adh->birth = $birthday;
@@ -562,11 +558,11 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
$isempty = 0;
}
print '