From d00770967e47e9c16a453d2e353f9085aadbc2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Sat, 21 Dec 2024 22:46:53 +0100 Subject: [PATCH] =?UTF-8?q?1.15.02=20Configuration=20du=20site,=20la=20pag?= =?UTF-8?q?e=20ne=20se=20recharge=20plus=20apr=C3=A8s=20un=20changement=20?= =?UTF-8?q?d'onglet.=20Le=20dernier=20onglet=20vu=20avant=20un=20submit=20?= =?UTF-8?q?est=20m=C3=A9moris=C3=A9.=20Mise=20=C3=A0=20jour=20module=20sus?= =?UTF-8?q?cribe=202.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/config/config.php | 34 ++++++++-------------- core/module/config/view/index/index.js.php | 5 ++++ core/module/config/view/index/index.php | 9 +++--- module/suscribe/changes.md | 2 ++ module/suscribe/enum.json | 2 +- module/suscribe/suscribe.php | 3 +- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/core/module/config/config.php b/core/module/config/config.php index 37e5dd6..3aa8949 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -31,7 +31,6 @@ class config extends common 'logDownload' => self::GROUP_ADMIN, 'blacklistReset' => self::GROUP_ADMIN, 'blacklistDownload' => self::GROUP_ADMIN, - 'register' => self::GROUP_ADMIN, 'testmail' => self::GROUP_ADMIN, ]; @@ -536,6 +535,18 @@ class config extends common ] ]); + + // Sauvegarde la position des onglets de la vue de l'utilisateur courant + $this->setData([ + 'user', + $this->getUser('id'), + 'view', + [ + 'config' => $this->getInput('containerSelected'), + 'page' => $this->getData(['user', $this->getUser('id'), 'view', 'page']), + ] + ]); + // Efface les fichiers de backup lorsque l'option est désactivée if ($this->getInput('configFileBackup', helper::FILTER_BOOLEAN) === false) { $path = realpath('site/data'); @@ -976,27 +987,6 @@ class config extends common } } - /** - * Stocke la variable dans les paramètres de l'utilisateur pour activer la tab à sa prochaine visite - * @return never - */ - public function register(): void - { - $this->setData([ - 'user', - $this->getUser('id'), - 'view', - [ - 'config' => $this->getUrl(2), - 'page' => $this->getData(['user', $this->getUser('id'), 'view', 'page']), - ] - ]); - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . 'config/' . $this->getUrl(2), - ]); - } - /** * Envoi un message de test * @return void diff --git a/core/module/config/view/index/index.js.php b/core/module/config/view/index/index.js.php index 29ec75d..2f20cbd 100644 --- a/core/module/config/view/index/index.js.php +++ b/core/module/config/view/index/index.js.php @@ -164,6 +164,7 @@ $(document).ready(function () { $("#connectContainer").hide(); $("#networkContainer").hide(); $("#localeContainer").show(); + document.getElementById("containerSelected").value = "locale"; $("#configSetupButton").removeClass("activeButton"); $("#configLocaleButton").addClass("activeButton"); $("#configSocialButton").removeClass("activeButton"); @@ -176,6 +177,7 @@ $(document).ready(function () { $("#connectContainer").hide(); $("#networkContainer").hide(); $("#setupContainer").show(); + document.getElementById("containerSelected").value = "setup"; $("#configSetupButton").addClass("activeButton"); $("#configLocaleButton").removeClass("activeButton"); $("#configSocialButton").removeClass("activeButton"); @@ -189,6 +191,7 @@ $(document).ready(function () { $("#localeContainer").hide(); $("#networkContainer").hide(); $("#socialContainer").show(); + document.getElementById("containerSelected").value = "social"; $("#configSetupButton").removeClass("activeButton"); $("#configLocaleButton").removeClass("activeButton"); $("#configSocialButton").addClass("activeButton"); @@ -201,6 +204,7 @@ $(document).ready(function () { $("#socialContainer").hide(); $("#networkContainer").hide(); $("#connectContainer").show(); + document.getElementById("containerSelected").value = "connect"; $("#configSetupButton").removeClass("activeButton"); $("#configLocaleButton").removeClass("activeButton"); $("#configSocialButton").removeClass("activeButton"); @@ -213,6 +217,7 @@ $(document).ready(function () { $("#socialContainer").hide(); $("#connectContainer").hide(); $("#networkContainer").show(); + document.getElementById("containerSelected").value = "network"; $("#configSetupButton").removeClass("activeButton"); $("#configLocaleButton").removeClass("activeButton"); $("#configSocialButton").removeClass("activeButton"); diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index c926106..30ec8a7 100644 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -19,24 +19,25 @@ 'Configuration', 'class' => 'buttonTab', - 'href' => helper::baseUrl() . 'config/register/setup' ]); ?> 'Référencement', 'class' => 'buttonTab', - 'href' => helper::baseUrl() . 'config/register/social' ]); ?> 'Connexion', 'class' => 'buttonTab', - 'href' => helper::baseUrl() . 'config/register/connect' ]); ?> 'Réseau', 'class' => 'buttonTab', - 'href' => helper::baseUrl() . 'config/register/network' ]); ?> + + + + + diff --git a/module/suscribe/changes.md b/module/suscribe/changes.md index f98ed9e..ca7f9f2 100644 --- a/module/suscribe/changes.md +++ b/module/suscribe/changes.md @@ -1,3 +1,5 @@ +# Version 2.4 +- L'approbation par un administrateur initialise le pseudo avec l'id de l'utilisateur. # Version 2.3 - Warning lors de la saisie d'un email vide # Version 2.2 diff --git a/module/suscribe/enum.json b/module/suscribe/enum.json index 37ede75..ef1e069 100644 --- a/module/suscribe/enum.json +++ b/module/suscribe/enum.json @@ -1 +1 @@ -{"name":"suscribe","realName":"Auto Inscription","version":"2.3","update":"0.0","delete":true,"dataDirectory":""} \ No newline at end of file +{"name":"suscribe","realName":"Auto Inscription","version":"2.4","update":"0.0","delete":true,"dataDirectory":""} \ No newline at end of file diff --git a/module/suscribe/suscribe.php b/module/suscribe/suscribe.php index 78142df..035b3c1 100755 --- a/module/suscribe/suscribe.php +++ b/module/suscribe/suscribe.php @@ -15,7 +15,7 @@ class suscribe extends common { - const VERSION = '2.3'; + const VERSION = '2.4'; const REALNAME = 'Auto Inscription'; const DELETE = true; const UPDATE = '0.0'; @@ -315,6 +315,7 @@ class suscribe extends common 'password' => '', // pas de groupe afin de le différencier dans la liste des users 'timer' => time(), + 'pseudo' => $userId, 'auth' => $auth, 'status' => self::STATUS_EMAIL_AWAITING ]