validation masque de saisie user

This commit is contained in:
Prof Langues 2020-09-24 11:34:26 +02:00
parent 7011373627
commit b6a448ca9b

View File

@ -53,28 +53,21 @@ class user extends common {
$userFirstname = $this->getInput('userAddFirstname', helper::FILTER_STRING_SHORT, true); $userFirstname = $this->getInput('userAddFirstname', helper::FILTER_STRING_SHORT, true);
$userLastname = $this->getInput('userAddLastname', helper::FILTER_STRING_SHORT, true); $userLastname = $this->getInput('userAddLastname', helper::FILTER_STRING_SHORT, true);
$userMail = $this->getInput('userAddMail', helper::FILTER_MAIL, true); $userMail = $this->getInput('userAddMail', helper::FILTER_MAIL, true);
// Vérification des saisies
if (empty($userFirstname) // Stockage des données
AND empty($userLastname) $this->setData([
AND empty($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true)) 'user',
AND empty($this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true))) { $userId,
$check = false; [
} 'firstname' => $userFirstname,
// Si tout est ok création effective 'forgot' => 0,
if ($check === true) { 'group' => $this->getInput('userAddGroup', helper::FILTER_INT, true),
$this->setData([ 'lastname' => $userLastname,
'user', 'mail' => $userMail,
$userId, 'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
[ ]
'firstname' => $userFirstname, ]);
'forgot' => 0,
'group' => $this->getInput('userAddGroup', helper::FILTER_INT, true),
'lastname' => $userLastname,
'mail' => $userMail,
'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
]
]);
}
// Envoie le mail // Envoie le mail
$sent = true; $sent = true;
if($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) { if($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) {