diff --git a/module/suscribe/changes.md b/module/suscribe/changes.md
new file mode 100644
index 0000000..bc857a9
--- /dev/null
+++ b/module/suscribe/changes.md
@@ -0,0 +1,6 @@
+# Version 1.4
+- Masque le code de vérification
+# Version 1.3
+- Remplacement de flatpick par date
+# Version 1.2
+- Compatiblité PHP 8.2
\ No newline at end of file
diff --git a/module/suscribe/enum.json b/module/suscribe/enum.json
new file mode 100644
index 0000000..d71c1fe
--- /dev/null
+++ b/module/suscribe/enum.json
@@ -0,0 +1 @@
+{"name":"registration","realName":"Auto-Inscription","version":"1.2","update":"0.0","delete":true,"dataDirectory":""}
\ No newline at end of file
diff --git a/module/suscribe/profil/main/add.inc.php b/module/suscribe/profil/main/add.inc.php
new file mode 100644
index 0000000..0b11c96
--- /dev/null
+++ b/module/suscribe/profil/main/add.inc.php
@@ -0,0 +1,9 @@
+ $this->getInput('profilAddSuscribeEdit', helper::FILTER_BOOLEAN),
+ 'delete' => $this->getInput('profilAddSuscribeDelete', helper::FILTER_BOOLEAN),
+ 'user' => $this->getInput('profilAddSuscribeUser', helper::FILTER_BOOLEAN),
+ 'config' => $this->getInput('profilAddSuscribeAdd', helper::FILTER_BOOLEAN) ||
+ $this->getInput('profilAddSuscribeEdit', helper::FILTER_BOOLEAN) ||
+ $this->getInput('profilAddSuscribeDelete', helper::FILTER_BOOLEAN) ||
+ $this->getInput('profilAddSuscribeUser', helper::FILTER_BOOLEAN)
+];
\ No newline at end of file
diff --git a/module/suscribe/profil/main/edit.inc.php b/module/suscribe/profil/main/edit.inc.php
new file mode 100644
index 0000000..f2d138c
--- /dev/null
+++ b/module/suscribe/profil/main/edit.inc.php
@@ -0,0 +1,9 @@
+ $this->getInput('profilEditSuscribeEdit', helper::FILTER_BOOLEAN),
+ 'delete' => $this->getInput('profilEditSuscribeDelete', helper::FILTER_BOOLEAN),
+ 'user' => $this->getInput('profilEditSuscribeUser', helper::FILTER_BOOLEAN),
+ 'config' => $this->getInput('profilEditSuscribeAdd', helper::FILTER_BOOLEAN) ||
+ $this->getInput('profilEditSuscribeEdit', helper::FILTER_BOOLEAN) ||
+ $this->getInput('profilEditSuscribeDelete', helper::FILTER_BOOLEAN) ||
+ $this->getInput('profilEditSuscribeUser', helper::FILTER_BOOLEAN)
+];
\ No newline at end of file
diff --git a/module/suscribe/profil/view/add.inc.php b/module/suscribe/profil/view/add.inc.php
new file mode 100644
index 0000000..38f39ed
--- /dev/null
+++ b/module/suscribe/profil/view/add.inc.php
@@ -0,0 +1,20 @@
+
\ No newline at end of file
diff --git a/module/suscribe/profil/view/edit.inc.php b/module/suscribe/profil/view/edit.inc.php
new file mode 100644
index 0000000..db36b39
--- /dev/null
+++ b/module/suscribe/profil/view/edit.inc.php
@@ -0,0 +1,26 @@
+
+
+
+
+ ·
+
+
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'edit'])
+ ]); ?>
+
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'delete'])
+ ]); ?>
+
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'suscribe', 'user'])
+ ]); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/module/suscribe/suscribe.php b/module/suscribe/suscribe.php
new file mode 100755
index 0000000..3717c2c
--- /dev/null
+++ b/module/suscribe/suscribe.php
@@ -0,0 +1,417 @@
+
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+class suscribe extends common
+{
+
+ const VERSION = '1.4';
+ const REALNAME = 'Auto-Inscription';
+ const DELETE = true;
+ const UPDATE = '0.0';
+ const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
+
+ const STATUS_AWAITING = NULL; // En attente de validation du mail
+ const STATUS_VALIDATED = -2; // Mail validé en attente d'un admin
+
+ public static $actions = [
+ 'index' => self::GROUP_VISITOR,
+ 'validate' => self::GROUP_VISITOR,
+ 'config' => self::GROUP_EDITOR,
+ 'user' => self::GROUP_EDITOR,
+ 'delete' => self::GROUP_EDITOR,
+ 'edit' => self::GROUP_EDITOR
+ ];
+
+ public static $statusGroups = [
+ self::STATUS_AWAITING => 'En attente',
+ self::STATUS_VALIDATED => 'Email validé',
+ ];
+
+ public static $timeLimit = [
+ 2 => '2 minutes',
+ 5 => '5 minutes',
+ 10 => '10 minutes'
+ ];
+
+ public static $users = [];
+
+
+
+ /**
+ * Liste des utilisateurs en attente
+ */
+ public function user()
+ {
+ $userIdsFirstnames = helper::arraycollumn($this->getData(['user']), 'firstname');
+ ksort($userIdsFirstnames);
+ foreach ($userIdsFirstnames as $userId => $userFirstname) {
+ if (
+ $this->getData(['user', $userId, 'group']) === self::STATUS_AWAITING ||
+ $this->getData(['user', $userId, 'group']) === self::STATUS_VALIDATED
+ ) {
+ self::$users[] = [
+ $userId,
+ $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']),
+ self::$statusGroups[$this->getData(['user', $userId, 'group'])],
+ helper::dateUTF8(date('Y-m-d G:i'), $this->getData(['user', $userId, 'timer'])),
+ template::button('registrationUserEdit' . $userId, [
+ 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $userId,
+ 'value' => template::ico('pencil')
+ ]),
+ template::button('registrationUserDelete' . $userId, [
+ 'class' => 'userDelete red',
+ 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $userId,
+ 'value' => template::ico('cancel')
+ ])
+ ];
+ }
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'title' => 'Demandes d\'inscription',
+ 'view' => 'user'
+ ]);
+ }
+
+
+ /**
+ * Édition
+ */
+ public function edit()
+ {
+ if (
+ $this->getUser('permission', __CLASS__, __FUNCTION__) !== true
+ ) {
+ // Valeurs en sortie
+ $this->addOutput([
+ 'access' => false
+ ]);
+ }
+ // Accès refusé
+ if (
+ // L'utilisateur n'existe pas
+ $this->getData(['user', $this->getUrl(2)]) === null
+ // Droit d'édition
+ and (
+ // Impossible de s'auto-éditer
+ (
+ $this->getUser('id') === $this->getUrl(2)
+ and $this->getUrl('group') <= self::GROUP_VISITOR
+ )
+ // Impossible d'éditer un autre utilisateur
+ or ($this->getUrl('group') < self::GROUP_EDITOR)
+ )
+ ) {
+ // Valeurs en sortie
+ $this->addOutput([
+ 'access' => false
+ ]);
+ }
+ // Accès autorisé
+ else {
+ // Soumission du formulaire
+ if (
+ $this->getUser('permission', __CLASS__, __FUNCTION__) === true
+ && $this->isPost()
+ ) {
+ // Modification du groupe
+ $this->setData([
+ 'user',
+ $this->getUrl(2),
+ [
+ 'firstname' => $this->getData(['user', $this->getUrl(2), 'firstname']),
+ 'forgot' => 0,
+ 'group' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT),
+ 'lastname' => $this->getData(['user', $this->getUrl(2), 'lastname']),
+ 'mail' => $this->getData(['user', $this->getUrl(2), 'mail']),
+ 'password' => $this->getData(['user', $this->getUrl(2), 'password']),
+ 'connectFail' => $this->getData(['user', $this->getUrl(2), 'connectFail']),
+ 'connectTimeout' => $this->getData(['user', $this->getUrl(2), 'connectTimeout']),
+ 'accessUrl' => $this->getData(['user', $this->getUrl(2), 'accessUrl']),
+ 'accessTimer' => $this->getData(['user', $this->getUrl(2), 'accessTimer']),
+ 'accessCsrf' => $this->getData(['user', $this->getUrl(2), 'accessCsrf'])
+ ]
+ ]);
+ // Notifier le user uniquement si le groupe est membre au moins membre
+ if ($this->getInput('registrationUserEditGroup') >= 1) {
+ $this->sendMail(
+ $this->getData(['user', $this->getUrl(2), 'mail']),
+ 'Approbation de l\'inscription',
+ '' . $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'mailValidateContent']) . '
',
+ null,
+ $this->getData(['config', 'smtp', 'from'])
+ );
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/user',
+ 'notification' => 'Modifications enregistrées',
+ 'state' => true
+ ]);
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'title' => $this->getData(['user', $this->getUrl(2), 'firstname']) . ' ' . $this->getData(['user', $this->getUrl(2), 'lastname']),
+ 'view' => 'edit'
+ ]);
+ }
+ }
+
+
+ /**
+ * Suppression
+ */
+ public function delete()
+ {
+ // Accès refusé
+ if (
+ // L'utilisateur n'existe pas
+ $this->getData(['user', $this->getUrl(2)]) === null
+ // Groupe insuffisant
+ and ($this->getUrl('group') < self::GROUP_EDITOR)
+ ) {
+ // Valeurs en sortie
+ $this->addOutput([
+ 'access' => false
+ ]);
+ }
+ // Jeton incorrect
+ if (
+ $this->getUser('permission', __CLASS__, __FUNCTION__) !== true
+ ) {
+ // Valeurs en sortie
+ $this->addOutput([
+ 'access' => false
+ ]);
+ }
+ // Bloque la suppression de son propre compte
+ elseif ($this->getUser('id') === $this->getUrl(2)) {
+ // Valeurs en sortie
+ $this->addOutput([
+ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/user',
+ 'notification' => 'Impossible de supprimer votre propre compte'
+ ]);
+ }
+ // Suppression
+ else {
+ $this->deleteData(['user', $this->getUrl(2)]);
+ // Valeurs en sortie
+ $this->addOutput([
+ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/user',
+ 'notification' => 'Utilisateur supprimé',
+ 'state' => true
+ ]);
+ }
+ }
+
+
+ /**
+ * Ajout
+ */
+ public function index()
+ {
+ // Soumission du formulaire
+ if ($this->getUser('permission', __CLASS__, __FUNCTION__) === true && $this->isPost()) {
+ $check = true;
+ // L'identifiant d'utilisateur est indisponible
+ $userId = $this->getInput('registrationAddId', helper::FILTER_ID, true);
+ if ($this->getData(['module', 'registration', $userId])) {
+ self::$inputNotices['registrationAddId'] = 'Identifiant déjà utilisé';
+ $check = false;
+ }
+ // Double vérification pour le mot de passe
+ if ($this->getInput('registrationAddPassword', helper::FILTER_STRING_SHORT, true) !== $this->getInput('registrationAddConfirmPassword', helper::FILTER_STRING_SHORT, true)) {
+ self::$inputNotices['registrationAddConfirmPassword'] = 'Incorrect';
+ $check = false;
+ }
+ // Le mail existe déjà
+ foreach ($this->getData(['user']) as $usersId => $user) {
+ if ($user['mail'] === $this->getInput('registrationAddMail', helper::FILTER_MAIL, true)) {
+ self::$inputNotices['registrationAddMail'] = 'Mail déjà utilisé';
+ $check = false;
+ break;
+ }
+ }
+ // Données de l'utilisateur
+ $userFirstname = $this->getInput('registrationAddFirstname', helper::FILTER_STRING_SHORT, true);
+ $userLastname = $this->getInput('registrationAddLastname', helper::FILTER_STRING_SHORT, true);
+ $userMail = $this->getInput('registrationAddMail', helper::FILTER_MAIL, true);
+ $userTimer = $this->getInput('registrationAddTimer', helper::FILTER_INT, true);
+ // Pas de nom saisi
+ if (
+ empty($userFirstname) ||
+ empty($userLastname) ||
+ empty($this->getInput('registrationAddPassword', helper::FILTER_STRING_SHORT, true)) ||
+ empty($this->getInput('registrationAddConfirmPassword', helper::FILTER_STRING_SHORT, true))
+ ) {
+ $check = false;
+ }
+ // Si tout est ok
+ if ($check === true) {
+ // création effective temporaire
+ $this->setData([
+ 'user',
+ $userId,
+ [
+ 'firstname' => $userFirstname,
+ 'lastname' => $userLastname,
+ 'mail' => $userMail,
+ 'password' => $this->getInput('registrationAddPassword', helper::FILTER_PASSWORD, true),
+ // pas de groupe afin de le différencier dans la liste des users
+ 'group' => null,
+ 'forgot' => 0,
+ 'timer' => $userTimer,
+ 'auth' => $_SESSION['csrf'],
+ 'status' => self::STATUS_AWAITING
+ ]
+ ]);
+ // Mail d'avertissement aux administrateurs
+ // Utilisateurs dans le groupe admin
+ $to = [];
+ foreach ($this->getData(['user']) as $userId => $user) {
+ if ($user['group'] == self::GROUP_ADMIN) {
+ $to[] = $user['mail'];
+ }
+ }
+ // Envoi du mail
+ if ($to) {
+ $messageAdmin = $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'state']) ? 'Une demande d\'inscription attend l`approbation d\'un administrateur.' : 'Un nouveau membre s\'est inscrit.';
+ // Envoi le mail
+ $this->sendMail(
+ $to,
+ 'Auto-inscription sur le site ' . $this->getData(['config', 'title']),
+ '' . $messageAdmin . '
' .
+ 'Identifiant du compte : ' . $userId . ' (' . $userFirstname . ' ' . $userLastname . ')
' .
+ 'Email : ' . $userMail . '
' .
+ 'Validation de l\'inscription',
+ null,
+ $this->getData(['config', 'smtp', 'from'])
+ );
+ }
+
+ // Mail de confirmation à l'utilisateur
+ // forger le lien de vérification
+ $validateLink = helper::baseUrl(true) . $this->getUrl() . '/validate/' . $userId;
+ // Envoi
+ $sentMailtoUser = false;
+ if ($check === true) {
+ $sentMailtoUser = $this->sendMail(
+ $userMail,
+ 'Confirmation de votre inscription',
+ '' . $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'mailRegisterContent']) . '
' .
+ 'Activer votre compte',
+ null,
+ $this->getData(['config', 'smtp', 'from'])
+ );
+ }
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'redirect' => helper::baseUrl(),
+ //'redirect' => $validateLink,
+ 'notification' => $sentMailtoUser ? "Consultez votre messagerie, un mail vous a été envoyé." : 'Quelque chose n\'a pas fonctionné !',
+ 'state' => $sentMailtoUser ? true : false
+ ]);
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'title' => 'Inscription',
+ 'view' => 'index',
+ 'showBarEditButton' => true,
+ 'showPageContent' => true
+ ]);
+ }
+
+ /**
+ * Vérification de l'email
+ */
+ public function validate()
+ {
+ // Vérifie la session + l'id + le timer
+ $check = true;
+ $notification = 'Bienvenue sur le site' . $this->getData(['config', 'title']);
+ $csrf = $this->getUrl(3);
+ $userId = $this->getUrl(2);
+ // Validité
+ if (time() - $this->getData(['user', $userId, 'timer']) <= (60 * $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'pageTimeOut']))) {
+ $check = false;
+ $notification = 'Le lien n\'est plus valide';
+ }
+ if (($csrf !== $this->getData(['user', $userId, 'auth']))) {
+ $check = false;
+ $notification = 'Identifiant ou mot de passe inconnu';
+ }
+ if ($check) {
+ $this->setData([
+ 'user',
+ $userId,
+ [
+ 'firstname' => $this->getData(['user', $userId, 'firstname']),
+ 'lastname' => $this->getData(['user', $userId, 'lastname']),
+ 'mail' => $this->getData(['user', $userId, 'mail']),
+ 'password' => $this->getData(['user', $userId, 'password']),
+ 'group' => $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'state']) === true ? self::STATUS_VALIDATED : self::GROUP_MEMBER,
+ 'forgot' => 0,
+ 'timer' => $this->getData(['user', $userId, 'timer'])
+ ]
+ ]);
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'redirect' => $check ? helper::baseUrl() . $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'pageSuccess']) : helper::baseUrl() . $this->getdata(['module', 'registration', $this->getUrl(0), 'config', 'pageError']),
+ 'notificaton' => $notification,
+ 'state' => $check
+ ]);
+ }
+
+ /**
+ * Module de configuration
+ */
+ public function config()
+ {
+ // Soumission du formulaire
+ if (
+ $this->getUser('permission', __CLASS__, __FUNCTION__) === true
+ && $this->isPost()
+ ) {
+ // Lire les options et les enregistrer
+ $this->setData([
+ 'module',
+ 'registration',
+ $this->getUrl(0),
+ 'config',
+ [
+ 'timeOut' => $this->getInput('registrationConfigTimeOut', helper::FILTER_INT),
+ 'pageSuccess' => $this->getInput('registrationConfigSuccess'),
+ 'pageError' => $this->getInput('registrationConfigError'),
+ 'state' => $this->getInput('registrationConfigState', helper::FILTER_BOOLEAN),
+ 'mailRegisterContent' => $this->getInput('registrationconfigMailRegisterContent', null, true),
+ 'mailValidateContent' => $this->getInput('registrationconfigMailValidateContent', null, true),
+ ]
+ ]);
+ $this->addOutput([
+ 'redirect' => helper::baseUrl() . $this->getUrl(),
+ 'notification' => 'Modifications enregistrées',
+ 'state' => true
+ ]);
+ }
+ // Valeurs en sortie
+ $this->addOutput([
+ 'title' => 'Configuration',
+ 'view' => 'config',
+ 'vendor' => ['tinymce']
+ ]);
+ }
+}
+
diff --git a/module/suscribe/view/config/config.css b/module/suscribe/view/config/config.css
new file mode 100755
index 0000000..66f9d77
--- /dev/null
+++ b/module/suscribe/view/config/config.css
@@ -0,0 +1,21 @@
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Rémi Jean
+ * @copyright Copyright (C) 2008-2018, Rémi Jean
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+/** NE PAS EFFACER
+* admin.css
+*/
+
+textarea .editorWysiwyg {
+ height : 100px;
+}
\ No newline at end of file
diff --git a/module/suscribe/view/config/config.php b/module/suscribe/view/config/config.php
new file mode 100755
index 0000000..79aca63
--- /dev/null
+++ b/module/suscribe/view/config/config.php
@@ -0,0 +1,85 @@
+
+
+
+
+ '',
+ 'href' => helper::baseUrl() .'page/edit/' . $this->getUrl(0) ,
+ 'ico' => 'left',
+ 'value' => 'Retour'
+ ]); ?>
+
+
+ helper::baseUrl() .$this->getUrl(0) . '/user' ,
+ 'value' => 'Inscriptions'
+ ]); ?>
+
+
+ 'green'
+ ]); ?>
+
+
+
+
+
+
Paramètres
+
+
+ 'Validité du lien',
+ 'selected' => $this->getData(['module','registration',$this->getUrl(0),'config','timeOut'])
+ ]); ?>
+
+
+
+
+ getData(['page']), 'title', 'SORT_ASC'), [
+ 'label' => 'Redirection après confirmation',
+ 'selected' => $this->getData(['module','registration',$this->getUrl(0),'config','pageSuccess'])
+ ]); ?>
+
+
+ getData(['page']), 'title', 'SORT_ASC'), [
+ 'label' => 'Redirection après erreur',
+ 'selected' => $this->getData(['module','registration',$this->getUrl(0),'config','pageError'])
+ ]); ?>
+
+
+
+
+ Confirmez votre inscription en cliquant sur ce lien dans les ... minutes.'; ?>
+ 'Corps du mail de confirmation',
+ 'value' => !empty($this->getData(['module','registration',$this->getUrl(0),'config','mailRegisterContent'])) ? $this->getData(['module','registration',$this->getUrl(0),'config','mailRegisterContent']) : $messageDefault,
+ 'class' => 'editorWysiwyg',
+ 'help' => 'Précisez la durée de validité. Le lien sera inséré après ces explications.'
+ ]); ?>
+
+
+
+
+ $this->getData(['module','registration',$this->getUrl(0),'config','state']),
+ 'help' => 'Les comptes sont inactifs tant que les inscriptions ne sont pas approuvées par un administrateur.',
+ 'check' => true
+ ]); ?>
+
+
+
+
+ Votre inscription a été approuvée par un administrateur.'; ?>
+ 'Corps du mail d\'approbation',
+ 'value' =>!empty($this->getData(['module','registration',$this->getUrl(0),'config','mailValidateContent'])) ? $this->getData(['module','registration',$this->getUrl(0),'config','mailValidateContent']) : $messageDefault,
+ 'class' => 'editorWysiwyg'
+ ]); ?>
+
+
+
+
+
+
+Version n°
+
diff --git a/module/suscribe/view/edit/edit.css b/module/suscribe/view/edit/edit.css
new file mode 100755
index 0000000..85db3ce
--- /dev/null
+++ b/module/suscribe/view/edit/edit.css
@@ -0,0 +1,17 @@
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Rémi Jean
+ * @copyright Copyright (C) 2008-2018, Rémi Jean
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+/** NE PAS EFFACER
+* admin.css
+*/
\ No newline at end of file
diff --git a/module/suscribe/view/edit/edit.js.php b/module/suscribe/view/edit/edit.js.php
new file mode 100755
index 0000000..05b585a
--- /dev/null
+++ b/module/suscribe/view/edit/edit.js.php
@@ -0,0 +1,19 @@
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+/**
+ * Droits des groupes
+ */
+$("#registrationUserEditGroup").on("change", function() {
+ $(".registrationUserEditGroupDescription").hide();
+ $("#registrationUserEditGroupDescription" + $(this).val()).show();
+}).trigger("change");
diff --git a/module/suscribe/view/edit/edit.php b/module/suscribe/view/edit/edit.php
new file mode 100755
index 0000000..07c8102
--- /dev/null
+++ b/module/suscribe/view/edit/edit.php
@@ -0,0 +1,111 @@
+
+
+
+ getUrl(3)): ?>
+ '',
+ 'href' => helper::baseUrl() . $this->geturl(0) . '/user',
+ 'ico' => 'left',
+ 'value' => 'Retour'
+ ]); ?>
+
+ '',
+ 'href' => helper::baseUrl(false),
+ 'ico' => 'home',
+ 'value' => 'Accueil'
+ ]); ?>
+
+
+
+ 'green'
+ ]); ?>
+
+
+
+
+
+
Confirmation de l'inscription
+
+
+
+
+ 'off',
+ 'label' => 'Prénom',
+ 'value' => $this->getData(['user', $this->getUrl(2), 'firstname']),
+ 'disabled'=> true
+ ]); ?>
+
+
+ 'off',
+ 'label' => 'Nom',
+ 'value' => $this->getData(['user', $this->getUrl(2), 'lastname']),
+ 'disabled'=> true
+ ]); ?>
+
+
+
+
+ 'off',
+ 'label' => 'Adresse électronique',
+ 'value' => $this->getData(['user', $this->getUrl(2), 'mail']),
+ 'disabled'=> true
+ ]); ?>
+
+
+
+
+ getData(['user', $this->getUrl(2), 'group'])];?>
+ 'État de l\'inscription',
+ 'value' => $status,
+ 'disabled'=> true,
+ 'help' => 'En attente : le mail n\'a pas encore été validé
Email validé : approbation nécessaire.'
+ ]); ?>
+
+
+ 'Date',
+ 'value' => helper::dateUTF8(date('Y-m-d G:i'), $this->getData(['user', $userId, 'timer'])),
+ 'disabled'=> true
+ ]); ?>
+
+
+
+
+
+ getUser('group') === self::GROUP_ADMIN): ?>
+ ($this->getUrl(2) === $this->getUser('id')),
+ 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
+ 'label' => 'Groupe
(Banni : en attente d\'approbation)',
+ 'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
+ ]); ?>
+ Autorisations :
+
+ - Accès aux pages privées membres
+
+
+ - Accès aux pages privées membres et éditeurs
+ - Ajout - Édition - Suppression de pages
+ - Ajout - Édition - Suppression de fichiers
+
+
+ - Accès à toutes les pages privées
+ - Ajout - Édition - Suppression de pages
+ - Ajout - Édition - Suppression de fichiers
+ - Ajout / Édition / Suppression d'utilisateurs
+ - Configuration du site
+ - Personnalisation du thème
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/module/suscribe/view/index/index.js.php b/module/suscribe/view/index/index.js.php
new file mode 100755
index 0000000..3baf44f
--- /dev/null
+++ b/module/suscribe/view/index/index.js.php
@@ -0,0 +1,47 @@
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+
+/**
+ * Affichage de l'id en simulant FILTER_ID
+ */
+$("#registrationAddId").on("change keydown keyup", function(event) {
+ var userId = $(this).val();
+ if(
+ event.keyCode !== 8 // BACKSPACE
+ && event.keyCode !== 37 // LEFT
+ && event.keyCode !== 39 // RIGHT
+ && event.keyCode !== 46 // DELETE
+ && window.getSelection().toString() !== userId // Texte sélectionné
+ ) {
+ var searchReplace = {
+ "á": "a", "à": "a", "â": "a", "ä": "a", "ã": "a", "å": "a", "ç": "c", "é": "e", "è": "e", "ê": "e", "ë": "e", "í": "i", "ì": "i", "î": "i", "ï": "i", "ñ": "n", "ó": "o", "ò": "o", "ô": "o", "ö": "o", "õ": "o", "ú": "u", "ù": "u", "û": "u", "ü": "u", "ý": "y", "ÿ": "y",
+ "Á": "A", "À": "A", "Â": "A", "Ä": "A", "Ã": "A", "Å": "A", "Ç": "C", "É": "E", "È": "E", "Ê": "E", "Ë": "E", "Í": "I", "Ì": "I", "Î": "I", "Ï": "I", "Ñ": "N", "Ó": "O", "Ò": "O", "Ô": "O", "Ö": "O", "Õ": "O", "Ú": "U", "Ù": "U", "Û": "U", "Ü": "U", "Ý": "Y", "Ÿ": "Y",
+ "'": "-", "\"": "-", " ": "-"
+ };
+ userId = userId.replace(/[áàâäãåçéèêëíìîïñóòôöõúùûüýÿ'" ]/ig, function(match) {
+ return searchReplace[match];
+ });
+ userId = userId.replace(/[^a-z0-9-]/ig, "");
+ $(this).val(userId);
+ }
+});
+
+/**
+ * Droits des groupes
+ */
+$("#registrationAddGroup").on("change", function() {
+ $(".registrationAddGroupDescription").hide();
+ $("#registrationAddGroupDescription" + $(this).val()).show();
+}).trigger("change");
+
+
diff --git a/module/suscribe/view/index/index.php b/module/suscribe/view/index/index.php
new file mode 100755
index 0000000..5a47c47
--- /dev/null
+++ b/module/suscribe/view/index/index.php
@@ -0,0 +1,82 @@
+
+
+
+
+
Identité
+
+
+ 'off',
+ 'label' => 'Prénom'
+ ]); ?>
+
+
+ 'off',
+ 'label' => 'Nom'
+ ]); ?>
+
+
+
+
+ 'off',
+ 'label' => 'Adresse électronique'
+ ]); ?>
+
+
+
+
+
+ self::GROUP_MEMBER
+ ]); ?>
+
+
+
+
+
Données de connexion
+
+
+ 'off',
+ 'label' => 'Identifiant de connexion'
+ ]); ?>
+
+
+
+
+ 'off',
+ 'label' => 'Mot de passe'
+ ]); ?>
+
+
+
+
+ 'off',
+ 'label' => 'Confirmation du mot de passe'
+ ]);
+ ?>
+
+
+
+
+
+ time()
+ ]);
+ ?>
+
+
+
+
+
+ 'Envoyer',
+ 'class' => 'green'
+ ]); ?>
+
+
+
diff --git a/module/suscribe/view/user/user.css b/module/suscribe/view/user/user.css
new file mode 100755
index 0000000..85db3ce
--- /dev/null
+++ b/module/suscribe/view/user/user.css
@@ -0,0 +1,17 @@
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Rémi Jean
+ * @copyright Copyright (C) 2008-2018, Rémi Jean
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+/** NE PAS EFFACER
+* admin.css
+*/
\ No newline at end of file
diff --git a/module/suscribe/view/user/user.js.php b/module/suscribe/view/user/user.js.php
new file mode 100755
index 0000000..1ed4c16
--- /dev/null
+++ b/module/suscribe/view/user/user.js.php
@@ -0,0 +1,21 @@
+/**
+ * This file is part of Zwii.
+ *
+ * For full copyright and license information, please see the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @author Frédéric Tempez
+ * @copyright Copyright (C) 2018-2020, Frédéric Tempez
+ * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
+ * @link http://zwiicms.com/
+ */
+
+/**
+ * Confirmation de suppression
+ */
+$(".registrationUserDelete").on("click", function() {
+ var _this = $(this);
+ return core.confirm("Êtes-vous sûr de vouloir supprimer cet utilisateur ?", function() {
+ $(location).attr("href", _this.attr("href"));
+ });
+});
\ No newline at end of file
diff --git a/module/suscribe/view/user/user.php b/module/suscribe/view/user/user.php
new file mode 100755
index 0000000..34650e3
--- /dev/null
+++ b/module/suscribe/view/user/user.php
@@ -0,0 +1,15 @@
+
+
+ '',
+ 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
+ 'value' => 'Retour'
+ ]); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/module/suscribe/view/validate/validate.php b/module/suscribe/view/validate/validate.php
new file mode 100755
index 0000000..923a0a1
--- /dev/null
+++ b/module/suscribe/view/validate/validate.php
@@ -0,0 +1,2 @@
+