forked from ZwiiCMS-Team/ZwiiCMS
Notifications en cours
This commit is contained in:
parent
5dfbe9a60d
commit
50fd8a3c9d
@ -571,6 +571,7 @@ class user extends common {
|
|||||||
}
|
}
|
||||||
// Stockage des données
|
// Stockage des données
|
||||||
foreach($csv as $item ) {
|
foreach($csv as $item ) {
|
||||||
|
|
||||||
// N'insére que les utilisateurs dont l'id n'existe pas
|
// N'insére que les utilisateurs dont l'id n'existe pas
|
||||||
// Vérifier la présence des champs
|
// Vérifier la présence des champs
|
||||||
if( array_key_exists('id', $item)
|
if( array_key_exists('id', $item)
|
||||||
@ -578,7 +579,7 @@ class user extends common {
|
|||||||
AND array_key_exists('nom',$item)
|
AND array_key_exists('nom',$item)
|
||||||
AND array_key_exists('groupe',$item)
|
AND array_key_exists('groupe',$item)
|
||||||
AND array_key_exists('email',$item)
|
AND array_key_exists('email',$item)
|
||||||
AND !$this->getData(['user', $item['id']])
|
AND !$this->getData(['user',helper::filter($item['id'] , helper::FILTER_ID)])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Nettoyage de l'identifiant
|
// Nettoyage de l'identifiant
|
||||||
@ -601,16 +602,9 @@ class user extends common {
|
|||||||
"accessTimer" => null,
|
"accessTimer" => null,
|
||||||
"accessCsrf" => null
|
"accessCsrf" => null
|
||||||
]]);
|
]]);
|
||||||
// Création du tableau de confirmation
|
|
||||||
self::$users[] = [
|
// Icône de notification
|
||||||
$userId,
|
$item['notification'] = template::ico('check');
|
||||||
$item['nom'],
|
|
||||||
$item['prenom'],
|
|
||||||
self::$groups[$item['groupe']],
|
|
||||||
$item['prenom'],
|
|
||||||
$item['email'],
|
|
||||||
$item['notification']
|
|
||||||
];
|
|
||||||
// Envoi du mail
|
// Envoi du mail
|
||||||
if ($this->getInput('userImportNotification',helper::FILTER_BOOLEAN) === true) {
|
if ($this->getInput('userImportNotification',helper::FILTER_BOOLEAN) === true) {
|
||||||
$sent = $this->sendMail(
|
$sent = $this->sendMail(
|
||||||
@ -621,16 +615,32 @@ class user extends common {
|
|||||||
'<strong>Identifiant du compte :</strong> ' . $userId . '<br>' .
|
'<strong>Identifiant du compte :</strong> ' . $userId . '<br>' .
|
||||||
'<small>Un mot de passe provisoire vous été attribué, à la première connexion cliquez sur Mot de passe Oublié.</small>'
|
'<small>Un mot de passe provisoire vous été attribué, à la première connexion cliquez sur Mot de passe Oublié.</small>'
|
||||||
);
|
);
|
||||||
$item['notification'] = $sent === true ? 'Mail' : template::ico('check') ;
|
if ($sent === true) {
|
||||||
} else {
|
// Mail envoyé changement de l'icône
|
||||||
$item['notification'] = template::ico('check');
|
$item['notification'] = template::ico('comment') ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Création du tableau de confirmation
|
||||||
|
self::$users[] = [
|
||||||
|
$userId,
|
||||||
|
$item['nom'],
|
||||||
|
$item['prenom'],
|
||||||
|
self::$groups[$item['groupe']],
|
||||||
|
$item['prenom'],
|
||||||
|
$item['email'],
|
||||||
|
$item['notification']
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$item['notification'] = template::ico('cancel');
|
$item['notification'] = template::ico('cancel');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$notification = 'importation effectuée' ;
|
if (empty(self::$users)) {
|
||||||
$success = true;
|
$notification = 'Rien à importer' ;
|
||||||
|
$success = false;
|
||||||
|
} else {
|
||||||
|
$notification = 'Importation effectuée' ;
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$notification = 'Erreur de lecture, vérifiez les permissions';
|
$notification = 'Erreur de lecture, vérifiez les permissions';
|
||||||
$success = false;
|
$success = false;
|
||||||
|
@ -54,4 +54,9 @@
|
|||||||
<?php echo template::formClose(); ?>
|
<?php echo template::formClose(); ?>
|
||||||
<?php if ($module::$users): ?>
|
<?php if ($module::$users): ?>
|
||||||
<?php echo template::table([1, 3, 3, 1, 1, 2, 1, 1 ], $module::$users, ['Identifiant', 'Nom', 'Prénom','Groupe', 'Pseudo', 'eMail', 'Succès']); ?>
|
<?php echo template::table([1, 3, 3, 1, 1, 2, 1, 1 ], $module::$users, ['Identifiant', 'Nom', 'Prénom','Groupe', 'Pseudo', 'eMail', 'Succès']); ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12 textAlignCenter">
|
||||||
|
<?php echo template::ico('check');?> Compte créé | <?php echo template::ico('comment');?> Compte créé et notifié | <?php echo template::ico('cancel');?> Erreur
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
Loading…
x
Reference in New Issue
Block a user