ajout d'un utilisateur formulaire avec erreur sans envoi d'email
This commit is contained in:
parent
dd4fb9d8d1
commit
5a5682a0f6
@ -90,22 +90,23 @@ class user extends common
|
|||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
$check = true;
|
|
||||||
// L'identifiant d'utilisateur est indisponible
|
// L'identifiant d'utilisateur est indisponible
|
||||||
$userId = $this->getInput('userAddId', helper::FILTER_ID, true);
|
$userId = $this->getInput('userAddId', helper::FILTER_ID, true);
|
||||||
if ($this->getData(['user', $userId])) {
|
if ($this->getData(['user', $userId])) {
|
||||||
self::$inputNotices['userAddId'] = 'Identifiant déjà utilisé';
|
self::$inputNotices['userAddId'] = 'Identifiant déjà utilisé';
|
||||||
$check = false;
|
|
||||||
}
|
}
|
||||||
// Double vérification pour le mot de passe
|
// Double vérification pour le mot de passe
|
||||||
if ($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
|
if ($this->getInput('userAddPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('userAddConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
|
||||||
self::$inputNotices['userAddConfirmPassword'] = 'Incorrect';
|
self::$inputNotices['userAddConfirmPassword'] = 'Les mots de passe ne sont pas indentiques';
|
||||||
$check = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crée l'utilisateur
|
// Crée l'utilisateur
|
||||||
$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);
|
||||||
|
$pseudo = $this->getInput('userAddPseudo', helper::FILTER_STRING_SHORT, true);
|
||||||
|
$signature = $this->getInput('userAddSignature', helper::FILTER_INT, true);
|
||||||
|
$password = $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true);
|
||||||
|
|
||||||
// Profil
|
// Profil
|
||||||
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
||||||
@ -124,10 +125,10 @@ class user extends common
|
|||||||
'group' => $group,
|
'group' => $group,
|
||||||
'profil' => $profil,
|
'profil' => $profil,
|
||||||
'lastname' => $userLastname,
|
'lastname' => $userLastname,
|
||||||
'pseudo' => $this->getInput('userAddPseudo', helper::FILTER_STRING_SHORT, true),
|
'pseudo' => $pseudo,
|
||||||
'signature' => $this->getInput('userAddSignature', helper::FILTER_INT, true),
|
'signature' => $signature,
|
||||||
'mail' => $userMail,
|
'mail' => $userMail,
|
||||||
'password' => $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true),
|
'password' => $password,
|
||||||
'connectFail' => null,
|
'connectFail' => null,
|
||||||
'connectTimeout' => null,
|
'connectTimeout' => null,
|
||||||
'accessUrl' => null,
|
'accessUrl' => null,
|
||||||
@ -140,7 +141,10 @@ class user extends common
|
|||||||
|
|
||||||
// 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) &&
|
||||||
|
self::$inputNotices === []
|
||||||
|
) {
|
||||||
$sent = $this->sendMail(
|
$sent = $this->sendMail(
|
||||||
$userMail,
|
$userMail,
|
||||||
'Compte créé sur ' . $this->getData(['config', 'title']),
|
'Compte créé sur ' . $this->getData(['config', 'title']),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user