10.3.00 module installation corrections

This commit is contained in:
Fred Tempez 2020-09-09 14:23:05 +02:00
parent 19af48b777
commit 711e5fef44

View File

@ -38,6 +38,7 @@ class user extends common {
// Soumission du formulaire
if($this->isPost()) {
$check = true;
$sent = false;
// L'identifiant d'utilisateur est indisponible
$userId = $this->getInput('userAddId', helper::FILTER_ID, true);
if($this->getData(['user', $userId])) {
@ -54,12 +55,14 @@ class user extends common {
$userLastname = $this->getInput('userAddLastname', helper::FILTER_STRING_SHORT, true);
$userMail = $this->getInput('userAddMail', helper::FILTER_MAIL, true);
// Pas de nom saisi
if (empty($userFirstname) ||
empty($userLastname) ||
empty($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true)) ||
empty($this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true))) {
if (empty($userFirstname)
OR empty($userLastname)
OR empty($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true))
OR empty($this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true)) )
{
$check = false;
}
// Si tout est ok création effective
if ($check === true) {
$this->setData([
@ -74,9 +77,7 @@ class user extends common {
'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
]
]);
}
// Envoie le mail
$sent = true;
if($this->getInput('userAddSendMail', helper::FILTER_BOOLEAN) && $check === true) {
$sent = $this->sendMail(
$userMail,
@ -89,6 +90,7 @@ class user extends common {
null
);
}
}
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'user',